x86/efi: Restore Firmware IDT before calling ExitBootServices()
authorJoerg Roedel <jroedel@suse.de>
Fri, 20 Aug 2021 12:57:03 +0000 (14:57 +0200)
committerBorislav Petkov <bp@suse.de>
Sat, 21 Aug 2021 15:57:04 +0000 (17:57 +0200)
commit22aa45cb465be474e97666b3f7587ccb06ee411b
tree21dbe2be5ff5eb242ddf3f1d3850cd05e2729a07
parent7c60610d476766e128cc4284bb6349732cbd6606
x86/efi: Restore Firmware IDT before calling ExitBootServices()

Commit

  79419e13e808 ("x86/boot/compressed/64: Setup IDT in startup_32 boot path")

introduced an IDT into the 32-bit boot path of the decompressor stub.
But the IDT is set up before ExitBootServices() is called, and some UEFI
firmwares rely on their own IDT.

Save the firmware IDT on boot and restore it before calling into EFI
functions to fix boot failures introduced by above commit.

Fixes: 79419e13e808 ("x86/boot/compressed/64: Setup IDT in startup_32 boot path")
Reported-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Cc: stable@vger.kernel.org # 5.13+
Link: https://lkml.kernel.org/r/20210820125703.32410-1-joro@8bytes.org
arch/x86/boot/compressed/efi_thunk_64.S
arch/x86/boot/compressed/head_64.S