linux-stable/arch/x86
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
..
boot Kbuild updates for v6.3 2023-02-26 11:53:25 -08:00
coco x86/tdx: Fix race between set_memory_encrypted() and load_unaligned_zeropad() 2023-07-11 19:39:24 +02:00
configs
crypto crypto: x86/aria - Use 16 byte alignment for GFNI constant vectors 2023-06-09 10:47:48 +02:00
entry Changes in this cycle were: 2023-03-02 09:45:34 -08:00
events perf/ibs: Fix interface via core pmu events 2023-07-11 19:39:25 +02:00
hyperv x86/hyperv: Remove unregister syscore call from Hyper-V cleanup 2022-11-29 17:55:29 +00:00
ia32 x86/signal/32: Merge native and compat 32-bit signal code 2022-10-19 09:58:49 +02:00
include x86/mm: Fix __swp_entry_to_pte() for Xen PV guests 2023-07-11 19:39:26 +02:00
kernel x86/mtrr: Support setting MTRR state for software defined MTRRs 2023-07-11 19:39:25 +02:00
kvm KVM: x86: Bail from kvm_recalculate_phys_map() if x2APIC ID is out-of-bounds 2023-06-09 10:48:24 +02:00
lib x86: fix clear_user_rep_good() exception handling annotation 2023-05-17 14:02:08 +02:00
math-emu
mm x86/mm: Allow guest.enc_status_change_prepare() to fail 2023-07-11 19:39:23 +02:00
net bpf: Fix a bpf_jit_dump issue for x86_64 with sysctl bpf_jit_enable. 2023-06-28 11:14:11 +02:00
pci x86/pci/xen: populate MSI sysfs entries 2023-05-30 14:17:26 +01:00
platform x86/efi: Make efi_set_virtual_address_map IBT safe 2023-07-11 19:39:51 +02:00
power - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
purgatory x86/purgatory: remove PGO flags 2023-06-21 16:02:09 +02:00
ras
realmode x86/boot: Skip realmode init code when running as Xen PV guest 2022-11-25 12:05:22 +01:00
tools kbuild: allow to combine multiple V= levels 2023-01-22 23:43:32 +09:00
um This pull request contains the following changes for UML: 2023-03-01 09:13:00 -08:00
video
virt/vmx/tdx
xen x86/xen: Set MTRR state when running as Xen PV initial domain 2023-07-11 19:39:25 +02:00
.gitignore
Kbuild
Kconfig mm: introduce new 'lock_mm_and_find_vma()' page fault helper 2023-07-01 13:14:44 +02:00
Kconfig.assembler crypto: x86/aria-avx - fix build failure with old binutils 2023-01-20 18:29:31 +08:00
Kconfig.cpu
Kconfig.debug
Makefile x86/unwind/orc: Add ELF section with ORC version identifier 2023-06-28 11:14:24 +02:00
Makefile.um um: Only disable SSE on clang to work around old GCC bugs 2023-04-04 09:57:05 +02:00
Makefile_32.cpu