public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Alexander Graf <agraf@suse.de>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	joerg.roedel@amd.com
Subject: Re: [PATCH] KVM: MMU: Segregate mmu pages created with different cr4.pge settings
Date: Wed, 7 Jan 2009 08:43:50 -0200	[thread overview]
Message-ID: <20090107104350.GA4170@amt.cnet> (raw)
In-Reply-To: <496481AE.1060102@redhat.com>

On Wed, Jan 07, 2009 at 12:19:26PM +0200, Avi Kivity wrote:
> Alexander Graf wrote:
>> Using this patch it works. But if I read it correctly, that doesn't
>> actually fix anything but only treats NPT/EPT special, which it
>> shouldn't, should it? 
>
> The patch doesn't fix the bug but is nevertheless correct.  cr4.pge only  
> matters to the mmu if using the shadow mmu; with tdp it only wastes  
> memory (and exposes the bug which you encountered).
>
> So, wrt to the bug you saw, it's a workaround, but it's also a correct  
> fix for another bug.
>
>> Maybe this actually even breaks EPT?
>>   
>
> It shouldn't.
>
>> I remember having seen a lot of CR4 hacks in svm.c when npt is enabled.
>> Maybe that is related?
>>   
>
> No.  cr4 controls the guest mmu, but with npt the guest mmu is  
> completely virtualized, so we need to ignore those bits.

Let me shoot at one direction: a shadow page with PGE bit in either
state is created. Later that shadow page is nuked (via mmu notifiers,
for example). Then set_cr4 changes base_role.pge to a different value,
and a fault creates a new shadow page and instantiates that in the tree.

Perhaps a svm_flush_tlb is required in such case, when updating a
previously valid pagetable entry? Joerg?


  reply	other threads:[~2009-01-07 10:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20081221184146.8E00B250012@cleopatra.tlv.redhat.com>
2009-01-05 14:56 ` [PATCH] KVM: MMU: Segregate mmu pages created with different cr4.pge settings Alexander Graf
2009-01-06 10:41   ` Avi Kivity
2009-01-06 14:11     ` Marcelo Tosatti
2009-01-06 14:29       ` Avi Kivity
2009-01-06 15:06         ` Marcelo Tosatti
2009-01-06 16:43         ` Marcelo Tosatti
2009-01-07  6:49           ` Alexander Graf
2009-01-07 10:19             ` Avi Kivity
2009-01-07 10:43               ` Marcelo Tosatti [this message]
2009-01-07 11:32                 ` Avi Kivity
2009-01-07 13:46                   ` Marcelo Tosatti
2009-01-08 19:53                     ` Alexander Graf
2009-01-09  0:36                       ` Marcelo Tosatti
2009-01-09 10:43                         ` Alexander Graf
2009-01-11  9:12 Marcelo Tosatti
2009-01-11  9:20 ` 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=20090107104350.GA4170@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=joerg.roedel@amd.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox