]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
KVM: VMX: Fix VPID capability detection
authorWanpeng Li <wanpeng.li@hotmail.com>
Wed, 18 Oct 2017 23:02:19 +0000 (16:02 -0700)
committerRadim Krčmář <rkrcmar@redhat.com>
Fri, 20 Oct 2017 16:05:01 +0000 (18:05 +0200)
commit61f1dd9099aba56b7e6e3c3c4b9ad13199bba06e
tree32b7ad5b347661dc5559e5acb6542a718ad5d3dd
parent575b3a2cb439b03fd603ea77c73c76f3ed237596
KVM: VMX: Fix VPID capability detection

In my setup, EPT is not exposed to L1, the VPID capability is exposed and
can be observed by vmxcap tool in L1:
INVVPID supported                        yes
Individual-address INVVPID               yes
Single-context INVVPID                   yes
All-context INVVPID                      yes
Single-context-retaining-globals INVVPID yes

However, the module parameter of VPID observed in L1 is always N, the
cpu_has_vmx_invvpid() check in L1 KVM fails since vmx_capability.vpid
is 0 and it is not read from MSR due to EPT is not exposed.

The VPID can be used to tag linear mappings when EPT is not enabled. However,
current logic just detects VPID capability if EPT is enabled, this patch
fixes it.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Jim Mattson <jmattson@google.com>
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/vmx.c