s390: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
Subsystems (7)
v3 cover s390: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
The kernel Makefiles define the __ASSEMBLY__ macro to provide a way to use headers in both, assembler and C source code. However, all the supported versions of the GCC and Clang compilers also define the macro __ASSEMBLER__ automatically already when compiling assembly code, so some kernel headers are using __ASSEMBLER__ instead. With regards to userspace code, this seems also to be constant source of confusion, see for example these links here:
https://lore.kernel.org/kvm/[email protected]/
https://stackoverflow.com/questions/28924355/gcc-assembler-preprocessor-not-compatible-with-standard-headers
https://forums.raspberrypi.com/viewtopic.php?p=1652944#p1653834
https://github.com/riscv-software-src/opensbi/issues/199
To avoid confusion in the future, it would make sense to standardize on the macro that gets defined by the compiler, so this patch series changes all occurances of __ASSEMBLY__ into __ASSEMBLER__.
I split the patches per architecture to ease the review, and I also split the uapi headers from the normal ones in case we decide that uapi needs to be treated differently from the normal headers here.
The x86, parisc and sh patches already got merged via their specific architecture tree:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=24a295e4ef1ca8
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8a141be3233af7
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cccaea1d66e94b
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e2b6a188625a2b
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9cc646950eefda
So I assume the s390 patches should go via the s390 tree.
v3:
- Split the s390 patches from the global series
(see https://lore.kernel.org/all/[email protected]/)
- Rebased the patches on linux-next and fixed the conflicts
and new occurances of __ASSEMBLY__
Thomas Huth (2):
s390: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
s390: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
arch/s390/boot/boot.h | 4 ++-- arch/s390/include/asm/alternative.h | 6 +++--- arch/s390/include/asm/asm-const.h | 2 +- arch/s390/include/asm/cpu.h | 4 ++-- arch/s390/include/asm/cpu_mf-insn.h | 4 ++-- arch/s390/include/asm/ctlreg.h | 4 ++-- arch/s390/include/asm/dwarf.h | 4 ++-- arch/s390/include/asm/extmem.h | 2 +- arch/s390/include/asm/fpu-insn-asm.h | 4 ++-- arch/s390/include/asm/fpu-insn.h | 4 ++-- arch/s390/include/asm/ftrace.h | 4 ++-- arch/s390/include/asm/irq.h | 4 ++-- arch/s390/include/asm/jump_label.h | 4 ++-- arch/s390/include/asm/lowcore.h | 6 +++--- arch/s390/include/asm/machine.h | 4 ++-- arch/s390/include/asm/mem_encrypt.h | 4 ++-- arch/s390/include/asm/nmi.h | 4 ++-- arch/s390/include/asm/nospec-branch.h | 4 ++-- arch/s390/include/asm/nospec-insn.h | 4 ++-- arch/s390/include/asm/page.h | 4 ++-- arch/s390/include/asm/processor.h | 4 ++-- arch/s390/include/asm/ptrace.h | 4 ++-- arch/s390/include/asm/purgatory.h | 4 ++-- arch/s390/include/asm/sclp.h | 4 ++-- arch/s390/include/asm/setup.h | 4 ++-- arch/s390/include/asm/sigp.h | 4 ++-- arch/s390/include/asm/thread_info.h | 2 +- arch/s390/include/asm/tpi.h | 4 ++-- arch/s390/include/asm/types.h | 4 ++-- arch/s390/include/asm/vdso.h | 4 ++-- arch/s390/include/asm/vdso/getrandom.h | 4 ++-- arch/s390/include/asm/vdso/vsyscall.h | 4 ++-- arch/s390/include/uapi/asm/ptrace.h | 5 +++-- arch/s390/include/uapi/asm/schid.h | 4 ++-- arch/s390/include/uapi/asm/types.h | 4 ++-- arch/s390/net/bpf_jit.h | 4 ++-- 36 files changed, 72 insertions(+), 71 deletions(-)
Signature · 1 line
2.49.0
PATCH v3 1/2 s390: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers
From: Thomas Huth <[email protected]>
__ASSEMBLY__ is only defined by the Makefile of the kernel, so this is not really useful for uapi headers (unless the userspace Makefile defines it, too). Let's switch to __ASSEMBLER__ which gets set automatically by the compiler when compiling assembler code.
--- arch/s390/include/uapi/asm/ptrace.h | 5 +++-- arch/s390/include/uapi/asm/schid.h | 4 ++-- arch/s390/include/uapi/asm/types.h | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-)
arch/s390/include/uapi/asm/ptrace.h +3 -2
@@ -242,7 +242,8 @@#define PTRACE_OLDSETOPTIONS 21#define PTRACE_SYSEMU 31#define PTRACE_SYSEMU_SINGLESTEP 32 -#ifndef __ASSEMBLY__ + +#ifndef __ASSEMBLER__#include <linux/stddef.h> #include <linux/types.h>
@@ -450,6 +451,6 @@ struct user_regs_struct {unsigned long ieee_instruction_pointer;/* obsolete, always 0 */ }; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _UAPI_S390_PTRACE_H */
arch/s390/include/uapi/asm/schid.h +2 -2
@@ -4,7 +4,7 @@#include <linux/types.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ struct subchannel_id { __u32 cssid : 8;
@@ -15,6 +15,6 @@ struct subchannel_id { __u32 sch_no : 16; } __attribute__ ((packed, aligned(4))); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _UAPIASM_SCHID_H */
arch/s390/include/uapi/asm/types.h +2 -2
@@ -10,7 +10,7 @@#include <asm-generic/int-ll64.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__typedef unsigned long addr_t ;typedef __signed__ long saddr_t ;
@@ -25,6 +25,6 @@ typedef struct { }; } __attribute__((packed, aligned(4))) __vector128; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _UAPI_S390_TYPES_H */
Signature · 1 line
2.49.0
PATCH v3 2/2 s390: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
In reply to Thomas HuthFrom: Thomas Huth <[email protected]>
While the GCC and Clang compilers already define __ASSEMBLER__ automatically when compiling assembler code, __ASSEMBLY__ is a macro that only gets defined by the Makefiles in the kernel. This is bad since macros starting with two underscores are names that are reserved by the C language. It can also be very confusing for the developers when switching between userspace and kernelspace coding, or when dealing with uapi headers that rather should use __ASSEMBLER__ instead. So let's now standardize on the __ASSEMBLER__ macro that is provided by the compilers.
This is a completely mechanical patch (done with a simple "sed -i" statement), with some manual fixups done later while rebasing the patch.
--- arch/s390/boot/boot.h | 4 ++-- arch/s390/include/asm/alternative.h | 6 +++--- arch/s390/include/asm/asm-const.h | 2 +- arch/s390/include/asm/cpu.h | 4 ++-- arch/s390/include/asm/cpu_mf-insn.h | 4 ++-- arch/s390/include/asm/ctlreg.h | 4 ++-- arch/s390/include/asm/dwarf.h | 4 ++-- arch/s390/include/asm/extmem.h | 2 +- arch/s390/include/asm/fpu-insn-asm.h | 4 ++-- arch/s390/include/asm/fpu-insn.h | 4 ++-- arch/s390/include/asm/ftrace.h | 4 ++-- arch/s390/include/asm/irq.h | 4 ++-- arch/s390/include/asm/jump_label.h | 4 ++-- arch/s390/include/asm/lowcore.h | 6 +++--- arch/s390/include/asm/machine.h | 4 ++-- arch/s390/include/asm/mem_encrypt.h | 4 ++-- arch/s390/include/asm/nmi.h | 4 ++-- arch/s390/include/asm/nospec-branch.h | 4 ++-- arch/s390/include/asm/nospec-insn.h | 4 ++-- arch/s390/include/asm/page.h | 4 ++-- arch/s390/include/asm/processor.h | 4 ++-- arch/s390/include/asm/ptrace.h | 4 ++-- arch/s390/include/asm/purgatory.h | 4 ++-- arch/s390/include/asm/sclp.h | 4 ++-- arch/s390/include/asm/setup.h | 4 ++-- arch/s390/include/asm/sigp.h | 4 ++-- arch/s390/include/asm/thread_info.h | 2 +- arch/s390/include/asm/tpi.h | 4 ++-- arch/s390/include/asm/types.h | 4 ++-- arch/s390/include/asm/vdso.h | 4 ++-- arch/s390/include/asm/vdso/getrandom.h | 4 ++-- arch/s390/include/asm/vdso/vsyscall.h | 4 ++-- arch/s390/net/bpf_jit.h | 4 ++-- 33 files changed, 65 insertions(+), 65 deletions(-)
arch/s390/boot/boot.h +2 -2
@@ -6,7 +6,7 @@#define IPL_START 0x200 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/printk.h> #include <asm/physmem_info.h>
@@ -121,5 +121,5 @@ static inline bool intersects(unsigned long addr0, unsigned long size0, {return addr0 + size0 > addr1 && addr1 + size1 > addr0; } -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* BOOT_BOOT_H */
arch/s390/include/asm/alternative.h +3 -3
@@ -51,7 +51,7 @@ ALT_TYPE_SPEC << ALT_TYPE_SHIFT | \ (facility) << ALT_DATA_SHIFT) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/types.h> #include <linux/stddef.h>
@@ -183,7 +183,7 @@ static inline void apply_alternatives(struct alt_instr *start, struct alt_instr/* Use this macro if clobbers are needed without inputs. */ #define ASM_NO_INPUT_CLOBBER(clobber...) : clobber -#else /* __ASSEMBLY__ */ +#else /* __ASSEMBLER__ */ /* * Issue one struct alt_instr descriptor entry (need to put it into
@@ -233,6 +233,6 @@ static inline void apply_alternatives(struct alt_instr *start, struct alt_instr .popsection .endm -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_S390_ALTERNATIVE_H */
arch/s390/include/asm/asm-const.h +1 -1
@@ -2,7 +2,7 @@#ifndef _ASM_S390_ASM_CONST_H#define _ASM_S390_ASM_CONST_H -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__# define stringify_in_c (...) __VA_ARGS__#else /* This version of stringify will deal with commas... */
arch/s390/include/asm/cpu.h +2 -2
@@ -9,7 +9,7 @@#ifndef _ASM_S390_CPU_H#define _ASM_S390_CPU_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/types.h> #include <linux/jump_label.h>
@@ -24,5 +24,5 @@ struct cpuidDECLARE_STATIC_KEY_FALSE (cpu_has_bear); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_S390_CPU_H */
arch/s390/include/asm/cpu_mf-insn.h +2 -2
@@ -8,7 +8,7 @@#ifndef _ASM_S390_CPU_MF_INSN_H#define _ASM_S390_CPU_MF_INSN_H -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__/* Macro to generate the STCCTM instruction with a customized * M3 field designating the counter set.
@@ -17,6 +17,6 @@ .insn rsy,0xeb0000000017,\r1,\m3 & 0xf,\db2 .endm -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif
arch/s390/include/asm/ctlreg.h +2 -2
@@ -80,7 +80,7 @@#define CR14_EXTERNAL_DAMAGE_SUBMASK BIT(CR14_EXTERNAL_DAMAGE_SUBMASK_BIT)#define CR14_WARNING_SUBMASK BIT(CR14_WARNING_SUBMASK_BIT) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/bug.h>
@@ -252,5 +252,5 @@ union ctlreg15 { }; }; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* __ASM_S390_CTLREG_H */
arch/s390/include/asm/dwarf.h +2 -2
@@ -2,7 +2,7 @@#ifndef _ASM_S390_DWARF_H#define _ASM_S390_DWARF_H -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__#define CFI_STARTPROC .cfi_startproc#define CFI_ENDPROC .cfi_endproc
@@ -33,6 +33,6 @@ .cfi_sections .eh_frame, .debug_frame#endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_S390_DWARF_H */
arch/s390/include/asm/extmem.h +1 -1
@@ -6,7 +6,7 @@#ifndef _ASM_S390X_DCSS_H#define _ASM_S390X_DCSS_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * DCSS segment is defined as a contiguous range of pages using DEFSEG command.
arch/s390/include/asm/fpu-insn-asm.h +2 -2
@@ -16,7 +16,7 @@#error only <asm/fpu-insn.h> can be included directly#endif -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__/* Macros to generate vector instruction byte code */
@@ -750,5 +750,5 @@ MRXBOPC 0, 0x77, v1, v2, v3 .endm -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* __ASM_S390_FPU_INSN_ASM_H */
arch/s390/include/asm/fpu-insn.h +2 -2
@@ -9,7 +9,7 @@#include <asm/fpu-insn-asm.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/instrumented.h> #include <asm/asm-extable.h>
@@ -475,5 +475,5 @@ static __always_inline void fpu_vzero(u8 v) : "memory"); } -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* __ASM_S390_FPU_INSN_H */
arch/s390/include/asm/ftrace.h +2 -2
@@ -5,7 +5,7 @@#define ARCH_SUPPORTS_FTRACE_OPS 1#define MCOUNT_INSN_SIZE 6 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <asm/stacktrace.h> static __always_inline unsigned long return_address (unsigned int n)
@@ -134,7 +134,7 @@ void ftrace_graph_func(unsigned long ip, unsigned long parent_ip, struct ftrace_ops *op, struct ftrace_regs *fregs);#define ftrace_graph_func ftrace_graph_func -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #ifdef CONFIG_FUNCTION_TRACER
arch/s390/include/asm/irq.h +2 -2
@@ -25,7 +25,7 @@#define EXT_IRQ_CP_SERVICE 0x2603#define EXT_IRQ_IUCV 0x4000 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/hardirq.h> #include <linux/percpu.h>
@@ -120,6 +120,6 @@ void irq_subclass_unregister(enum irq_subclass subclass);#define irq_canonicalize (irq) (irq) -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_IRQ_H */
arch/s390/include/asm/jump_label.h +2 -2
@@ -4,7 +4,7 @@#define HAVE_JUMP_LABEL_BATCH -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/types.h> #include <linux/stringify.h>
@@ -51,5 +51,5 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, boolreturn true; } -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif
arch/s390/include/asm/lowcore.h +3 -3
@@ -22,7 +22,7 @@#define LOWCORE_ALT_ADDRESS _AC(0x70000, UL) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ struct pgm_tdb { u64 data[32];
@@ -237,7 +237,7 @@ static inline void set_prefix(__u32 address) asm volatile("spx %0" : : "Q" (address) : "memory"); } -#else /* __ASSEMBLY__ */ +#else /* __ASSEMBLER__ */ .macro GET_LC reg ALTERNATIVE "lghi \reg,0", \
@@ -251,5 +251,5 @@ static inline void set_prefix(__u32 address)ALT_FEATURE (MFEATURE_LOWCORE ) .endm -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_S390_LOWCORE_H */
arch/s390/include/asm/machine.h +2 -2
@@ -20,7 +20,7 @@#define MFEATURE_LPAR 9#define MFEATURE_DIAG288 10 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/bitops.h> #include <asm/alternative.h>
@@ -100,5 +100,5 @@ DEFINE_MACHINE_HAS_FEATURE(lpar, MFEATURE_LPAR)#define machine_is_kvm machine_has_kvm#define machine_is_lpar machine_has_lpar -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* __ASM_S390_MACHINE_H */
arch/s390/include/asm/mem_encrypt.h +2 -2
@@ -2,11 +2,11 @@#ifndef S390_MEM_ENCRYPT_H__ #define S390_MEM_ENCRYPT_H__ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__int set_memory_encrypted (unsigned long vaddr,int numpages);int set_memory_decrypted (unsigned long vaddr,int numpages); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* S390_MEM_ENCRYPT_H__ */
arch/s390/include/asm/nmi.h +2 -2
@@ -33,7 +33,7 @@#define MCCK_CODE_FC_VALID BIT(63 - 43)#define MCCK_CODE_CPU_TIMER_VALID BIT(63 - 46) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ union mci { unsigned long val;
@@ -104,5 +104,5 @@ void nmi_free_mcesa(u64 *mcesad);void s390_handle_mcck (void );void s390_do_machine_check (struct pt_regs *regs); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_S390_NMI_H */
arch/s390/include/asm/nospec-branch.h +2 -2
@@ -2,7 +2,7 @@#ifndef _ASM_S390_EXPOLINE_H#define _ASM_S390_EXPOLINE_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/types.h> #include <asm/facility.h>
@@ -42,6 +42,6 @@ void __s390_indirect_jump_r13(void);void __s390_indirect_jump_r14 (void );void __s390_indirect_jump_r15 (void ); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_S390_EXPOLINE_H */
arch/s390/include/asm/nospec-insn.h +2 -2
@@ -5,7 +5,7 @@#include <linux/linkage.h> #include <asm/dwarf.h> -#ifdef __ASSEMBLY__ +#ifdef __ASSEMBLER__#ifdef CC_USING_EXPOLINE
@@ -128,6 +128,6 @@ .endm#endif /* CC_USING_EXPOLINE */ -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_S390_NOSPEC_ASM_H */
arch/s390/include/asm/page.h +2 -2
@@ -33,7 +33,7 @@#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA #include <asm/setup.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__void __storage_key_init_range (unsigned long start,unsigned long end);
@@ -274,7 +274,7 @@ static inline unsigned long virt_to_pfn(const void *kaddr)#define VM_DATA_DEFAULT_FLAGS VM_DATA_FLAGS_NON_EXEC -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #include <asm-generic/memory_model.h> #include <asm-generic/getorder.h>
arch/s390/include/asm/processor.h +2 -2
@@ -26,7 +26,7 @@#define RESTART_FLAG_CTLREGS _AC(1 << 0, U) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/cpumask.h> #include <linux/linkage.h>
@@ -418,6 +418,6 @@ static __always_inline void bpon(void) ); } -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* __ASM_S390_PROCESSOR_H */
arch/s390/include/asm/ptrace.h +2 -2
@@ -54,7 +54,7 @@ PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_MASK_MCHECK | \ PSW_MASK_PSTATE | PSW_ASC_PRIMARY) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ struct psw_bits { unsigned long : 1;
@@ -292,5 +292,5 @@ static inline void regs_set_return_value(struct pt_regs *regs, unsigned long rc) regs->gprs[2 ] = rc; } -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _S390_PTRACE_H */
arch/s390/include/asm/purgatory.h +2 -2
@@ -7,11 +7,11 @@#ifndef _S390_PURGATORY_H_#define _S390_PURGATORY_H_ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/purgatory.h> int verify_sha256_digest (void ); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _S390_PURGATORY_H_ */
arch/s390/include/asm/sclp.h +2 -2
@@ -21,7 +21,7 @@#define SCLP_ERRNOTIFY_AQ_INFO_LOG 2#define SCLP_ERRNOTIFY_AQ_OPTICS_DATA 3 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/uio.h> #include <asm/chpid.h> #include <asm/cpu.h>
@@ -199,5 +199,5 @@ static inline int sclp_get_core_info(struct sclp_core_info *info, int early)return _sclp_get_core_info (info); } -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_S390_SCLP_H */
arch/s390/include/asm/setup.h +2 -2
@@ -24,7 +24,7 @@#define LEGACY_COMMAND_LINE_SIZE 896 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <asm/lowcore.h> #include <asm/types.h>
@@ -100,5 +100,5 @@ static __always_inline u32 gen_lpswe(unsigned long addr)BUILD_BUG_ON (addr >0xfff );return 0xb2b20000 | addr; } -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_S390_SETUP_H */
arch/s390/include/asm/sigp.h +2 -2
@@ -36,7 +36,7 @@#define SIGP_STATUS_INCORRECT_STATE 0x00000200UL#define SIGP_STATUS_NOT_RUNNING 0x00000400UL -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <asm/asm.h>
@@ -68,6 +68,6 @@ static inline int __pcpu_sigp(u16 addr, u8 order, unsigned long parm,return cc; } -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* __S390_ASM_SIGP_H */
arch/s390/include/asm/thread_info.h +1 -1
@@ -24,7 +24,7 @@#define STACK_INIT_OFFSET (THREAD_SIZE - STACK_FRAME_OVERHEAD - __PT_SIZE) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* * low level task data that entry.S needs immediate access to
arch/s390/include/asm/tpi.h +2 -2
@@ -5,7 +5,7 @@#include <linux/types.h> #include <uapi/asm/schid.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__/* I/O-Interruption Code as stored by TEST PENDING INTERRUPTION (TPI). */ struct tpi_info {
@@ -32,6 +32,6 @@ struct tpi_adapter_info { u32 :27 ; } __packed __aligned(4); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_S390_TPI_H */
arch/s390/include/asm/types.h +2 -2
@@ -5,7 +5,7 @@#include <uapi/asm/types.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ union register_pair { unsigned __int128 pair;
@@ -15,5 +15,5 @@ union register_pair { }; }; -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* _ASM_S390_TYPES_H */
arch/s390/include/asm/vdso.h +2 -2
@@ -4,11 +4,11 @@#include <vdso/datapage.h> -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__int vdso_getcpu_init (void ); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #define __VDSO_PAGES 4
arch/s390/include/asm/vdso/getrandom.h +2 -2
@@ -3,7 +3,7 @@#ifndef __ASM_VDSO_GETRANDOM_H#define __ASM_VDSO_GETRANDOM_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <vdso/datapage.h> #include <asm/vdso/vsyscall.h>
@@ -23,6 +23,6 @@ static __always_inline ssize_t getrandom_syscall(void *buffer, size_t len, unsigreturn syscall3 (__NR_getrandom, (long )buffer, (long )len, (long )flags); } -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* __ASM_VDSO_GETRANDOM_H */
arch/s390/include/asm/vdso/vsyscall.h +2 -2
@@ -2,7 +2,7 @@#ifndef __ASM_VDSO_VSYSCALL_H#define __ASM_VDSO_VSYSCALL_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/hrtimer.h> #include <vdso/datapage.h>
@@ -11,6 +11,6 @@/* The asm-generic header needs to be included after the definitions above */ #include <asm-generic/vdso/vsyscall.h> -#endif /* !__ASSEMBLY__ */ +#endif /* !__ASSEMBLER__ */ #endif /* __ASM_VDSO_VSYSCALL_H */
arch/s390/net/bpf_jit.h +2 -2
@@ -11,12 +11,12 @@#ifndef __ARCH_S390_NET_BPF_JIT_H#define __ARCH_S390_NET_BPF_JIT_H -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__#include <linux/filter.h> #include <linux/types.h> -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ /* * Stackframe layout (packed stack):
Signature · 1 line
2.49.0
Quoted 5 lines · Thomas Huth
The kernel Makefiles define the
__ASSEMBLY__macro to provide a way to use headers in both, assembler and C source code. However, all the supported versions of the GCC and Clang compilers also define the macro__ASSEMBLER__automatically already when compiling assembly code, so some kernel headers are using__ASSEMBLER__instead.
...
Quoted 1 line
So I assume the s390 patches should go via the s390 tree.
Yes, guess Alexander will pick them up.
Quoted 71 lines · Thomas Huth
The kernel Makefiles define the
__ASSEMBLY__macro to provide a way to use headers in both, assembler and C source code. However, all the supported versions of the GCC and Clang compilers also define the macro__ASSEMBLER__automatically already when compiling assembly code, so some kernel headers are using__ASSEMBLER__instead. With regards to userspace code, this seems also to be constant source of confusion, see for example these links here:https://lore.kernel.org/kvm/[email protected]/
https://stackoverflow.com/questions/28924355/gcc-assembler-preprocessor-not-compatible-with-standard-headers
https://forums.raspberrypi.com/viewtopic.php?p=1652944#p1653834
https://github.com/riscv-software-src/opensbi/issues/199To avoid confusion in the future, it would make sense to standardize on the macro that gets defined by the compiler, so this patch series changes all occurances of
__ASSEMBLY__into__ASSEMBLER__.I split the patches per architecture to ease the review, and I also split the uapi headers from the normal ones in case we decide that uapi needs to be treated differently from the normal headers here.
The x86, parisc and sh patches already got merged via their specific architecture tree:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=24a295e4ef1ca8
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8a141be3233af7
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cccaea1d66e94b
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e2b6a188625a2b
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9cc646950eefdaSo I assume the s390 patches should go via the s390 tree.
v3:
- Split the s390 patches from the global series
(see https://lore.kernel.org/all/[email protected]/)
- Rebased the patches on linux-next and fixed the conflicts
and new occurances of__ASSEMBLY__Thomas Huth (2):
s390: Replace__ASSEMBLY__with__ASSEMBLER__in uapi headers
s390: Replace__ASSEMBLY__with__ASSEMBLER__in non-uapi headersarch/s390/boot/boot.h | 4 ++-- arch/s390/include/asm/alternative.h | 6 +++--- arch/s390/include/asm/asm-const.h | 2 +- arch/s390/include/asm/cpu.h | 4 ++-- arch/s390/include/asm/cpu_mf-insn.h | 4 ++-- arch/s390/include/asm/ctlreg.h | 4 ++-- arch/s390/include/asm/dwarf.h | 4 ++-- arch/s390/include/asm/extmem.h | 2 +- arch/s390/include/asm/fpu-insn-asm.h | 4 ++-- arch/s390/include/asm/fpu-insn.h | 4 ++-- arch/s390/include/asm/ftrace.h | 4 ++-- arch/s390/include/asm/irq.h | 4 ++-- arch/s390/include/asm/jump_label.h | 4 ++-- arch/s390/include/asm/lowcore.h | 6 +++--- arch/s390/include/asm/machine.h | 4 ++-- arch/s390/include/asm/mem_encrypt.h | 4 ++-- arch/s390/include/asm/nmi.h | 4 ++-- arch/s390/include/asm/nospec-branch.h | 4 ++-- arch/s390/include/asm/nospec-insn.h | 4 ++-- arch/s390/include/asm/page.h | 4 ++-- arch/s390/include/asm/processor.h | 4 ++-- arch/s390/include/asm/ptrace.h | 4 ++-- arch/s390/include/asm/purgatory.h | 4 ++-- arch/s390/include/asm/sclp.h | 4 ++-- arch/s390/include/asm/setup.h | 4 ++-- arch/s390/include/asm/sigp.h | 4 ++-- arch/s390/include/asm/thread_info.h | 2 +- arch/s390/include/asm/tpi.h | 4 ++-- arch/s390/include/asm/types.h | 4 ++--
Quoted 8 lines
arch/s390/include/asm/vdso.h | 4 ++-- arch/s390/include/asm/vdso/getrandom.h | 4 ++-- arch/s390/include/asm/vdso/vsyscall.h | 4 ++-- arch/s390/include/uapi/asm/ptrace.h | 5 +++-- arch/s390/include/uapi/asm/schid.h | 4 ++-- arch/s390/include/uapi/asm/types.h | 4 ++-- arch/s390/net/bpf_jit.h | 4 ++-- 36 files changed, 72 insertions(+), 71 deletions(-)
Applied, thanks!