kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] KVM: MMU: Segregate mmu pages created with different cr4.pge settings
@ 2009-01-11  9:12 Marcelo Tosatti
  2009-01-11  9:20 ` Avi Kivity
  0 siblings, 1 reply; 16+ messages in thread
From: Marcelo Tosatti @ 2009-01-11  9:12 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Alexander Graf, kvm, joerg.roedel

On Wed, Jan 07, 2009 at 01:32:41PM +0200, Avi Kivity wrote:
> Marcelo Tosatti wrote:
>> 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). 
>
> I doubt that mmu notifiers were invoked in this case (the bug would be  
> very rare); in any case we flush the tlb.

There are other events that zap shadow pages. Anyway, someone else
should figure why NPT dislikes duplicate shadow page tables for 
the same address space. How about this, untested:

KVM: MMU: zero base_role on TDP mmu context initialization

A recent change which propagates CR4.PGE to shadow page roles broke NPT,
perhaps due to the allocation of duplicate shadow trees for the same
address space (actual details unknown).

In the meantime, since guest CR4.PGE is controlled by HW with
NPT, and the relevant role information for TDP is passed directly to
kvm_mmu_get_page, zero base_role on TDP mmu context init.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 10bdb2a..44ffcf6 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2231,6 +2231,8 @@ static int init_kvm_tdp_mmu(struct kvm_vcpu *vcpu)
 		context->root_level = PT32_ROOT_LEVEL;
 	}
 
+	vcpu->arch.mmu.base_role = 0;
+
 	return 0;
 }
 



^ permalink raw reply related	[flat|nested] 16+ messages in thread
[parent not found: <20081221184146.8E00B250012@cleopatra.tlv.redhat.com>]

end of thread, other threads:[~2009-01-11  9:20 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-11  9:12 [PATCH] KVM: MMU: Segregate mmu pages created with different cr4.pge settings Marcelo Tosatti
2009-01-11  9:20 ` Avi Kivity
     [not found] <20081221184146.8E00B250012@cleopatra.tlv.redhat.com>
2009-01-05 14:56 ` 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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).