aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2021-11-29 16:46:25 +0100
committerIngo Molnar <mingo@kernel.org>2022-03-15 12:57:36 +0100
commit8c8b6a0d0891e371aa7bea2ecb3595fa3359214d (patch)
tree3095eaeaabae1703f477ef225997d47b3a2a758c
parent35c5c94ccf407aeb0f2b4a92fca92eab7c9a3e6e (diff)
downloadtip-8c8b6a0d0891e371aa7bea2ecb3595fa3359214d.tar.gz
headers/deps: x86: Optimize <asm/irqflags.h> dependencies, remove <asm/processor-flags.h> inclusion
-------------------------------------------------------------------- | Combined, preprocessed C code size of header, without line markers, | with comments stripped: ------------------------- before: | #include <asm/irqflags.h> | LOC: 1,898 | headers: 100 after: | #include <asm/irqflags.h> | LOC: 1,504 | headers: 79 <asm/irqflags.h> is included in about 80% of all .c files, so we allow ourselves the small trick of open-coding X86_EFLAGS_IF as 0x200 - a well-known constant in x86-land, and noted in the comment as well. This saves the inclusion of the full <asm/processor-flags.h> header. Fix dangling dependencies. Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/include/asm/cpu.h4
-rw-r--r--arch/x86/include/asm/irqflags.h4
-rw-r--r--arch/x86/include/asm/pgtable_types.h1
-rw-r--r--include/linux/memory_hotplug.h2
4 files changed, 5 insertions, 6 deletions
diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
index 33d41e350c7957..429f1bca02bc16 100644
--- a/arch/x86/include/asm/cpu.h
+++ b/arch/x86/include/asm/cpu.h
@@ -41,14 +41,14 @@ unsigned int x86_family(unsigned int sig);
unsigned int x86_model(unsigned int sig);
unsigned int x86_stepping(unsigned int sig);
#ifdef CONFIG_CPU_SUP_INTEL
-extern void __init sld_setup(struct cpuinfo_x86 *c);
+extern void sld_setup(struct cpuinfo_x86 *c);
extern void switch_to_sld(unsigned long tifn);
extern bool handle_user_split_lock(struct pt_regs *regs, long error_code);
extern bool handle_guest_split_lock(unsigned long ip);
extern void handle_bus_lock(struct pt_regs *regs);
u8 get_this_hybrid_cpu_type(void);
#else
-static inline void __init sld_setup(struct cpuinfo_x86 *c) {}
+static inline void sld_setup(struct cpuinfo_x86 *c) {}
static inline void switch_to_sld(unsigned long tifn) {}
static inline bool handle_user_split_lock(struct pt_regs *regs, long error_code)
{
diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
index 87761396e8cc08..3c1667d58493c1 100644
--- a/arch/x86/include/asm/irqflags.h
+++ b/arch/x86/include/asm/irqflags.h
@@ -2,8 +2,6 @@
#ifndef _X86_IRQFLAGS_H_
#define _X86_IRQFLAGS_H_
-#include <asm/processor-flags.h>
-
#ifndef __ASSEMBLY__
#include <asm/nospec-branch.h>
@@ -122,7 +120,7 @@ static __always_inline unsigned long arch_local_irq_save(void)
#ifndef __ASSEMBLY__
static __always_inline int arch_irqs_disabled_flags(unsigned long flags)
{
- return !(flags & X86_EFLAGS_IF);
+ return !(flags & 0x200); /* X86_EFLAGS_IF */
}
static __always_inline int arch_irqs_disabled(void)
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index 888170836f8942..645bd4a3a008ad 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -3,6 +3,7 @@
#define _ASM_X86_PGTABLE_DEFS_H
#include <asm/page_types.h>
+#include <asm/mem_encrypt.h>
#define _PAGE_BIT_PRESENT 0 /* is present */
#define _PAGE_BIT_RW 1 /* writeable */
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index eec289be319825..031106f29da744 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -327,7 +327,7 @@ extern void set_zone_contiguous(struct zone *zone);
extern void clear_zone_contiguous(struct zone *zone);
#ifdef CONFIG_MEMORY_HOTPLUG
-extern void __ref free_area_init_core_hotplug(int nid);
+extern void free_area_init_core_hotplug(int nid);
extern int __add_memory(int nid, u64 start, u64 size, mhp_t mhp_flags);
extern int add_memory(int nid, u64 start, u64 size, mhp_t mhp_flags);
extern int add_memory_resource(int nid, struct resource *resource,