Skip to content

Commit 4911ee4

Browse files
ardbiesheuvelIngo Molnar
authored andcommitted
x86/efistub: Disable paging at mixed mode entry
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]>
1 parent 818c7ce commit 4911ee4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/x86/boot/compressed/head_64.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,11 @@ SYM_FUNC_START(efi32_stub_entry)
244244
leal efi32_config(%ebp), %eax
245245
movl %eax, efi_config(%ebp)
246246

247+
/* Disable paging */
248+
movl %cr0, %eax
249+
btrl $X86_CR0_PG_BIT, %eax
250+
movl %eax, %cr0
251+
247252
jmp startup_32
248253
SYM_FUNC_END(efi32_stub_entry)
249254
#endif

0 commit comments

Comments
 (0)