linux-stable/arch
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
..
alpha mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:14:45 +02:00
arc ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard 2023-07-11 19:39:49 +02:00
arm ARM: dts: lan966x: kontron-d10: fix SPI CS 2023-07-11 19:39:44 +02:00
arm64 arm64: sme: Use STR P to clear FFR context field in streaming SVE mode 2023-07-11 19:39:51 +02:00
csky csky: fix up lock_mm_and_find_vma() conversion 2023-07-01 13:14:47 +02:00
hexagon mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:14:45 +02:00
ia64 mm: always expand the stack with the mmap write lock held 2023-07-01 13:14:46 +02:00
loongarch mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:14:45 +02:00
m68k mm: always expand the stack with the mmap write lock held 2023-07-01 13:14:46 +02:00
microblaze mm: always expand the stack with the mmap write lock held 2023-07-01 13:14:46 +02:00
mips MIPS: DTS: CI20: Fix ACT8600 regulator node names 2023-07-11 19:39:40 +02:00
nios2 mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:14:45 +02:00
openrisc mm: always expand the stack with the mmap write lock held 2023-07-01 13:14:46 +02:00
parisc parisc: fix expand_stack() conversion 2023-07-01 13:14:47 +02:00
powerpc powerpc/mm/dax: Fix the condition when checking if altmap vmemap can cross-boundary 2023-07-11 19:39:48 +02:00
riscv riscv: uprobes: Restore thread.bad_cause 2023-07-11 19:39:48 +02:00
s390 mm: always expand the stack with the mmap write lock held 2023-07-01 13:14:46 +02:00
sh mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:14:45 +02:00
sparc sparc32: fix lock_mm_and_find_vma() conversion 2023-07-01 13:14:47 +02:00
um mm: always expand the stack with the mmap write lock held 2023-07-01 13:14:46 +02:00
x86 x86/efi: Make efi_set_virtual_address_map IBT safe 2023-07-11 19:39:51 +02:00
xtensa mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:14:45 +02:00
.gitignore
Kconfig arch/Kconfig: fix indentation 2023-02-09 17:03:20 -08:00