x86/efi: Make efi_enter/leave_mm() use the use_/unuse_temporary_mm() machinery
authorAndy Lutomirski <luto@kernel.org>
Wed, 2 Apr 2025 09:45:39 +0000 (11:45 +0200)
committerIngo Molnar <mingo@kernel.org>
Sat, 12 Apr 2025 08:06:04 +0000 (10:06 +0200)
commite7021e2fe0b4335523d3f6e2221000bdfc633b62
tree6b135a1208f59e333dd6d3e3c413de6dbebde248
parent58f8ffa917669a0c8c027e24d5349f0b488f8181
x86/efi: Make efi_enter/leave_mm() use the use_/unuse_temporary_mm() machinery

This should be considerably more robust.  It's also necessary for optimized
for_each_possible_lazymm_cpu() on x86 -- without this patch, EFI calls in
lazy context would remove the lazy mm from mm_cpumask().

[ mingo: Merged it on top of x86/alternatives ]

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Rik van Riel <riel@surriel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: https://lore.kernel.org/r/20250402094540.3586683-7-mingo@kernel.org
arch/x86/platform/efi/efi_64.c