diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2019-12-24 14:29:09 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2020-04-28 19:03:09 +0100 |
commit | 22598e60eb97d7f35692abfba736877f0d1fcdea (patch) | |
tree | 7f238466fa90802d2652395dd42732c3be83a758 /arch | |
parent | 789982d12d66c8acc7b7f84b578b79d197682ae7 (diff) | |
download | linux-stable-22598e60eb97d7f35692abfba736877f0d1fcdea.tar.gz linux-stable-22598e60eb97d7f35692abfba736877f0d1fcdea.tar.bz2 linux-stable-22598e60eb97d7f35692abfba736877f0d1fcdea.zip |
x86/efistub: Disable paging at mixed mode entry
commit 4911ee401b7ceff8f38e0ac597cbf503d71e690c upstream.
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 <ardb@kernel.org>
Cc: Arvind Sankar <nivedita@alum.mit.edu>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: https://lkml.kernel.org/r/20191224132909.102540-4-ardb@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/boot/compressed/head_64.S | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index 6b1766c6c082..2fcd71219b92 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S @@ -216,6 +216,11 @@ ENTRY(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 ENDPROC(efi32_stub_entry) #endif |