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>
This commit is contained in:
Chao Peng
2018-10-24 16:05:11 +08:00
committed by Paolo Bonzini
parent f99e3daf94
commit 86f5201df0
4 changed files with 33 additions and 2 deletions

View File

@@ -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,