From: Avi Kivity <avi@redhat.com>
To: "Nadav Har'El" <nyh@math.technion.ac.il>
Cc: Chris Wright <chrisw@redhat.com>, kvm@vger.kernel.org
Subject: Re: KVM call minutes for Nov 30
Date: Tue, 07 Dec 2010 15:10:03 +0200 [thread overview]
Message-ID: <4CFE322B.4080004@redhat.com> (raw)
In-Reply-To: <20101207124907.GA25485@fermat.math.technion.ac.il>
On 12/07/2010 02:49 PM, Nadav Har'El wrote:
> On Tue, Dec 07, 2010, Avi Kivity wrote about "Re: KVM call minutes for Nov 30":
> >...
> > All it requires is a
> > kvm_set_cr3() which will load the PDPTEs into the PDPTRs if PAE is
> > enabled. You may need to order the loading of CR0, CR3, CR4, and EFER
> > to achieve the desired effect.
>
> I did this more explicitly as:
>
> vmcs_writel(GUEST_CR3, get_vmcs12_fields(vcpu)->guest_cr3);
> vcpu->arch.cr3 = get_vmcs12_fields(vcpu)->guest_cr3;
> load_pdptrs(vcpu, vcpu->arch.walk_mmu, vcpu->arch.cr3);
> vmcs_write64(GUEST_PDPTR0, vcpu->arch.mmu.pdptrs[0]);
> vmcs_write64(GUEST_PDPTR1, vcpu->arch.mmu.pdptrs[1]);
> vmcs_write64(GUEST_PDPTR2, vcpu->arch.mmu.pdptrs[2]);
> vmcs_write64(GUEST_PDPTR3, vcpu->arch.mmu.pdptrs[3]);
>
> I'm still working on trying to simplify this code - I'll indeed try to see if
> I can use kvm_set_cr3 instead. Thanks for the suggestion.
> However, Even if it works, I have a concern on how nested vmx might brake in
> the future if kvm_set_cr3 is changed in some way that is irrelevant to nested.
It's more correct to use kvm_set_cr3(), since that accounts for all side
effects. For example unsynchronized shadow mmu pages need to be
synced. If there are new side effects that we don't want in nesting,
then we'll add a flag to avoid them.
Also need to do the same on the vmexit path (kvm_set_cr3(HOST_CR3)).
This is what svm does (though only for !npt; but it should also work
unconditionally).
--
error compiling committee.c: too many arguments to function
prev parent reply other threads:[~2010-12-07 13:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-30 15:53 KVM call minutes for Nov 30 Chris Wright
2010-11-30 15:59 ` Anthony Liguori
2010-12-01 9:27 ` Nadav Har'El
2010-12-01 10:28 ` Avi Kivity
2010-12-06 19:39 ` Nadav Har'El
2010-12-07 8:34 ` Avi Kivity
2010-12-07 12:49 ` Nadav Har'El
2010-12-07 13:10 ` Avi Kivity [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=4CFE322B.4080004@redhat.com \
--to=avi@redhat.com \
--cc=chrisw@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=nyh@math.technion.ac.il \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox