From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Luwei Kang <luwei.kang@intel.com>, kvm@vger.kernel.org
Cc: pbonzini@redhat.com, rkrcmar@redhat.com, tglx@linutronix.de,
mingo@redhat.com, hpa@zytor.com, x86@kernel.org,
linux-kernel@vger.kernel.org,
Chao Peng <chao.p.peng@linux.intel.com>
Subject: Re: [PATCH 9/9] KVM: x86: Disable intercept for Intel processor trace MSRs
Date: Tue, 17 Oct 2017 13:50:44 -0400 [thread overview]
Message-ID: <C21EB80B-726A-44B3-BB8D-C7CB274060B7@oracle.com> (raw)
In-Reply-To: <1508156051-5024-1-git-send-email-luwei.kang@intel.com>
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!
next prev parent reply other threads:[~2017-10-17 17:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-16 12:14 [PATCH 9/9] KVM: x86: Disable intercept for Intel processor trace MSRs Luwei Kang
2017-10-17 17:50 ` Konrad Rzeszutek Wilk [this message]
2017-10-18 7:15 ` Kang, Luwei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C21EB80B-726A-44B3-BB8D-C7CB274060B7@oracle.com \
--to=konrad.wilk@oracle.com \
--cc=chao.p.peng@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luwei.kang@intel.com \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.