aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx/vmx.c
diff options
context:
space:
mode:
authorChao Peng <chao.p.peng@linux.intel.com>2018-10-24 16:05:11 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2018-12-21 11:28:35 +0100
commit86f5201df0d3e3efc78d3eac7fc5a59b813287cd (patch)
tree3f55a8ef84aa81ce4921a82069ece3014f519876 /arch/x86/kvm/vmx/vmx.c
parentKVM: x86: Add Intel PT virtualization work mode (diff)
downloadlinux-dev-86f5201df0d3e3efc78d3eac7fc5a59b813287cd.tar.xz
linux-dev-86f5201df0d3e3efc78d3eac7fc5a59b813287cd.zip
KVM: x86: Add Intel Processor Trace cpuid emulation
Expose Intel Processor Trace to guest only when the PT works in Host-Guest mode. Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com> Signed-off-by: Luwei Kang <luwei.kang@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
-rw-r--r--arch/x86/kvm/vmx/vmx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 338977e6f552..f5b88b578bbe 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -5886,6 +5886,11 @@ static bool vmx_has_emulated_msr(int index)
}
}
+static bool vmx_pt_supported(void)
+{
+ return pt_mode == PT_MODE_HOST_GUEST;
+}
+
static void vmx_recover_nmi_blocking(struct vcpu_vmx *vmx)
{
u32 exit_intr_info;
@@ -7399,6 +7404,7 @@ static struct kvm_x86_ops vmx_x86_ops __ro_after_init = {
.mpx_supported = vmx_mpx_supported,
.xsaves_supported = vmx_xsaves_supported,
.umip_emulated = vmx_umip_emulated,
+ .pt_supported = vmx_pt_supported,
.request_immediate_exit = vmx_request_immediate_exit,