]> Git Repo - linux.git/commitdiff
x86/efistub: Disable paging at mixed mode entry
authorArd Biesheuvel <[email protected]>
Tue, 24 Dec 2019 13:29:09 +0000 (14:29 +0100)
committerIngo Molnar <[email protected]>
Wed, 25 Dec 2019 09:46:07 +0000 (10:46 +0100)
The EFI mixed mode entry code goes through the ordinary startup_32()
routine before jumping into the kernel's EFI boot code in 64-bit
mode. The 32-bit startup code must be entered with paging disabled,
but this is not documented as a requirement for the EFI handover
protocol, and so we should disable paging explicitly when entering
the kernel from 32-bit EFI firmware.

Signed-off-by: Ard Biesheuvel <[email protected]>
Cc: <[email protected]>
Cc: Arvind Sankar <[email protected]>
Cc: Hans de Goede <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/boot/compressed/head_64.S

index 58a512e33d8d628c60e33cfe21322d7823dbdc3e..ee60b81944a778b3d258d382361d87db8923561f 100644 (file)
@@ -244,6 +244,11 @@ SYM_FUNC_START(efi32_stub_entry)
        leal    efi32_config(%ebp), %eax
        movl    %eax, efi_config(%ebp)
 
+       /* Disable paging */
+       movl    %cr0, %eax
+       btrl    $X86_CR0_PG_BIT, %eax
+       movl    %eax, %cr0
+
        jmp     startup_32
 SYM_FUNC_END(efi32_stub_entry)
 #endif
This page took 0.055319 seconds and 4 git commands to generate.