Re: [PATCH v4 03/11] x86/startup_64: Simplify CR4 handling in startup code

From: Borislav Petkov
Date: Mon Feb 19 2024 - 05:33:37 EST


On Tue, Feb 13, 2024 at 01:41:47PM +0100, Ard Biesheuvel wrote:
> -#ifdef CONFIG_X86_5LEVEL
> - testb $1, __pgtable_l5_enabled(%rip)
> - jz 1f
> - orl $X86_CR4_LA57, %ecx
> -1:
> + orl $X86_CR4_MCE, %edx
> #endif
> + movq %cr4, %rcx
> + andl %edx, %ecx

Let's just state it explicitly:

/* Even if ignored in long mode, set PSE uniformly on all logical CPUs. */

> + btsl $X86_CR4_PSE_BIT, %ecx
> movq %rcx, %cr4

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette