Re: [PATCH v11 5/9] x86/efi: Disable LASS while mapping the EFI runtime services

From: Sohil Mehta

Date: Fri Oct 31 2025 - 14:32:58 EST


On 10/31/2025 10:11 AM, Dave Hansen wrote:
> One thing that's actually missing here is an explanation on how it's OK
> to munge CR bits here. Why are preemption and interrupts not a problem?
>

This is called pretty early on from the BSP init flow.

start_kernel()
arch_cpu_finalize_init()
efi_enter_virtual_mode()
__efi_enter_virtual_mode()

I had assumed we run with interrupts disabled. But, that's not true.
Interrupts are enabled midway during start_kernel(). So,
arch_cpu_finalize_init() is called with interrupts enabled.

We write to CR bits during FPU init which happens right before EFI
enters virtual mode. So I am probably missing something obvious that
makes it okay.