public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Marcelo Tosatti <marcelo@kvack.org>
Cc: kvm-devel@lists.sourceforge.net
Subject: Re: [PATCH 7/8] KVM: MMU: VMX cr3 cache support
Date: Thu, 06 Mar 2008 16:44:26 +0200	[thread overview]
Message-ID: <47D0034A.1040504@qumranet.com> (raw)
In-Reply-To: <20080306141150.GA19266@dmt>

Marcelo Tosatti wrote:
>>
>> Here CR3_TARGET_VALUEx is written.
>> My question is:
>> 1 why is vmcs_writel(CR3_TARGET_VALUE0 + idx*2, cr3); called by
>> vmx_set_cr3(), but not called by mmu_free_roots()?
>>     
>
> By clearing guest_cr3 entry of the shared area we avoid the guest from
> using it.
>
> So its unecessary to also clear the corresponding CR3_TARGET_VALUE0
> register.
>
>   
>> 2 since "cache" is also mapped to guest OS. Is calling
>> vmcs_writel(CR3_TARGET_VALUE0 + idx*2, cr3); necessary?
>>     
>
> As said above, no, because the guest will check
> cache->entry[idx].guest_cr3 before attempting to use a cached host_cr3
> value.
>   


Only if you trust the guest.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  reply	other threads:[~2008-03-06 14:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-02 16:31 [PATCH 7/8] KVM: MMU: VMX cr3 cache support Avi Kivity
2008-03-06 13:15 ` Zhao Forrest
2008-03-06 14:11   ` Marcelo Tosatti
2008-03-06 14:44     ` Avi Kivity [this message]
2008-03-06 23:47       ` Marcelo Tosatti

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=47D0034A.1040504@qumranet.com \
    --to=avi@qumranet.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=marcelo@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox