Message ID | 20090111091233.GB4040@amt.cnet (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Marcelo Tosatti wrote: > 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; > } > > Won't even compile, will it?
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; }