lkml.org 
[lkml]   [2017]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 9/9] KVM: x86: Disable intercept for Intel processor trace MSRs
From
On October 16, 2017 8:14:11 AM EDT, Luwei Kang <luwei.kang@intel.com> wrote:
>From: Chao Peng <chao.p.peng@linux.intel.com>
>
>Trap for Intel processor trace is none sense. Pass through to
>guest directly.


And none of those MSRs can be subverted by the guest? That is none of these should be filtered / audited first?


>
>Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
>Signed-off-by: Luwei Kang <luwei.kang@intel.com>
>---
> arch/x86/kvm/vmx.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
>diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>index 3c9ce3e..58606ce 100644
>--- a/arch/x86/kvm/vmx.c
>+++ b/arch/x86/kvm/vmx.c
>@@ -7076,6 +7076,20 @@ static __init int hardware_setup(void)
> if (pt_mode == PT_MODE_GUEST)
> pt_register_virt_ops(&pt_virt_ops);
>
>+ if (pt_mode == PT_MODE_GUEST || pt_mode == PT_MODE_HOST_GUEST) {
>+ u32 i, eax, ebx, ecx, edx;
>+
>+ cpuid_count(0x14, 1, &eax, &ebx, &ecx, &edx);
>+ vmx_disable_intercept_for_msr(MSR_IA32_RTIT_CTL, false);
>+ vmx_disable_intercept_for_msr(MSR_IA32_RTIT_STATUS, false);
>+ vmx_disable_intercept_for_msr(MSR_IA32_RTIT_OUTPUT_BASE, false);
>+ vmx_disable_intercept_for_msr(MSR_IA32_RTIT_OUTPUT_MASK, false);
>+ vmx_disable_intercept_for_msr(MSR_IA32_RTIT_CR3_MATCH, false);
>+ for (i = 0; i < (eax & 0x7); i++)
>+ vmx_disable_intercept_for_msr(MSR_IA32_RTIT_ADDR0_A + i,
>+ false);
>+ }
>+
> return alloc_kvm_area();
>
> out:


Thanks!

\
 
 \ /
  Last update: 2017-10-17 19:52    [W:0.038 / U:2.792 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site