From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH v2 2/2] KVM: Fetch guest cr3 from hardware on demand
Date: Wed, 22 Dec 2010 16:03:47 +0200 [thread overview]
Message-ID: <4D120543.5040309@redhat.com> (raw)
In-Reply-To: <20101222134416.GA10696@amt.cnet>
On 12/22/2010 03:44 PM, Marcelo Tosatti wrote:
> On Mon, Dec 20, 2010 at 03:46:12PM +0200, Avi Kivity wrote:
> > Instead of syncing the guest cr3 every exit, which is expensince on vmx
> > with ept enabled, sync it only on demand.
> >
>
> > static inline ulong kvm_read_cr3(struct kvm_vcpu *vcpu)
> > {
> > + if (!test_bit(VCPU_EXREG_CR3, (ulong *)&vcpu->arch.regs_avail))
> > + kvm_x86_ops->decache_cr3(vcpu);
> > return vcpu->arch.cr3;
> > }
>
> Should mark register available on vcpu->arch.cr3 assignment
> (kvm_set_cr3, kvm_set_sregs, etc), so that subsequent cr3 read does not
> use decache value.
True. Will fix and repost.
(it's not a correctness problem, since the cached value will match
GUEST_CR3, but it's nicer)
--
error compiling committee.c: too many arguments to function
prev parent reply other threads:[~2010-12-22 14:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-20 13:46 [PATCH v2 0/2] Keep cr3 cached in VMCS Avi Kivity
2010-12-20 13:46 ` [PATCH v2 1/2] KVM: Replace reads of vcpu->arch.cr3 by an accessor Avi Kivity
2010-12-20 13:46 ` [PATCH v2 2/2] KVM: Fetch guest cr3 from hardware on demand Avi Kivity
2010-12-22 13:44 ` Marcelo Tosatti
2010-12-22 14:03 ` 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=4D120543.5040309@redhat.com \
--to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox