Re: A question about INVPCID without PCID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/10/19 21:48, Jim Mattson wrote:
> Does anyone know why kvm disallows enumerating INVPCID in the guest
> CPUID when PCID is not enumerated? There are many far more nonsensical
> CPUID combinations that kvm does allow, such as AVX512F without XSAVE,
> or even PCID without LM. Why is INVPCID without PCID of paramount
> concern?
> 

I guess you're looking at this code:

                /* Exposing INVPCID only when PCID is exposed */
                bool invpcid_enabled =
                        guest_cpuid_has(vcpu, X86_FEATURE_INVPCID) &&
                        guest_cpuid_has(vcpu, X86_FEATURE_PCID);

The INVPCID instruction will be disabled if !PCID && INVPCID, but it
doesn't really disallow *enumerating* INVPCID.  There is no particular
reason for that, it was done like that originally ("KVM: VMX: Implement
PCID/INVPCID for guests with EPT") and kept this way.

With !PCID && INVPCID you could use PCID=0 operations as a fancy INVLPG,
I suppose, but it is probably uninteresting enough that no one bothered
changing it.

Paolo





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux