summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/microcode.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2023-10-17 23:23:31 +0200
committerBorislav Petkov (AMD) <bp@alien8.de>2023-10-18 18:28:41 +0200
commit4c585af7180c147062c636a927a2fc2b6a7072f5 (patch)
treec7c48c6d1f897e7cd9161288cd342235c98d39b5 /arch/x86/include/asm/microcode.h
parentx86/microcode: Provide CONFIG_MICROCODE_INITRD32 (diff)
downloadlinux-4c585af7180c147062c636a927a2fc2b6a7072f5.tar.xz
linux-4c585af7180c147062c636a927a2fc2b6a7072f5.zip
x86/boot/32: Temporarily map initrd for microcode loading
Early microcode loading on 32-bit runs in physical address mode because the initrd is not covered by the initial page tables. That results in a horrible mess all over the microcode loader code. Provide a temporary mapping for the initrd in the initial page tables by appending it to the actual initial mapping starting with a new PGD or PMD depending on the configured page table levels ([non-]PAE). The page table entries are located after _brk_end so they are not permanently using memory space. The mapping is invalidated right away in i386_start_kernel() after the early microcode loader has run. This prepares for removing the physical address mode oddities from all over the microcode loader code, which in turn allows further cleanups. Provide the map and unmap code and document the place where the microcode loader needs to be invoked with a comment. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20231017211722.292291436@linutronix.de
Diffstat (limited to 'arch/x86/include/asm/microcode.h')
-rw-r--r--arch/x86/include/asm/microcode.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h
index bbbe9d744977..5216bf1acc3b 100644
--- a/arch/x86/include/asm/microcode.h
+++ b/arch/x86/include/asm/microcode.h
@@ -23,6 +23,8 @@ static inline void load_ucode_ap(void) { }
static inline void microcode_bsp_resume(void) { }
#endif
+extern unsigned long initrd_start_early;
+
#ifdef CONFIG_CPU_SUP_INTEL
/* Intel specific microcode defines. Public for IFS */
struct microcode_header_intel {