From: Nadav Har'El <nyh@math.technion.ac.il>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org, Julian Stecklina <js@alien8.de>
Subject: Re: PATCH: nVMX: Better MSR_IA32_FEATURE_CONTROL handling
Date: Mon, 19 Mar 2012 18:53:06 +0200 [thread overview]
Message-ID: <20120319165306.GA20643@fermat.math.technion.ac.il> (raw)
In-Reply-To: <4F578A53.20809@redhat.com>
Hi, in a minute I'll send a new version of the MSR_IA32_FEATURE_CONTROL
patch for nested VMX; I just wanted to reply first to your comments so
you'll know what to expect:
On Wed, Mar 07, 2012, Avi Kivity wrote about "Re: PATCH: nVMX: Better MSR_IA32_FEATURE_CONTROL handling":
> On 03/07/2012 05:58 PM, Nadav Har'El wrote:
> > + u64 msr_ia32_feature_control;
> > };
>
> Need to add to the list of exported MSRs so it can be live migrated
> (msrs_to_save).
Did this.
> The variable itself should live in vcpu->arch, even if
> some bits are vendor specific.
But not this. I understand what you explained about vmx.c being for
Intel *hosts*, not about emulating Intel *guests*, but I do think that
since none of the bits in this MSR are relevant on AMD hosts (which
don't do nested VMX), it isn't useful to support this MSR outside vmx.c.
So I left this variable it in vmx->nested. As I noted earlier, svm.c
did exactly the same thing (nested.vm_cr_msr), so at least there's
symmetry here.
> > @@ -1999,7 +2000,7 @@ static int vmx_get_vmx_msr(struct kvm_vc
> >
> > switch (msr_index) {
> > case MSR_IA32_FEATURE_CONTROL:
> > - *pdata = 0;
> > + *pdata = to_vmx(vcpu)->nested.msr_ia32_feature_control;
> > break;
>
> In a separate patch, please move this outside vmx_get_vmx_msr(). It's
> not a vmx msr.
Done, but not split into two patches: The patch removes the old case in
vmx_get_vmx_msr() (and also removes vmx_set_vmx_msr() entirely) and
instead adds the case in vmx_get_msr() and vmx_set_msr().
> > +#define VMXON_NEEDED_FEATURES \
> > + (FEATURE_CONTROL_LOCKED | FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX)
>
> Use const u64 instead of #define please, it jars my eyes.
I would, if Linux coding style allowed to declare variables in the
middle of blocks. Unfortunately it doesn't, so I left this #define.
I don't think it's that bad.
--
Nadav Har'El | Monday, Mar 19 2012,
nyh@math.technion.ac.il |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |A conscience does not prevent sin. It
http://nadav.harel.org.il |only prevents you from enjoying it.
next prev parent reply other threads:[~2012-03-19 16:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-07 15:58 PATCH: nVMX: Better MSR_IA32_FEATURE_CONTROL handling Nadav Har'El
2012-03-07 16:18 ` Avi Kivity
2012-03-15 17:40 ` Nadav Har'El
2012-03-15 18:08 ` Avi Kivity
2012-03-19 16:53 ` Nadav Har'El [this message]
2012-03-19 17:03 ` Nadav Har'El
2012-03-21 13:09 ` Avi Kivity
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=20120319165306.GA20643@fermat.math.technion.ac.il \
--to=nyh@math.technion.ac.il \
--cc=avi@redhat.com \
--cc=js@alien8.de \
--cc=kvm@vger.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.