]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: Unconditionally clear CPUID.INVPCID if !CPUID.PCID
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 23 Sep 2020 16:50:46 +0000 (09:50 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 28 Sep 2020 11:57:29 +0000 (07:57 -0400)
commit1ed3c35f7057a04ef3703d11e0fe47901ad7a2ea
tree17366cfba22b260da80a4b8cb44987ca1c1ab230
parent9d6885596870e3706b1b4821b2572bb5b8d07086
KVM: VMX: Unconditionally clear CPUID.INVPCID if !CPUID.PCID

If PCID is not exposed to the guest, clear INVPCID in the guest's CPUID
even if the VMCS INVPCID enable is not supported.  This will allow
consolidating the secondary execution control adjustment code without
having to special case INVPCID.

Technically, this fixes a bug where !CPUID.PCID && CPUID.INVCPID would
result in unexpected guest behavior (#UD instead of #GP/#PF), but KVM
doesn't support exposing INVPCID if it's not supported in the VMCS, i.e.
such a config is broken/bogus no matter what.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200923165048.20486-3-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c