Re: [PATCH v4 6/6] x86/microcode/intel: Enable staging when available
From: Chao Gao
Date: Mon Aug 18 2025 - 04:36:08 EST
On Wed, Aug 13, 2025 at 10:26:49AM -0700, Chang S. Bae wrote:
>With the staging code being ready, check for staging availability by
>reading these following MSRs:
>
> * IA32_ARCH_CAPABILITIES (bit 16) for the presence of
> IA32_MCU_ENUMERATION
>
> * IA32_MCU_ENUMERATION (bit 4) for the staging feature availability.
>
>When available, enable it by setting the feature bit.
>
>Signed-off-by: Chang S. Bae <chang.seok.bae@xxxxxxxxx>
>Tested-by: Anselm Busse <abusse@xxxxxxxxx>
Reviewed-by: Chao Gao <chao.gao@xxxxxxxxx>
<snip>
>+static __init bool staging_available(void)
>+{
>+ u64 val;
>+
>+ val = x86_read_arch_cap_msr();
>+ if (!(val & ARCH_CAP_MCU_ENUM))
>+ return false;
>+
>+ rdmsrl(MSR_IA32_MCU_ENUMERATION, val);
nit: s/rdmsrl/rdmsrq
rdmsrl has been renamed to rdmsrq.
>+ return !!(val & MCU_STAGING);
>+}
>+