mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Kernel

Threads by month
  • ----- 2025 -----
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
kernel@openeuler.org

  • 49 participants
  • 19111 discussions
[openeuler:OLK-6.6 1613/1613] include/linux/if_caqm.h:391:23: sparse: sparse: incorrect type in assignment (different base types)
by kernel test robot 18 Dec '24

18 Dec '24
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 46064348cc445799cf9e8fd030323a0426fbb5e4 commit: 946747d4a52c34156031e41f9cb5cfb292747dcf [1613/1613] net: tcp: Add CAQM4TCP in the openeuler 6.6 kernel config: loongarch-randconfig-r111-20241210 (https://download.01.org/0day-ci/archive/20241218/202412181628.dTVd4p1C-lkp@…) compiler: loongarch64-linux-gcc (GCC) 14.2.0 reproduce: (https://download.01.org/0day-ci/archive/20241218/202412181628.dTVd4p1C-lkp@…) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202412181628.dTVd4p1C-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) net/core/gro.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...): include/linux/page-flags.h:244:46: sparse: sparse: self-comparison always evaluates to false net/core/gro.c: note: in included file (through include/linux/ip.h, include/net/gro.h): include/linux/skbuff.h:2721:28: sparse: sparse: self-comparison always evaluates to false net/core/gro.c: note: in included file: >> include/linux/if_caqm.h:391:23: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] caqm_hdr_info @@ got restricted __be16 [usertype] h_caqm_info @@ include/linux/if_caqm.h:391:23: sparse: expected unsigned short [usertype] caqm_hdr_info include/linux/if_caqm.h:391:23: sparse: got restricted __be16 [usertype] h_caqm_info -- net/ethernet/eth.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/umh.h, include/linux/kmod.h, ...): include/linux/page-flags.h:244:46: sparse: sparse: self-comparison always evaluates to false net/ethernet/eth.c: note: in included file (through include/net/net_namespace.h, include/linux/inet.h): include/linux/skbuff.h:2721:28: sparse: sparse: self-comparison always evaluates to false net/ethernet/eth.c: note: in included file: >> include/linux/if_caqm.h:470:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] @@ got restricted __be16 [usertype] @@ include/linux/if_caqm.h:470:25: sparse: expected unsigned short [usertype] include/linux/if_caqm.h:470:25: sparse: got restricted __be16 [usertype] vim +391 include/linux/if_caqm.h 359 360 static inline void skb_gro_caqm_untag(struct sk_buff *skb) 361 { 362 #ifdef CONFIG_ETH_CAQM 363 struct caqm_hdr *chdr; 364 struct vlan_hdr *vlanhdr; 365 u16 caqm_hdr_info; 366 __be16 proto = skb->protocol; 367 u8 skip_time = 0; 368 int mac_len, meta_len; 369 void *meta; 370 struct caqm_hdr tmp_caqm_data; 371 372 if (!static_branch_unlikely(&sysctl_caqm_enable) || skb_shared(skb)) 373 return; 374 375 /* We may access the two bytes after caqm_hdr in caqm_set_encap_proto(). */ 376 if (unlikely(!pskb_may_pull(skb, VLAN_HLEN * 2 + CAQM_HLEN + sizeof(unsigned short)))) 377 return; 378 379 vlanhdr = (struct vlan_hdr *)(skb->data - VLAN_HLEN); 380 // Skip at most 2 vlan hdr 381 while (skip_time < 2 && eth_type_vlan(proto)) { 382 vlanhdr++; // chdr move a VLAN len 383 skip_time += 1; 384 proto = vlanhdr->h_vlan_encapsulated_proto; 385 } 386 // Look for vlan header, 2 times 387 if (!eth_type_caqm(proto) || skb_cow(skb, skb_headroom(skb)) < 0) 388 return; 389 390 chdr = (struct caqm_hdr *)(((void *)vlanhdr) + VLAN_HLEN); > 391 caqm_hdr_info = chdr->h_caqm_info; 392 __caqm_put_tag(skb, caqm_hdr_info); 393 394 if ((unsigned char *) chdr != skb->data) { 395 // adjust the caqm header before vlan header 396 // 1. Set the vlanhdr->proto as the next 397 vlanhdr->h_vlan_encapsulated_proto = chdr->h_caqm_encapsulated_proto; 398 // 2. Exchange caqm and vlan hdr 399 tmp_caqm_data = *chdr; 400 memmove(skb->data + CAQM_HLEN, skb->data, skip_time * VLAN_HLEN); 401 *(struct caqm_hdr *)(skb->data) = tmp_caqm_data; 402 } else 403 caqm_set_encap_proto(skb, chdr); 404 405 skb_pull_rcsum(skb, CAQM_HLEN); 406 407 mac_len = skb->data - skb_mac_header(skb); 408 if (likely(mac_len > CAQM_HLEN + ETH_TLEN)) { 409 memmove(skb_mac_header(skb) + CAQM_HLEN, skb_mac_header(skb), 410 mac_len - CAQM_HLEN - ETH_TLEN); 411 } 412 413 meta_len = skb_metadata_len(skb); 414 if (meta_len) { 415 meta = skb_metadata_end(skb) - meta_len; 416 memmove(meta + CAQM_HLEN, meta, meta_len); 417 } 418 419 skb->mac_header += CAQM_HLEN; 420 421 skb_reset_network_header(skb); 422 if (!skb_transport_header_was_set(skb)) 423 skb_reset_transport_header(skb); 424 skb_reset_mac_len(skb); 425 426 #endif 427 } 428 429 #ifdef CONFIG_ETH_CAQM 430 static inline __be16 caqm_get_protocol_and_depth(struct sk_buff *skb, 431 __be16 type, int *depth) 432 { 433 type = vlan_get_protocol_and_depth(skb, type, depth); 434 if (static_branch_unlikely(&sysctl_caqm_enable) && eth_type_caqm(type)) 435 return caqm_get_protocol_and_depth_after_vlan(skb, type, depth); 436 else 437 return type; 438 } 439 #endif 440 441 static inline void caqm_update_hint_in_gro(struct sk_buff *skb, struct sk_buff *p) 442 { 443 #ifdef CONFIG_ETH_CAQM 444 struct skb_caqm_info *cinfo_p = get_skb_caqm_info(p); 445 struct skb_caqm_info *cinfo_skb = get_skb_caqm_info(skb); 446 447 if (static_branch_unlikely(&sysctl_caqm_enable) && cinfo_p->recv_en && cinfo_skb->recv_en) { 448 cinfo_p->recv_hint += cinfo_skb->recv_hint; 449 cinfo_skb->recv_en = 0; 450 } 451 #endif 452 } 453 454 static inline int caqm_add_eth_header(struct sk_buff *skb, unsigned short *type, 455 struct net_device *dev) 456 { 457 #ifdef CONFIG_ETH_CAQM 458 struct skb_caqm_info *cinfo = get_skb_caqm_info(skb); 459 460 if (static_branch_unlikely(&sysctl_caqm_enable) && 461 (sysctl_caqm_filter_nics & (1UL << dev->ifindex)) == 0) 462 cinfo->send_en = 0; 463 if (static_branch_unlikely(&sysctl_caqm_enable) && cinfo->send_en) { 464 cinfo->send_en = 0; 465 if (unlikely(skb_headroom(skb) < ETH_HLEN + CAQM_HLEN)) 466 return -ETH_HLEN; 467 u16 *chdr = skb_push(skb, CAQM_HLEN); 468 469 chdr[0] = (cinfo->send_hdr); > 470 chdr[1] = htons(*type); 471 *type = (unsigned short)sysctl_caqm_tpid; 472 } 473 #endif 474 return 0; 475 } 476 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[PATCH OLK-6.6] fs: Allow fine-grained control of folio sizes
by Long Li 18 Dec '24

18 Dec '24
From: "Matthew Wilcox (Oracle)" <willy(a)infradead.org> mainline inclusion from mainline-v6.10-rc2 commit 84429b675bcfd2a518ae167ee4661cdf7539aa7d category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IBC20Q Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?… -------------------------------- We need filesystems to be able to communicate acceptable folio sizes to the pagecache for a variety of uses (e.g. large block sizes). Support a range of folio sizes between order-0 and order-31. Signed-off-by: Matthew Wilcox (Oracle) <willy(a)infradead.org> Co-developed-by: Pankaj Raghav <p.raghav(a)samsung.com> Signed-off-by: Pankaj Raghav <p.raghav(a)samsung.com> Link: https://lore.kernel.org/r/20240822135018.1931258-2-kernel@pankajraghav.com Tested-by: David Howells <dhowells(a)redhat.com> Reviewed-by: Hannes Reinecke <hare(a)suse.de> Reviewed-by: Darrick J. Wong <djwong(a)kernel.org> Reviewed-by: Daniel Gomez <da.gomez(a)samsung.com> Signed-off-by: Christian Brauner <brauner(a)kernel.org> Conflicts: include/linux/pagemap.h mm/filemap.c [Conflicts due to not merged 83ee0e20fd9f ("filemap: support disable large folios on active inode")] Signed-off-by: Long Li <leo.lilong(a)huawei.com> --- include/linux/pagemap.h | 90 +++++++++++++++++++++++++++++++++++------ mm/readahead.c | 4 +- 2 files changed, 79 insertions(+), 15 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 429627abfef4..e44e377661f2 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -203,12 +203,21 @@ enum mapping_flags { AS_EXITING = 4, /* final truncate in progress */ /* writeback related tags are not used */ AS_NO_WRITEBACK_TAGS = 5, - AS_LARGE_FOLIO_SUPPORT = 6, - AS_RELEASE_ALWAYS, /* Call ->release_folio(), even if no private data */ - AS_STABLE_WRITES, /* must wait for writeback before modifying + AS_RELEASE_ALWAYS = 6, /* Call ->release_folio(), even if no private data */ + AS_STABLE_WRITES = 7, /* must wait for writeback before modifying folio contents */ + AS_INACCESSIBLE = 8, /* Do not attempt direct R/W access to the mapping */ + /* Bits 16-25 are used for FOLIO_ORDER */ + AS_FOLIO_ORDER_BITS = 5, + AS_FOLIO_ORDER_MIN = 16, + AS_FOLIO_ORDER_MAX = AS_FOLIO_ORDER_MIN + AS_FOLIO_ORDER_BITS, }; +#define AS_FOLIO_ORDER_BITS_MASK ((1u << AS_FOLIO_ORDER_BITS) - 1) +#define AS_FOLIO_ORDER_MIN_MASK (AS_FOLIO_ORDER_BITS_MASK << AS_FOLIO_ORDER_MIN) +#define AS_FOLIO_ORDER_MAX_MASK (AS_FOLIO_ORDER_BITS_MASK << AS_FOLIO_ORDER_MAX) +#define AS_FOLIO_ORDER_MASK (AS_FOLIO_ORDER_MIN_MASK | AS_FOLIO_ORDER_MAX_MASK) + /** * mapping_set_error - record a writeback error in the address_space * @mapping: the mapping in which an error should be set @@ -348,9 +357,51 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask) #define MAX_XAS_ORDER (XA_CHUNK_SHIFT * 2 - 1) #define MAX_PAGECACHE_ORDER min(MAX_XAS_ORDER, PREFERRED_MAX_PAGECACHE_ORDER) +/* + * mapping_set_folio_order_range() - Set the orders supported by a file. + * @mapping: The address space of the file. + * @min: Minimum folio order (between 0-MAX_PAGECACHE_ORDER inclusive). + * @max: Maximum folio order (between @min-MAX_PAGECACHE_ORDER inclusive). + * + * The filesystem should call this function in its inode constructor to + * indicate which base size (min) and maximum size (max) of folio the VFS + * can use to cache the contents of the file. This should only be used + * if the filesystem needs special handling of folio sizes (ie there is + * something the core cannot know). + * Do not tune it based on, eg, i_size. + * + * Context: This should not be called while the inode is active as it + * is non-atomic. + */ +static inline void mapping_set_folio_order_range(struct address_space *mapping, + unsigned int min, + unsigned int max) +{ + if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) + return; + + if (min > MAX_PAGECACHE_ORDER) + min = MAX_PAGECACHE_ORDER; + + if (max > MAX_PAGECACHE_ORDER) + max = MAX_PAGECACHE_ORDER; + + if (max < min) + max = min; + + mapping->flags = (mapping->flags & ~AS_FOLIO_ORDER_MASK) | + (min << AS_FOLIO_ORDER_MIN) | (max << AS_FOLIO_ORDER_MAX); +} + +static inline void mapping_set_folio_min_order(struct address_space *mapping, + unsigned int min) +{ + mapping_set_folio_order_range(mapping, min, MAX_PAGECACHE_ORDER); +} + /** * mapping_set_large_folios() - Indicate the file supports large folios. - * @mapping: The file. + * @mapping: The address space of the file. * * The filesystem should call this function in its inode constructor to * indicate that the VFS can use large folios to cache the contents of @@ -361,7 +412,23 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask) */ static inline void mapping_set_large_folios(struct address_space *mapping) { - __set_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags); + mapping_set_folio_order_range(mapping, 0, MAX_PAGECACHE_ORDER); +} + +static inline unsigned int +mapping_max_folio_order(const struct address_space *mapping) +{ + if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) + return 0; + return (mapping->flags & AS_FOLIO_ORDER_MAX_MASK) >> AS_FOLIO_ORDER_MAX; +} + +static inline unsigned int +mapping_min_folio_order(const struct address_space *mapping) +{ + if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) + return 0; + return (mapping->flags & AS_FOLIO_ORDER_MIN_MASK) >> AS_FOLIO_ORDER_MIN; } /** @@ -375,7 +442,7 @@ static inline void mapping_set_large_folios(struct address_space *mapping) static inline void mapping_clear_large_folios(struct address_space *mapping) { WARN_ON_ONCE(!rwsem_is_locked(&mapping->invalidate_lock)); - __clear_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags); + mapping_set_folio_order_range(mapping, 0, 0); } /* @@ -384,20 +451,17 @@ static inline void mapping_clear_large_folios(struct address_space *mapping) */ static inline bool mapping_large_folio_support(struct address_space *mapping) { - /* AS_LARGE_FOLIO_SUPPORT is only reasonable for pagecache folios */ + /* AS_FOLIO_ORDER is only reasonable for pagecache folios */ VM_WARN_ONCE((unsigned long)mapping & PAGE_MAPPING_ANON, "Anonymous mapping always supports large folio"); - return IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && - test_bit(AS_LARGE_FOLIO_SUPPORT, &mapping->flags); + return mapping_max_folio_order(mapping) > 0; } /* Return the maximum folio size for this pagecache mapping, in bytes. */ -static inline size_t mapping_max_folio_size(struct address_space *mapping) +static inline size_t mapping_max_folio_size(const struct address_space *mapping) { - if (mapping_large_folio_support(mapping)) - return PAGE_SIZE << MAX_PAGECACHE_ORDER; - return PAGE_SIZE; + return PAGE_SIZE << mapping_max_folio_order(mapping); } static inline int filemap_nr_thps(struct address_space *mapping) diff --git a/mm/readahead.c b/mm/readahead.c index 438f142a3e74..c13c130efcca 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -513,10 +513,10 @@ void page_cache_ra_order(struct readahead_control *ractl, limit = min(limit, index + ra->size - 1); - if (new_order < MAX_PAGECACHE_ORDER) + if (new_order < mapping_max_folio_order(mapping)) new_order += 2; - new_order = min_t(unsigned int, MAX_PAGECACHE_ORDER, new_order); + new_order = min(mapping_max_folio_order(mapping), new_order); new_order = min_t(unsigned int, new_order, ilog2(ra->size)); /* See comment in page_cache_ra_unbounded() */ -- 2.39.2
2 1
0 0
[PATCH OLK-6.6,v2] kabi: net: reserve space for xdp subsystem related structure
by Zhang Changzhong 18 Dec '24

18 Dec '24
hulk inclusion category: other bugzilla: https://gitee.com/openeuler/kernel/issues/I8OWRC ---------------------------------------------------- Reserve some fields beforehand for xdp framework related structures prone to change. Signed-off-by: Zhang Changzhong <zhangchangzhong(a)huawei.com> --- include/net/xdp.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/net/xdp.h b/include/net/xdp.h index c283668..9b9c7dc 100644 --- a/include/net/xdp.h +++ b/include/net/xdp.h @@ -54,6 +54,9 @@ enum xdp_mem_type { struct xdp_mem_info { u32 type; /* enum xdp_mem_type, but known size type */ u32 id; + + KABI_RESERVE(1) + KABI_RESERVE(2) }; struct page_pool; @@ -74,6 +77,9 @@ struct xdp_rxq_info { struct xdp_txq_info { struct net_device *dev; + + KABI_RESERVE(1) + KABI_RESERVE(2) }; enum xdp_buff_flags { @@ -92,6 +98,11 @@ struct xdp_buff { struct xdp_txq_info *txq; u32 frame_sz; /* frame size to deduce data_hard_end/reserved tailroom*/ u32 flags; /* supported values defined in xdp_buff_flags */ + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; static __always_inline bool xdp_buff_has_frags(struct xdp_buff *xdp) @@ -181,6 +192,11 @@ struct xdp_frame { struct net_device *dev_rx; /* used by cpumap */ u32 frame_sz; u32 flags; /* supported values defined in xdp_buff_flags */ + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; static __always_inline bool xdp_frame_has_frags(struct xdp_frame *frame) @@ -198,6 +214,9 @@ struct xdp_frame_bulk { int count; void *xa; void *q[XDP_BULK_QUEUE_SIZE]; + + KABI_RESERVE(1) + KABI_RESERVE(2) }; static __always_inline void xdp_frame_bulk_init(struct xdp_frame_bulk *bq) -- 2.9.5
1 0
0 0
[PATCH OLK-6.6] statx: kabi: KABI reservation for kstat
by Baokun Li 18 Dec '24

18 Dec '24
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IBC24E ---------------------------------------------------------------------- structure size reserves reserved mainline kstat 160 4 192 184 Signed-off-by: Baokun Li <libaokun1(a)huawei.com> --- include/linux/stat.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/stat.h b/include/linux/stat.h index 52150570d37a..d342e89b7aaa 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h @@ -53,6 +53,11 @@ struct kstat { u32 dio_mem_align; u32 dio_offset_align; u64 change_cookie; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; /* These definitions are internal to the kernel for now. Mainly used by nfsd. */ -- 2.46.1
2 1
0 0
[PATCH OLK-6.6] seq_file: kabi: KABI reservation for seq_file
by Baokun Li 18 Dec '24

18 Dec '24
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IBC34X ---------------------------------------------------------------------- structure size reserves reserved seq_file 120 1 128 seq_operations 32 1 40 Signed-off-by: Baokun Li <libaokun1(a)huawei.com> --- include/linux/seq_file.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 234bcdb1fba4..cf4a2258df85 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h @@ -27,6 +27,8 @@ struct seq_file { int poll_event; const struct file *file; void *private; + + KABI_RESERVE(1) }; struct seq_operations { @@ -34,6 +36,8 @@ struct seq_operations { void (*stop) (struct seq_file *m, void *v); void * (*next) (struct seq_file *m, void *v, loff_t *pos); int (*show) (struct seq_file *m, void *v); + + KABI_RESERVE(1) }; #define SEQ_SKIP 1 -- 2.46.1
2 1
0 0
[PATCH OLK-6.6,v2] net/kabi: Reserve space for net structures
by Dong Chenchen 18 Dec '24

18 Dec '24
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IBC1RH -------------------------------- Reserve some fields beforehand for net subsystem related structures prone to change. Signed-off-by: Dong Chenchen <dongchenchen2(a)huawei.com> --- include/net/flow.h | 2 ++ include/net/netns/netfilter.h | 2 ++ include/net/netns/xfrm.h | 2 ++ include/net/xfrm.h | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/include/net/flow.h b/include/net/flow.h index 0cc5f2ef1000..72d2ea2374ba 100644 --- a/include/net/flow.h +++ b/include/net/flow.h @@ -46,6 +46,8 @@ struct flowi_common { KABI_RESERVE(1) KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; union flowi_uli { diff --git a/include/net/netns/netfilter.h b/include/net/netns/netfilter.h index 4b77a9b031b6..963588269637 100644 --- a/include/net/netns/netfilter.h +++ b/include/net/netns/netfilter.h @@ -34,5 +34,7 @@ struct netns_nf { KABI_RESERVE(1) KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; #endif diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h index a0c1359cc7eb..af7f20ef4823 100644 --- a/include/net/netns/xfrm.h +++ b/include/net/netns/xfrm.h @@ -87,6 +87,8 @@ struct netns_xfrm { KABI_RESERVE(1) KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; #endif diff --git a/include/net/xfrm.h b/include/net/xfrm.h index c875faf98492..b9dec5f9c973 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -294,6 +294,8 @@ struct xfrm_state { KABI_RESERVE(1) KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; static inline struct net *xs_net(struct xfrm_state *x) @@ -562,6 +564,8 @@ struct xfrm_policy { KABI_RESERVE(1) KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; static inline struct net *xp_net(const struct xfrm_policy *xp) -- 2.25.1
1 0
0 0
[PATCH OLK-5.10] soc: hisilicon: hbmdev: Only support built-in
by Zhang Zekun 18 Dec '24

18 Dec '24
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IB78B0 ----------------------------------------------------------- Only support built in compile for hisi_hbmdev. We need to use lock_device_hotplug_sysfs() to prevent directly racing on acpi_scan_lock(), hbm memory can be time consumed during power on. Signed-off-by: Zhang Zekun <zhangzekun11(a)huawei.com> --- arch/arm64/configs/openeuler_defconfig | 2 +- drivers/soc/hisilicon/Kconfig | 2 +- drivers/soc/hisilicon/hisi_hbmdev.c | 19 ++++++++++++++++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/arch/arm64/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig index 4c117f2f55f1..dba4e3b2e79a 100644 --- a/arch/arm64/configs/openeuler_defconfig +++ b/arch/arm64/configs/openeuler_defconfig @@ -6117,7 +6117,7 @@ CONFIG_QCOM_KRYO_L2_ACCESSORS=y # Hisilicon SoC drivers # CONFIG_KUNPENG_HCCS=m -CONFIG_HISI_HBMDEV=m +CONFIG_HISI_HBMDEV=y CONFIG_HISI_HBMCACHE=m CONFIG_HISI_HBMDEV_ACLS=y CONFIG_HISI_L3T=m diff --git a/drivers/soc/hisilicon/Kconfig b/drivers/soc/hisilicon/Kconfig index 0e79de44a01f..2dc1a2060d30 100644 --- a/drivers/soc/hisilicon/Kconfig +++ b/drivers/soc/hisilicon/Kconfig @@ -19,7 +19,7 @@ config KUNPENG_HCCS health status and port information of HCCS on Kunpeng SoC. config HISI_HBMDEV - tristate "add extra support for hbm memory device" + bool "add extra support for hbm memory device" depends on ACPI_HOTPLUG_MEMORY select ACPI_CONTAINER help diff --git a/drivers/soc/hisilicon/hisi_hbmdev.c b/drivers/soc/hisilicon/hisi_hbmdev.c index f09388a80009..4bf3a17fc2a8 100644 --- a/drivers/soc/hisilicon/hisi_hbmdev.c +++ b/drivers/soc/hisilicon/hisi_hbmdev.c @@ -59,9 +59,8 @@ static int memdev_power_on(struct acpi_device *adev) acpi_handle handle = adev->handle; acpi_status status; - acpi_scan_lock_acquire(); + /* Power on and online the devices */ status = acpi_evaluate_object(handle, "_ON", NULL, NULL); - acpi_scan_lock_release(); if (ACPI_FAILURE(status)) { acpi_handle_warn(handle, "Power on failed (0x%x)\n", status); return -ENODEV; @@ -100,6 +99,7 @@ static int memdev_power_off(struct acpi_device *adev) acpi_dev_for_each_child(adev, hbmdev_check, NULL); acpi_scan_lock_release(); + /* Eject the devices and power off */ status = acpi_evaluate_object(handle, "_OFF", NULL, NULL); if (ACPI_FAILURE(status)) { return -ENODEV; @@ -112,7 +112,12 @@ static ssize_t state_store(struct device *dev, struct device_attribute *attr, { struct acpi_device *adev = ACPI_COMPANION(dev); const int type = online_type_from_str(buf); - int ret = -EINVAL; + int ret; + + /* Disallow pending on the mutex to avoid potential hung task*/ + ret = lock_device_hotplug_sysfs(); + if (ret) + return ret; switch (type) { case STATE_ONLINE: @@ -124,6 +129,7 @@ static ssize_t state_store(struct device *dev, struct device_attribute *attr, default: break; } + unlock_device_hotplug(); if (ret) return ret; @@ -196,9 +202,16 @@ static int container_init(void) return 0; } +static struct acpi_platform_list kunpeng_hbm_plat_info[] = { + {"HISI ", "HIP11 ", 0, ACPI_SIG_IORT, all_versions, NULL, 0}, + { } +}; static int __init hbmdev_init(void) { + if (acpi_match_platform_list(kunpeng_hbm_plat_info) < 0) + return 0; + return container_init(); } module_init(hbmdev_init); -- 2.22.0
2 1
0 0
[PATCH OLK-6.6] iommu: Reserve extra KABI entry for struct iopf_group
by Zhang Zekun 18 Dec '24

18 Dec '24
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IBBRHP --------------------------------------------------------------- The list_head entry in iopf_group has been moved to iopf_group_extend for KABI compatibility and the lack of KABI reserve entry. Reserve extra kabi entry for future usage. Signed-off-by: Zhang Zekun <zhangzekun11(a)huawei.com> --- include/linux/iommu.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index bb463cb96a44..83ec4bf9809e 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -155,6 +155,10 @@ struct iopf_group { KABI_USE(2, u32 cookie) KABI_RESERVE(3) KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) + KABI_RESERVE(8) }; struct iopf_group_extend { -- 2.22.0
2 1
0 0
[PATCH OLK-6.6] mm: revert "mm: shmem: fix data-race in shmem_getattr()"
by Heyuan Wang 18 Dec '24

18 Dec '24
From: Andrew Morton <akpm(a)linux-foundation.org> mainline inclusion from mainline-v6.12 commit d1aa0c04294e29883d65eac6c2f72fe95cc7c049 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IB957P CVE: CVE-2024-53136 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?… -------------------------------- Revert d949d1d14fa2 ("mm: shmem: fix data-race in shmem_getattr()") as suggested by Chuck [1]. It is causing deadlocks when accessing tmpfs over NFS. As Hugh commented, "added just to silence a syzbot sanitizer splat: added where there has never been any practical problem". Link: https://lkml.kernel.org/r/ZzdxKF39VEmXSSyN@tissot.1015granger.net [1] Fixes: d949d1d14fa2 ("mm: shmem: fix data-race in shmem_getattr()") Acked-by: Hugh Dickins <hughd(a)google.com> Cc: Chuck Lever <chuck.lever(a)oracle.com> Cc: Jeongjun Park <aha310510(a)gmail.com> Cc: Yu Zhao <yuzhao(a)google.com> Cc: <stable(a)vger.kernel.org> Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org> Signed-off-by: Heyuan Wang <wangheyuan2(a)h-partners.com> --- mm/shmem.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 6901c95370e4..4ba22dea0092 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1167,9 +1167,7 @@ static int shmem_getattr(struct mnt_idmap *idmap, stat->attributes_mask |= (STATX_ATTR_APPEND | STATX_ATTR_IMMUTABLE | STATX_ATTR_NODUMP); - inode_lock_shared(inode); generic_fillattr(idmap, request_mask, inode, stat); - inode_unlock_shared(inode); if (shmem_huge_global_enabled(inode, 0, 0, false, NULL, 0)) stat->blksize = HPAGE_PMD_SIZE; -- 2.25.1
2 1
0 0
[openeuler:OLK-6.6 1613/1613] drivers/char/lsse_sdf_cdev.c:198:62: sparse: sparse: incorrect type in argument 2 (different address spaces)
by kernel test robot 18 Dec '24

18 Dec '24
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 46064348cc445799cf9e8fd030323a0426fbb5e4 commit: bcb311924fa97b123317ec1d4d4ccce77199c9d2 [1613/1613] LoongArch: add loongson SE SDF support config: loongarch-randconfig-r111-20241210 (https://download.01.org/0day-ci/archive/20241218/202412181438.CJxz4kpl-lkp@…) compiler: loongarch64-linux-gcc (GCC) 14.2.0 reproduce: (https://download.01.org/0day-ci/archive/20241218/202412181438.CJxz4kpl-lkp@…) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202412181438.CJxz4kpl-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> drivers/char/lsse_sdf_cdev.c:198:62: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const [noderef] __user *from @@ got char const *buf @@ drivers/char/lsse_sdf_cdev.c:198:62: sparse: expected void const [noderef] __user *from drivers/char/lsse_sdf_cdev.c:198:62: sparse: got char const *buf >> drivers/char/lsse_sdf_cdev.c:239:32: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected char const *buf @@ got char const [noderef] __user *buf @@ drivers/char/lsse_sdf_cdev.c:239:32: sparse: expected char const *buf drivers/char/lsse_sdf_cdev.c:239:32: sparse: got char const [noderef] __user *buf >> drivers/char/lsse_sdf_cdev.c:248:50: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected char *buf @@ got char [noderef] __user *buf @@ drivers/char/lsse_sdf_cdev.c:248:50: sparse: expected char *buf drivers/char/lsse_sdf_cdev.c:248:50: sparse: got char [noderef] __user *buf >> drivers/char/lsse_sdf_cdev.c:345:30: sparse: sparse: incorrect type in argument 1 (different modifiers) @@ expected struct miscdevice *misc @@ got struct miscdevice const * @@ drivers/char/lsse_sdf_cdev.c:345:30: sparse: expected struct miscdevice *misc drivers/char/lsse_sdf_cdev.c:345:30: sparse: got struct miscdevice const * drivers/char/lsse_sdf_cdev.c:361:26: sparse: sparse: incorrect type in argument 1 (different modifiers) @@ expected struct miscdevice *misc @@ got struct miscdevice const * @@ drivers/char/lsse_sdf_cdev.c:361:26: sparse: expected struct miscdevice *misc drivers/char/lsse_sdf_cdev.c:361:26: sparse: got struct miscdevice const * drivers/char/lsse_sdf_cdev.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/slab.h): include/linux/page-flags.h:244:46: sparse: sparse: self-comparison always evaluates to false -- >> drivers/char/loongson_se.c:558:30: sparse: sparse: incorrect type in argument 1 (different modifiers) @@ expected struct miscdevice *misc @@ got struct miscdevice const * @@ drivers/char/loongson_se.c:558:30: sparse: expected struct miscdevice *misc drivers/char/loongson_se.c:558:30: sparse: got struct miscdevice const * drivers/char/loongson_se.c:581:26: sparse: sparse: incorrect type in argument 1 (different modifiers) @@ expected struct miscdevice *misc @@ got struct miscdevice const * @@ drivers/char/loongson_se.c:581:26: sparse: expected struct miscdevice *misc drivers/char/loongson_se.c:581:26: sparse: got struct miscdevice const * drivers/char/loongson_se.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/umh.h, include/linux/kmod.h, ...): include/linux/page-flags.h:244:46: sparse: sparse: self-comparison always evaluates to false vim +198 drivers/char/lsse_sdf_cdev.c 170 171 static int lsse_sdf_send(struct sdf_file_pvt_data *pvt, const char *buf, 172 size_t count, int user) 173 { 174 int ret, se_ret; 175 struct sdf_handle *ph = NULL; 176 struct sdf_kernel_command *skc; 177 struct lsse_sdf_dev *se = pvt->se; 178 179 if (!se->se_ch->smsg) { 180 pr_err("se device is not ready\n"); 181 return 0; 182 } 183 184 if (count > se->se_ch->data_size) { 185 pr_err("Invalid size in send: count=%zd, size=%d\n", 186 count, se->se_ch->data_size); 187 return -EIO; 188 } 189 190 if (user) { 191 ret = mutex_lock_interruptible(&se->data_lock); 192 if (ret) 193 goto out; 194 } else 195 mutex_lock(&se->data_lock); 196 197 if (user) { > 198 ret = copy_from_user(se->se_ch->data_buffer, buf, count); 199 if (ret) { 200 ret = -EFAULT; 201 goto out_unlock; 202 } 203 skc = (struct sdf_kernel_command *)se->se_ch->data_buffer; 204 if (skc->header.command == SDF_CLOSESESSION) 205 ph = find_sdf_handle(skc->handle, pvt); 206 } else 207 memcpy(se->se_ch->data_buffer, buf, count); 208 209 se->processing_cmd = true; 210 ret = se_send_sdf_cmd(se, count, 5); 211 if (ret) { 212 pr_err("se_send_sdf_cmd failed\n"); 213 goto out_unlock; 214 } 215 216 ret = lsse_sdf_recv(pvt, (char *)buf, 0, user, &se_ret); 217 if (ret) { 218 pr_err("recv failed ret: %x\n", ret); 219 goto out_unlock; 220 } 221 if (ph && !se_ret) { 222 list_del(&ph->handle_list); 223 kfree(ph); 224 } 225 out_unlock: 226 mutex_unlock(&se->data_lock); 227 out: 228 return ret; 229 } 230 231 static ssize_t lsse_sdf_write(struct file *filp, const char __user *buf, 232 size_t cnt, loff_t *offt) 233 { 234 struct sdf_file_pvt_data *pvt = filp->private_data; 235 236 if (cnt > SE_SDF_BUFSIZE) 237 return -E2BIG; 238 > 239 if (lsse_sdf_send(pvt, buf, cnt, 1)) 240 return -EFAULT; 241 242 return cnt; 243 } 244 245 static ssize_t lsse_sdf_read(struct file *filp, char __user *buf, 246 size_t size, loff_t *off) 247 { > 248 return lsse_sdf_recv(filp->private_data, buf, size, 1, NULL); 249 } 250 251 static int close_one_handle(struct sdf_file_pvt_data *pvt, struct sdf_handle *ph) 252 { 253 struct sdf_kernel_command *skc = &pvt->skc; 254 255 skc->header.command = 0x205; 256 skc->header.u.param_cnt = 1; 257 skc->header.param_len[0] = 8; 258 skc->handle = ph->handle; 259 /* close one session */ 260 lsse_sdf_send(pvt, (char *)&pvt->skc, KERNEL_COMMAND_SIZE, 0); 261 if (skc->header.u.ret) { 262 pr_err("Auto Close Session failed, session handle: %llx, ret: %d\n", 263 (u64)ph->handle, skc->header.u.ret); 264 return skc->header.u.ret; 265 } 266 kfree(ph); 267 268 return 0; 269 } 270 271 static int close_all_handle(struct sdf_file_pvt_data *pvt) 272 { 273 int ret = 0; 274 struct sdf_handle *ph, *tmp; 275 276 list_for_each_entry_safe(ph, tmp, &pvt->handle_list, handle_list) { 277 list_del(&ph->handle_list); 278 ret = close_one_handle(pvt, ph); 279 if (ret) 280 return ret; 281 } 282 283 return 0; 284 } 285 286 static int lsse_sdf_release(struct inode *inode, struct file *filp) 287 { 288 int ret; 289 struct sdf_file_pvt_data *pvt = filp->private_data; 290 291 ret = close_all_handle(pvt); 292 filp->private_data = NULL; 293 kfree(pvt); 294 295 if (ret) 296 ret = -EFAULT; 297 return ret; 298 } 299 300 static int lsse_sdf_open(struct inode *inode, struct file *filp) 301 { 302 struct sdf_file_pvt_data *pvt = kmalloc(sizeof(*pvt), GFP_KERNEL); 303 304 if (!pvt) 305 return -ENOMEM; 306 307 INIT_LIST_HEAD(&pvt->handle_list); 308 pvt->se = se_sdf_dev; 309 filp->private_data = pvt; 310 311 return 0; 312 } 313 314 static const struct file_operations lsse_sdf_fops = { 315 .owner = THIS_MODULE, 316 .open = lsse_sdf_open, 317 .write = lsse_sdf_write, 318 .read = lsse_sdf_read, 319 .release = lsse_sdf_release, 320 }; 321 322 static const struct miscdevice lsse_sdf_miscdev = { 323 .minor = MISC_DYNAMIC_MINOR, 324 .name = "lsse_sdf", 325 .fops = &lsse_sdf_fops, 326 }; 327 328 static int lsse_sdf_probe(struct platform_device *pdev) 329 { 330 int msg_size; 331 int ret; 332 333 se_sdf_dev = kzalloc(sizeof(*se_sdf_dev), GFP_KERNEL); 334 if (IS_ERR_OR_NULL(se_sdf_dev)) 335 return PTR_ERR(se_sdf_dev); 336 337 mutex_init(&se_sdf_dev->data_lock); 338 init_waitqueue_head(&se_sdf_dev->wq); 339 se_sdf_dev->processing_cmd = false; 340 341 msg_size = 2 * sizeof(struct se_sdf_msg); 342 se_sdf_dev->se_ch = se_init_ch(SE_CH_SDF, SE_SDF_BUFSIZE, msg_size, 343 se_sdf_dev, lsse_sdf_complete); 344 > 345 ret = misc_register(&lsse_sdf_miscdev); 346 if (ret < 0) { 347 pr_err("register sdf dev failed!\n"); 348 goto out; 349 } 350 351 return 0; 352 353 out: 354 kfree(se_sdf_dev); 355 356 return ret; 357 } 358 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 356
  • 357
  • 358
  • 359
  • 360
  • 361
  • 362
  • ...
  • 1912
  • Older →

HyperKitty Powered by HyperKitty