Re: [PATCH 2/2] x86/cpu: Skip reading MSR_IA32_PLATFORM_ID in virtualized environment

Edgecombe, Rick P
2026-04-28T18:55:06Z

On Tue, 2026-04-28 at 14:01 +0800, Xiaoyao Li wrote:
> > + /* Don't try to read microcode bits when virtualized. */
>
> The platform ID is not only used by microcode update.

From the series with the blamed commit:
Today, the only code that cares about the platform ID is the microcode
update code itself. To facilitate storing the platform ID in a more
generic place and using it outside of the microcode update itself, put
the enumeration into a helper function.

But it is still only used for microcode stuff AFAICT... It seems it was just
moved to be "consistent with the other fields which can be matched".

> I don't think
> calling them microcode bits is proper. It's also stashed in struct
> cpuinfo_x86::intel_platform_id and used in x86_match_cpu() as a factor
> as the generic FMS (Family, Model, Stepping) bits.
>
> We skip things due to hypervisor is set usually when the thing is known
> unable to be virtualized. From the perspective of microcode update, it's
> OK to skip reading it due to hypervisor bit. However, from the
> perspective of generic platform ID, it seems not that reasonable to skip
> reading it due to hypervisor bit. Especially KVM has supported this MSR
> for normal VMs.
>
> So how about using the safe version of RDMSR, if we want the enhancement?

With the check if we are not virtualized we can get a nice warning if run on
some weird platform with this MSR missing.