From: Sheng Yang <sheng@linux.intel.com>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH 4/4] KVM: VMX: Add instruction rdtscp support for guest
Date: Thu, 17 Dec 2009 22:52:13 +0800 [thread overview]
Message-ID: <200912172252.13307.sheng@linux.intel.com> (raw)
In-Reply-To: <4B2A0A5A.60708@redhat.com>
On Thursday 17 December 2009 18:39:22 Avi Kivity wrote:
> On 12/17/2009 11:33 AM, Sheng Yang wrote:
> > Before enabling, execution of "rdtscp" in guest would result in #UD.
> >
> > Signed-off-by: Sheng Yang<sheng@linux.intel.com>
> > ---
> >
> > Reflect guest CPUID on vmcs fields as well, but it involved some more
> > code which would only executed once... Do we need a callback there for
> > post-"cpuid setting"?
>
> I guess we do need a callback.
>
> > - /* Otherwise falls through to kvm_set_msr_common */
> > + ret = kvm_set_msr_common(vcpu, msr_index, data);
> > + break;
> > + case MSR_TSC_AUX:
> > + if (!vcpu->arch.cpuid_rdtscp_enabled || !vmx_rdtscp_supported())
> > + return 1;
> > + /* Check reserved bit */
> > + if ((data& 0xffff0000) != 0)
> > + return 1;
>
> It's 0xffffffff00000000...
... /me blame himself...
>
> > @@ -913,6 +926,9 @@ static void setup_msrs(struct vcpu_vmx *vmx)
> > index = __find_msr_index(vmx, MSR_CSTAR);
> > if (index>= 0)
> > move_msr_up(vmx, index, save_nmsrs++);
> > + index = __find_msr_index(vmx, MSR_TSC_AUX);
> > + if (index>= 0)
> > + move_msr_up(vmx, index, save_nmsrs++);
>
> Only do this if rdtscp is enabled!
/me blame himself again...
--
regards
Yang, Sheng
prev parent reply other threads:[~2009-12-17 14:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-16 5:48 [PATCH 0/4] Add support for RDTSCP in VMX Sheng Yang
2009-12-16 5:48 ` [PATCH 1/4] KVM: VMX: Remove redundant variable Sheng Yang
2009-12-16 5:48 ` [PATCH 2/4] KVM: Extended shared_msr_global to per CPU Sheng Yang
2009-12-16 9:21 ` Avi Kivity
2009-12-17 9:32 ` Sheng Yang
2009-12-17 10:32 ` Avi Kivity
2009-12-17 15:01 ` Sheng Yang
2009-12-17 15:06 ` Avi Kivity
2009-12-16 5:48 ` [PATCH 3/4] x86: Add IA32_TSC_AUX MSR Sheng Yang
2009-12-16 8:20 ` [tip:x86/urgent] x86: Add IA32_TSC_AUX MSR and use it tip-bot for Sheng Yang
2009-12-16 5:48 ` [PATCH 4/4] KVM: VMX: Add instruction rdtscp support for guest Sheng Yang
2009-12-16 9:47 ` Avi Kivity
2009-12-17 9:33 ` Sheng Yang
2009-12-17 10:39 ` Avi Kivity
2009-12-17 14:52 ` Sheng Yang [this message]
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=200912172252.13307.sheng@linux.intel.com \
--to=sheng@linux.intel.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/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.