summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/setup.h
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2020-09-07 16:15:34 +0300
committerBorislav Petkov <bp@suse.de>2020-09-07 23:18:38 +0300
commitf5963ba7a45fc6ff298a34976064354be437e1d8 (patch)
tree3a390e287e24f87c73a2caf0e26970b84e7b1c82 /arch/x86/include/asm/setup.h
parent3add38cb96a1ae7d152db69ab4329e809c2af2d4 (diff)
downloadlinux-f5963ba7a45fc6ff298a34976064354be437e1d8.tar.xz
x86/head/64: Install a CPU bringup IDT
Add a separate bringup IDT for the CPU bringup code that will be used until the kernel switches to the idt_table. There are two reasons for a separate IDT: 1) When the idt_table is set up and the secondary CPUs are booted, it contains entries (e.g. IST entries) which require certain CPU state to be set up. This includes a working TSS (for IST), MSR_GS_BASE (for stack protector) or CR4.FSGSBASE (for paranoid_entry) path. By using a dedicated IDT for early boot this state need not to be set up early. 2) The idt_table is static to idt.c, so any function using/modifying must be in idt.c too. That means that all compiler driven instrumentation like tracing or KASAN is also active in this code. But during early CPU bringup the environment is not set up for this instrumentation to work correctly. To avoid all of these hassles and make early exception handling robust, use a dedicated bringup IDT. The IDT is loaded two times, first on the boot CPU while the kernel is still running on direct mapped addresses, and again later after the switch to kernel addresses has happened. The second IDT load happens on the boot and secondary CPUs. Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20200907131613.12703-34-joro@8bytes.org
Diffstat (limited to 'arch/x86/include/asm/setup.h')
-rw-r--r--arch/x86/include/asm/setup.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index 5c2fd05bd52c..4b3ca5ade2fd 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -50,6 +50,7 @@ extern unsigned long __startup_64(unsigned long physaddr, struct boot_params *bp
extern unsigned long __startup_secondary_64(void);
extern void startup_64_setup_env(unsigned long physbase);
extern int early_make_pgtable(unsigned long address);
+extern void early_setup_idt(void);
#ifdef CONFIG_X86_INTEL_MID
extern void x86_intel_mid_early_setup(void);