linux-stable/arch/x86/platform
Thomas Gleixner a5a0081ae5 x86/efi: Make efi_set_virtual_address_map IBT safe
[ Upstream commit 0303c9729a ]

Niklāvs reported a boot regression on an Alderlake machine and bisected it
to commit 9df9d2f047 ("init: Invoke arch_cpu_finalize_init() earlier").

By moving the invocation of arch_cpu_finalize_init() further down he
identified that efi_enter_virtual_mode() is the function which causes the
boot hang.

The main difference of the earlier invocation is that the boot CPU is
already fully initialized and mitigations and alternatives are applied.

But the only really interesting change turned out to be IBT, which is now
enabled before efi_enter_virtual_mode(). "ibt=off" on the kernel command
line cured the problem.

Inspection of the involved calls in efi_enter_virtual_mode() unearthed that
efi_set_virtual_address_map() is the only place in the kernel which invokes
an EFI call without the IBT safe wrapper. This went obviously unnoticed so
far as IBT was enabled later.

Use arch_efi_call_virt() instead of efi_call() to cure that.

Fixes: fe379fa4d1 ("x86/ibt: Disable IBT around firmware")
Fixes: 9df9d2f047 ("init: Invoke arch_cpu_finalize_init() earlier")
Reported-by: Niklāvs Koļesņikovs <pinkflames.linux@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217602
Link: https://lore.kernel.org/r/87jzvm12q0.ffs@tglx
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-11 19:39:51 +02:00
..
atom
ce4100 x86/ce4100: Replace "ti,pcf8575" by "nxp,pcf8575" 2021-12-03 18:23:57 +01:00
efi x86/efi: Make efi_set_virtual_address_map IBT safe 2023-07-11 19:39:51 +02:00
geode x86/platform/geode: Convert alix LED to GPIO machine descriptor 2021-01-15 18:55:53 +01:00
intel x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
intel-mid platform-drivers-x86 for v5.12-1 2021-02-22 08:50:01 -08:00
intel-quark x86/platform/intel/quark: Fix incorrect kernel-doc comment syntax in files 2021-04-10 13:59:25 +02:00
iris module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
olpc ACPI: make remove callback of ACPI driver void 2022-11-23 19:11:22 +01:00
pvh x86,xen,objtool: Add UNWIND hint 2022-04-19 21:58:47 +02:00
scx200
ts5500
uv x86/uv: Use irq_domain_create_hierarchy() 2023-02-13 19:31:24 +00:00
Makefile Simple Firmware Interface (SFI) support removal for v5.12-rc1 2021-02-24 10:35:29 -08:00