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

Sohil Mehta
2025-10-31T18:32:58Z

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.