Re: [RFC PATCH] KVM: x86: Advertise PCID based on hardware support (with an asterisk)

From: Paolo Bonzini
Date: Thu Apr 11 2024 - 13:54:39 EST


On 4/11/24 18:31, Sean Christopherson wrote:
Force set a synthetic feature, GUEST_PCID, if PCID can be safely used in
virtual machines, even if the kernel itself disables PCID support, and
advertise PCID support in KVM if GUEST_PCID is set.

When running on a CPU that is affected by Intel's "Global INVLPG" erratum,
which does NOT affect VMX non-root mode, it is safe to virtualize PCID for
KVM guests, even though it is not safe for the kernel itself to enable PCID.
Ditto for if the kernel disables PCID because CR4.PGE isn't supported.

But the guest would not use it if the f/m/s matches, right? If the advantage is basically not splitting the migration pool, is that a concern for the affected Alder Lake/Gracemont/Raptor Lake processors?

Paolo