Re: [PATCH 3/7] x86/cpu: Disable kernel LASS when patching kernel alternatives

From: Dave Hansen
Date: Wed Feb 01 2023 - 13:28:08 EST


On 1/31/23 18:25, Sohil Mehta wrote:
>> /*
>> * Set cr4 to a known state:
>> * - physical address extension enabled
>> * - 5-level paging, if it was enabled before
>> */
>> movl $X86_CR4_PAE, %eax
>> testq $X86_CR4_LA57, %r13
>> jz 1f
>> orl $X86_CR4_LA57, %eax
>> 1:
>> movq %rax, %cr4
>>
>> jmp 1f
>> 1:
> Dave, does this address your concern or were you looking for something
> else? Is there some path other than kexec that should also be audited
> for this scenario?

Yep, that addresses it. I don't know of any other path that would
matter. Couldn't hurt to poke around and look for other CR4
manipulation that might need to be LASS-aware, though.