mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
x86/headers: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-UAPI headers
While the GCC and Clang compilers already define __ASSEMBLER__ automatically when compiling assembly code, __ASSEMBLY__ is a macro that only gets defined by the Makefiles in the kernel. This can be very confusing when switching between userspace and kernelspace coding, or when dealing with UAPI headers that rather should use __ASSEMBLER__ instead. So let's standardize on the __ASSEMBLER__ macro that is provided by the compilers now. This is mostly a mechanical patch (done with a simple "sed -i" statement), with some manual tweaks in <asm/frame.h>, <asm/hw_irq.h> and <asm/setup.h> that mentioned this macro in comments with some missing underscores. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Brian Gerst <brgerst@gmail.com> Cc: Juergen Gross <jgross@suse.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Kees Cook <keescook@chromium.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/20250314071013.1575167-38-thuth@redhat.com
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#define STACK_SIZE 1024 /* Minimum number of bytes for stack */
|
#define STACK_SIZE 1024 /* Minimum number of bytes for stack */
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
|
|
||||||
#include <linux/stdarg.h>
|
#include <linux/stdarg.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
@@ -327,6 +327,6 @@ void probe_cards(int unsafe);
|
|||||||
/* video-vesa.c */
|
/* video-vesa.c */
|
||||||
void vesa_store_edid(void);
|
void vesa_store_edid(void);
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLER__ */
|
||||||
|
|
||||||
#endif /* BOOT_BOOT_H */
|
#endif /* BOOT_BOOT_H */
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
* vDSO uses a dedicated handler the addresses are relative to the overall
|
* vDSO uses a dedicated handler the addresses are relative to the overall
|
||||||
* exception table, not each individual entry.
|
* exception table, not each individual entry.
|
||||||
*/
|
*/
|
||||||
#ifdef __ASSEMBLY__
|
#ifdef __ASSEMBLER__
|
||||||
#define _ASM_VDSO_EXTABLE_HANDLE(from, to) \
|
#define _ASM_VDSO_EXTABLE_HANDLE(from, to) \
|
||||||
ASM_VDSO_EXTABLE_HANDLE from to
|
ASM_VDSO_EXTABLE_HANDLE from to
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#define ALT_DIRECT_CALL(feature) ((ALT_FLAG_DIRECT_CALL << ALT_FLAGS_SHIFT) | (feature))
|
#define ALT_DIRECT_CALL(feature) ((ALT_FLAG_DIRECT_CALL << ALT_FLAGS_SHIFT) | (feature))
|
||||||
#define ALT_CALL_ALWAYS ALT_DIRECT_CALL(X86_FEATURE_ALWAYS)
|
#define ALT_CALL_ALWAYS ALT_DIRECT_CALL(X86_FEATURE_ALWAYS)
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
|
|
||||||
#include <linux/stddef.h>
|
#include <linux/stddef.h>
|
||||||
|
|
||||||
@@ -277,7 +277,7 @@ static inline int alternatives_text_reserved(void *start, void *end)
|
|||||||
void BUG_func(void);
|
void BUG_func(void);
|
||||||
void nop_func(void);
|
void nop_func(void);
|
||||||
|
|
||||||
#else /* __ASSEMBLY__ */
|
#else /* __ASSEMBLER__ */
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
.macro LOCK_PREFIX
|
.macro LOCK_PREFIX
|
||||||
@@ -360,6 +360,6 @@ void nop_func(void);
|
|||||||
ALTERNATIVE_2 oldinstr, newinstr_no, X86_FEATURE_ALWAYS, \
|
ALTERNATIVE_2 oldinstr, newinstr_no, X86_FEATURE_ALWAYS, \
|
||||||
newinstr_yes, ft_flags
|
newinstr_yes, ft_flags
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLER__ */
|
||||||
|
|
||||||
#endif /* _ASM_X86_ALTERNATIVE_H */
|
#endif /* _ASM_X86_ALTERNATIVE_H */
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#ifndef _ASM_X86_ASM_H
|
#ifndef _ASM_X86_ASM_H
|
||||||
#define _ASM_X86_ASM_H
|
#define _ASM_X86_ASM_H
|
||||||
|
|
||||||
#ifdef __ASSEMBLY__
|
#ifdef __ASSEMBLER__
|
||||||
# define __ASM_FORM(x, ...) x,## __VA_ARGS__
|
# define __ASM_FORM(x, ...) x,## __VA_ARGS__
|
||||||
# define __ASM_FORM_RAW(x, ...) x,## __VA_ARGS__
|
# define __ASM_FORM_RAW(x, ...) x,## __VA_ARGS__
|
||||||
# define __ASM_FORM_COMMA(x, ...) x,## __VA_ARGS__,
|
# define __ASM_FORM_COMMA(x, ...) x,## __VA_ARGS__,
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
#ifndef __pic__
|
#ifndef __pic__
|
||||||
static __always_inline __pure void *rip_rel_ptr(void *p)
|
static __always_inline __pure void *rip_rel_ptr(void *p)
|
||||||
{
|
{
|
||||||
@@ -144,7 +144,7 @@ static __always_inline __pure void *rip_rel_ptr(void *p)
|
|||||||
# include <asm/extable_fixup_types.h>
|
# include <asm/extable_fixup_types.h>
|
||||||
|
|
||||||
/* Exception table entry */
|
/* Exception table entry */
|
||||||
#ifdef __ASSEMBLY__
|
#ifdef __ASSEMBLER__
|
||||||
|
|
||||||
# define _ASM_EXTABLE_TYPE(from, to, type) \
|
# define _ASM_EXTABLE_TYPE(from, to, type) \
|
||||||
.pushsection "__ex_table","a" ; \
|
.pushsection "__ex_table","a" ; \
|
||||||
@@ -164,7 +164,7 @@ static __always_inline __pure void *rip_rel_ptr(void *p)
|
|||||||
# define _ASM_NOKPROBE(entry)
|
# define _ASM_NOKPROBE(entry)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#else /* ! __ASSEMBLY__ */
|
#else /* ! __ASSEMBLER__ */
|
||||||
|
|
||||||
# define DEFINE_EXTABLE_TYPE_REG \
|
# define DEFINE_EXTABLE_TYPE_REG \
|
||||||
".macro extable_type_reg type:req reg:req\n" \
|
".macro extable_type_reg type:req reg:req\n" \
|
||||||
@@ -232,7 +232,7 @@ static __always_inline __pure void *rip_rel_ptr(void *p)
|
|||||||
*/
|
*/
|
||||||
register unsigned long current_stack_pointer asm(_ASM_SP);
|
register unsigned long current_stack_pointer asm(_ASM_SP);
|
||||||
#define ASM_CALL_CONSTRAINT "+r" (current_stack_pointer)
|
#define ASM_CALL_CONSTRAINT "+r" (current_stack_pointer)
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLER__ */
|
||||||
|
|
||||||
#define _ASM_EXTABLE(from, to) \
|
#define _ASM_EXTABLE(from, to) \
|
||||||
_ASM_EXTABLE_TYPE(from, to, EX_TYPE_DEFAULT)
|
_ASM_EXTABLE_TYPE(from, to, EX_TYPE_DEFAULT)
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
# define BOOT_STACK_SIZE 0x1000
|
# define BOOT_STACK_SIZE 0x1000
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
extern unsigned int output_len;
|
extern unsigned int output_len;
|
||||||
extern const unsigned long kernel_text_size;
|
extern const unsigned long kernel_text_size;
|
||||||
extern const unsigned long kernel_total_size;
|
extern const unsigned long kernel_total_size;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <asm/processor.h>
|
#include <asm/processor.h>
|
||||||
|
|
||||||
#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
|
#if defined(__KERNEL__) && !defined(__ASSEMBLER__)
|
||||||
|
|
||||||
#include <asm/asm.h>
|
#include <asm/asm.h>
|
||||||
#include <linux/bitops.h>
|
#include <linux/bitops.h>
|
||||||
@@ -137,5 +137,5 @@ t_no:
|
|||||||
#define CPU_FEATURE_TYPEVAL boot_cpu_data.x86_vendor, boot_cpu_data.x86, \
|
#define CPU_FEATURE_TYPEVAL boot_cpu_data.x86_vendor, boot_cpu_data.x86, \
|
||||||
boot_cpu_data.x86_model
|
boot_cpu_data.x86_model
|
||||||
|
|
||||||
#endif /* defined(__KERNEL__) && !defined(__ASSEMBLY__) */
|
#endif /* defined(__KERNEL__) && !defined(__ASSEMBLER__) */
|
||||||
#endif /* _ASM_X86_CPUFEATURE_H */
|
#endif /* _ASM_X86_CPUFEATURE_H */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0 */
|
/* SPDX-License-Identifier: GPL-2.0 */
|
||||||
#ifndef _ASM_X86_CPUMASK_H
|
#ifndef _ASM_X86_CPUMASK_H
|
||||||
#define _ASM_X86_CPUMASK_H
|
#define _ASM_X86_CPUMASK_H
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
#include <linux/cpumask.h>
|
#include <linux/cpumask.h>
|
||||||
|
|
||||||
extern void setup_cpu_local_masks(void);
|
extern void setup_cpu_local_masks(void);
|
||||||
@@ -34,5 +34,5 @@ static __always_inline void arch_cpumask_clear_cpu(int cpu, struct cpumask *dstp
|
|||||||
|
|
||||||
#define arch_cpu_is_offline(cpu) unlikely(!arch_cpu_online(cpu))
|
#define arch_cpu_is_offline(cpu) unlikely(!arch_cpu_online(cpu))
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLER__ */
|
||||||
#endif /* _ASM_X86_CPUMASK_H */
|
#endif /* _ASM_X86_CPUMASK_H */
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <linux/build_bug.h>
|
#include <linux/build_bug.h>
|
||||||
#include <linux/compiler.h>
|
#include <linux/compiler.h>
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
|
|
||||||
#include <linux/cache.h>
|
#include <linux/cache.h>
|
||||||
#include <asm/percpu.h>
|
#include <asm/percpu.h>
|
||||||
@@ -27,6 +27,6 @@ static __always_inline struct task_struct *get_current(void)
|
|||||||
|
|
||||||
#define current get_current()
|
#define current get_current()
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLER__ */
|
||||||
|
|
||||||
#endif /* _ASM_X86_CURRENT_H */
|
#endif /* _ASM_X86_CURRENT_H */
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
#define DESC_USER (_DESC_DPL(3))
|
#define DESC_USER (_DESC_DPL(3))
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ struct desc_ptr {
|
|||||||
unsigned long address;
|
unsigned long address;
|
||||||
} __attribute__((packed)) ;
|
} __attribute__((packed)) ;
|
||||||
|
|
||||||
#endif /* !__ASSEMBLY__ */
|
#endif /* !__ASSEMBLER__ */
|
||||||
|
|
||||||
/* Boot IDT definitions */
|
/* Boot IDT definitions */
|
||||||
#define BOOT_IDT_ENTRIES 32
|
#define BOOT_IDT_ENTRIES 32
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#ifndef _ASM_X86_DWARF2_H
|
#ifndef _ASM_X86_DWARF2_H
|
||||||
#define _ASM_X86_DWARF2_H
|
#define _ASM_X86_DWARF2_H
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
#warning "asm/dwarf2.h should be only included in pure assembly files"
|
#warning "asm/dwarf2.h should be only included in pure assembly files"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
/* fixmap starts downwards from the 507th entry in level2_fixmap_pgt */
|
/* fixmap starts downwards from the 507th entry in level2_fixmap_pgt */
|
||||||
#define FIXMAP_PMD_TOP 507
|
#define FIXMAP_PMD_TOP 507
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <asm/apicdef.h>
|
#include <asm/apicdef.h>
|
||||||
#include <asm/page.h>
|
#include <asm/page.h>
|
||||||
@@ -196,5 +196,5 @@ void __init *early_memremap_decrypted_wp(resource_size_t phys_addr,
|
|||||||
void __early_set_fixmap(enum fixed_addresses idx,
|
void __early_set_fixmap(enum fixed_addresses idx,
|
||||||
phys_addr_t phys, pgprot_t flags);
|
phys_addr_t phys, pgprot_t flags);
|
||||||
|
|
||||||
#endif /* !__ASSEMBLY__ */
|
#endif /* !__ASSEMBLER__ */
|
||||||
#endif /* _ASM_X86_FIXMAP_H */
|
#endif /* _ASM_X86_FIXMAP_H */
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_FRAME_POINTER
|
#ifdef CONFIG_FRAME_POINTER
|
||||||
|
|
||||||
#ifdef __ASSEMBLY__
|
#ifdef __ASSEMBLER__
|
||||||
|
|
||||||
.macro FRAME_BEGIN
|
.macro FRAME_BEGIN
|
||||||
push %_ASM_BP
|
push %_ASM_BP
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
.endm
|
.endm
|
||||||
#endif /* CONFIG_X86_64 */
|
#endif /* CONFIG_X86_64 */
|
||||||
|
|
||||||
#else /* !__ASSEMBLY__ */
|
#else /* !__ASSEMBLER__ */
|
||||||
|
|
||||||
#define FRAME_BEGIN \
|
#define FRAME_BEGIN \
|
||||||
"push %" _ASM_BP "\n" \
|
"push %" _ASM_BP "\n" \
|
||||||
@@ -82,18 +82,18 @@ static inline unsigned long encode_frame_pointer(struct pt_regs *regs)
|
|||||||
|
|
||||||
#endif /* CONFIG_X86_64 */
|
#endif /* CONFIG_X86_64 */
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLER__ */
|
||||||
|
|
||||||
#define FRAME_OFFSET __ASM_SEL(4, 8)
|
#define FRAME_OFFSET __ASM_SEL(4, 8)
|
||||||
|
|
||||||
#else /* !CONFIG_FRAME_POINTER */
|
#else /* !CONFIG_FRAME_POINTER */
|
||||||
|
|
||||||
#ifdef __ASSEMBLY__
|
#ifdef __ASSEMBLER__
|
||||||
|
|
||||||
.macro ENCODE_FRAME_POINTER ptregs_offset=0
|
.macro ENCODE_FRAME_POINTER ptregs_offset=0
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
#else /* !__ASSEMBLY */
|
#else /* !__ASSEMBLER__ */
|
||||||
|
|
||||||
#define ENCODE_FRAME_POINTER
|
#define ENCODE_FRAME_POINTER
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#define FRED_CONFIG_INT_STKLVL(l) (_AT(unsigned long, l) << 9)
|
#define FRED_CONFIG_INT_STKLVL(l) (_AT(unsigned long, l) << 9)
|
||||||
#define FRED_CONFIG_ENTRYPOINT(p) _AT(unsigned long, (p))
|
#define FRED_CONFIG_ENTRYPOINT(p) _AT(unsigned long, (p))
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
|
|
||||||
#ifdef CONFIG_X86_FRED
|
#ifdef CONFIG_X86_FRED
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
@@ -113,6 +113,6 @@ static inline void fred_entry_from_kvm(unsigned int type, unsigned int vector) {
|
|||||||
static inline void fred_sync_rsp0(unsigned long rsp0) { }
|
static inline void fred_sync_rsp0(unsigned long rsp0) { }
|
||||||
static inline void fred_update_rsp0(void) { }
|
static inline void fred_update_rsp0(void) { }
|
||||||
#endif /* CONFIG_X86_FRED */
|
#endif /* CONFIG_X86_FRED */
|
||||||
#endif /* !__ASSEMBLY__ */
|
#endif /* !__ASSEMBLER__ */
|
||||||
|
|
||||||
#endif /* ASM_X86_FRED_H */
|
#endif /* ASM_X86_FRED_H */
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#ifndef _ASM_FSGSBASE_H
|
#ifndef _ASM_FSGSBASE_H
|
||||||
#define _ASM_FSGSBASE_H
|
#define _ASM_FSGSBASE_H
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
|
|
||||||
#ifdef CONFIG_X86_64
|
#ifdef CONFIG_X86_64
|
||||||
|
|
||||||
@@ -80,6 +80,6 @@ extern unsigned long x86_fsgsbase_read_task(struct task_struct *task,
|
|||||||
|
|
||||||
#endif /* CONFIG_X86_64 */
|
#endif /* CONFIG_X86_64 */
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLER__ */
|
||||||
|
|
||||||
#endif /* _ASM_FSGSBASE_H */
|
#endif /* _ASM_FSGSBASE_H */
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#define ARCH_SUPPORTS_FTRACE_OPS 1
|
#define ARCH_SUPPORTS_FTRACE_OPS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
extern void __fentry__(void);
|
extern void __fentry__(void);
|
||||||
|
|
||||||
static inline unsigned long ftrace_call_adjust(unsigned long addr)
|
static inline unsigned long ftrace_call_adjust(unsigned long addr)
|
||||||
@@ -106,11 +106,11 @@ struct dyn_arch_ftrace {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif /* CONFIG_DYNAMIC_FTRACE */
|
#endif /* CONFIG_DYNAMIC_FTRACE */
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLER__ */
|
||||||
#endif /* CONFIG_FUNCTION_TRACER */
|
#endif /* CONFIG_FUNCTION_TRACER */
|
||||||
|
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
|
|
||||||
void prepare_ftrace_return(unsigned long ip, unsigned long *parent,
|
void prepare_ftrace_return(unsigned long ip, unsigned long *parent,
|
||||||
unsigned long frame_pointer);
|
unsigned long frame_pointer);
|
||||||
@@ -154,6 +154,6 @@ static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs)
|
|||||||
}
|
}
|
||||||
#endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_IA32_EMULATION */
|
#endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_IA32_EMULATION */
|
||||||
#endif /* !COMPILE_OFFSETS */
|
#endif /* !COMPILE_OFFSETS */
|
||||||
#endif /* !__ASSEMBLY__ */
|
#endif /* !__ASSEMBLER__ */
|
||||||
|
|
||||||
#endif /* _ASM_X86_FTRACE_H */
|
#endif /* _ASM_X86_FTRACE_H */
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include <asm/irq_vectors.h>
|
#include <asm/irq_vectors.h>
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
|
|
||||||
#include <linux/percpu.h>
|
#include <linux/percpu.h>
|
||||||
#include <linux/profile.h>
|
#include <linux/profile.h>
|
||||||
@@ -128,6 +128,6 @@ extern char spurious_entries_start[];
|
|||||||
typedef struct irq_desc* vector_irq_t[NR_VECTORS];
|
typedef struct irq_desc* vector_irq_t[NR_VECTORS];
|
||||||
DECLARE_PER_CPU(vector_irq_t, vector_irq);
|
DECLARE_PER_CPU(vector_irq_t, vector_irq);
|
||||||
|
|
||||||
#endif /* !ASSEMBLY_ */
|
#endif /* !__ASSEMBLER__ */
|
||||||
|
|
||||||
#endif /* _ASM_X86_HW_IRQ_H */
|
#endif /* _ASM_X86_HW_IRQ_H */
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#define HAS_KERNEL_IBT 1
|
#define HAS_KERNEL_IBT 1
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
|
|
||||||
#ifdef CONFIG_X86_64
|
#ifdef CONFIG_X86_64
|
||||||
#define ASM_ENDBR "endbr64\n\t"
|
#define ASM_ENDBR "endbr64\n\t"
|
||||||
@@ -82,7 +82,7 @@ extern __noendbr bool is_endbr(u32 *val);
|
|||||||
extern __noendbr u64 ibt_save(bool disable);
|
extern __noendbr u64 ibt_save(bool disable);
|
||||||
extern __noendbr void ibt_restore(u64 save);
|
extern __noendbr void ibt_restore(u64 save);
|
||||||
|
|
||||||
#else /* __ASSEMBLY__ */
|
#else /* __ASSEMBLER__ */
|
||||||
|
|
||||||
#ifdef CONFIG_X86_64
|
#ifdef CONFIG_X86_64
|
||||||
#define ENDBR endbr64
|
#define ENDBR endbr64
|
||||||
@@ -90,13 +90,13 @@ extern __noendbr void ibt_restore(u64 save);
|
|||||||
#define ENDBR endbr32
|
#define ENDBR endbr32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLER__ */
|
||||||
|
|
||||||
#else /* !IBT */
|
#else /* !IBT */
|
||||||
|
|
||||||
#define HAS_KERNEL_IBT 0
|
#define HAS_KERNEL_IBT 0
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
|
|
||||||
#define ASM_ENDBR
|
#define ASM_ENDBR
|
||||||
#define IBT_NOSEAL(name)
|
#define IBT_NOSEAL(name)
|
||||||
@@ -108,11 +108,11 @@ static inline bool is_endbr(u32 *val) { return false; }
|
|||||||
static inline u64 ibt_save(bool disable) { return 0; }
|
static inline u64 ibt_save(bool disable) { return 0; }
|
||||||
static inline void ibt_restore(u64 save) { }
|
static inline void ibt_restore(u64 save) { }
|
||||||
|
|
||||||
#else /* __ASSEMBLY__ */
|
#else /* __ASSEMBLER__ */
|
||||||
|
|
||||||
#define ENDBR
|
#define ENDBR
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLER__ */
|
||||||
|
|
||||||
#endif /* CONFIG_X86_KERNEL_IBT */
|
#endif /* CONFIG_X86_KERNEL_IBT */
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#define IDT_ALIGN (8 * (1 + HAS_KERNEL_IBT))
|
#define IDT_ALIGN (8 * (1 + HAS_KERNEL_IBT))
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
#include <linux/entry-common.h>
|
#include <linux/entry-common.h>
|
||||||
#include <linux/hardirq.h>
|
#include <linux/hardirq.h>
|
||||||
|
|
||||||
@@ -474,7 +474,7 @@ static inline void fred_install_sysvec(unsigned int vector, const idtentry_t fun
|
|||||||
idt_install_sysvec(vector, asm_##function); \
|
idt_install_sysvec(vector, asm_##function); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* !__ASSEMBLY__ */
|
#else /* !__ASSEMBLER__ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The ASM variants for DECLARE_IDTENTRY*() which emit the ASM entry stubs.
|
* The ASM variants for DECLARE_IDTENTRY*() which emit the ASM entry stubs.
|
||||||
@@ -579,7 +579,7 @@ SYM_CODE_START(spurious_entries_start)
|
|||||||
SYM_CODE_END(spurious_entries_start)
|
SYM_CODE_END(spurious_entries_start)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLER__ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The actual entry points. Note that DECLARE_IDTENTRY*() serves two
|
* The actual entry points. Note that DECLARE_IDTENTRY*() serves two
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#ifndef X86_ASM_INST_H
|
#ifndef X86_ASM_INST_H
|
||||||
#define X86_ASM_INST_H
|
#define X86_ASM_INST_H
|
||||||
|
|
||||||
#ifdef __ASSEMBLY__
|
#ifdef __ASSEMBLER__
|
||||||
|
|
||||||
#define REG_NUM_INVALID 100
|
#define REG_NUM_INVALID 100
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <asm/processor-flags.h>
|
#include <asm/processor-flags.h>
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
|
|
||||||
#include <asm/nospec-branch.h>
|
#include <asm/nospec-branch.h>
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ static __always_inline void native_local_irq_restore(unsigned long flags)
|
|||||||
#ifdef CONFIG_PARAVIRT_XXL
|
#ifdef CONFIG_PARAVIRT_XXL
|
||||||
#include <asm/paravirt.h>
|
#include <asm/paravirt.h>
|
||||||
#else
|
#else
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
static __always_inline unsigned long arch_local_save_flags(void)
|
static __always_inline unsigned long arch_local_save_flags(void)
|
||||||
@@ -133,10 +133,10 @@ static __always_inline unsigned long arch_local_irq_save(void)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLER__ */
|
||||||
#endif /* CONFIG_PARAVIRT_XXL */
|
#endif /* CONFIG_PARAVIRT_XXL */
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLER__
|
||||||
static __always_inline int arch_irqs_disabled_flags(unsigned long flags)
|
static __always_inline int arch_irqs_disabled_flags(unsigned long flags)
|
||||||
{
|
{
|
||||||
return !(flags & X86_EFLAGS_IF);
|
return !(flags & X86_EFLAGS_IF);
|
||||||
@@ -154,6 +154,6 @@ static __always_inline void arch_local_irq_restore(unsigned long flags)
|
|||||||
if (!arch_irqs_disabled_flags(flags))
|
if (!arch_irqs_disabled_flags(flags))
|
||||||
arch_local_irq_enable();
|
arch_local_irq_enable();
|
||||||
}
|
}
|
||||||
#endif /* !__ASSEMBLY__ */
|
#endif /* !__ASSEMBLER__ */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user