Skip to contentSkip to conversation

linux-next: manual merge of the header_cleanup tree with the tip tree

DISCUSSION Stephen Rothwell 1 participant 1 message Dec 18, 2023 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

Today's linux-next merge of the header_cleanup tree got a conflict in:

arch/x86/include/asm/percpu.h

between commit:

0e3703630bd3 ("x86/percpu: Fix "const_pcpu_hot" version generation failure")

from the tip tree and commit:

863cc83ddcf8 ("Kill unnecessary kernel.h include")

from the header_cleanup tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Signature · 61 lines
Cheers,
Stephen Rothwell

diff --cc arch/x86/include/asm/percpu.h
index e56a37886143,5e01883eb51e..000000000000
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
@@@ -28,52 -24,13 +28,52 @@@
  
  #else /* ...!ASSEMBLY */
  
 +#include <linux/build_bug.h>
- #include <linux/kernel.h>
  #include <linux/stringify.h>
+ #include <asm/asm.h>
  
  #ifdef CONFIG_SMP
 +
 +#ifdef CONFIG_CC_HAS_NAMED_AS
 +
 +#ifdef __CHECKER__
 +#define __seg_gs		__attribute__((address_space(__seg_gs)))
 +#define __seg_fs		__attribute__((address_space(__seg_fs)))
 +#endif
 +
 +#ifdef CONFIG_X86_64
 +#define __percpu_seg_override	__seg_gs
 +#else
 +#define __percpu_seg_override	__seg_fs
 +#endif
 +
 +#define __percpu_prefix		""
 +
 +#else /* CONFIG_CC_HAS_NAMED_AS */
 +
 +#define __percpu_seg_override
  #define __percpu_prefix		"%%"__stringify(__percpu_seg)":"
 +
 +#endif /* CONFIG_CC_HAS_NAMED_AS */
 +
 +#define __force_percpu_prefix	"%%"__stringify(__percpu_seg)":"
  #define __my_cpu_offset		this_cpu_read(this_cpu_off)
  
 +#ifdef CONFIG_USE_X86_SEG_SUPPORT
 +/*
 + * Efficient implementation for cases in which the compiler supports
 + * named address spaces.  Allows the compiler to perform additional
 + * optimizations that can save more instructions.
 + */
 +#define arch_raw_cpu_ptr(ptr)					\
 +({								\
 +	unsigned long tcp_ptr__;				\
 +	tcp_ptr__ = __raw_cpu_read(, this_cpu_off);		\
 +								\
 +	tcp_ptr__ += (unsigned long)(ptr);			\
 +	(typeof(*(ptr)) __kernel __force *)tcp_ptr__;		\
 +})
 +#else /* CONFIG_USE_X86_SEG_SUPPORT */
  /*
   * Compared to the generic __my_cpu_offset version, the following
   * saves one instruction and avoids clobbering a temp register.