From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: Re: [PATCH] KVM: MMU: Segregate mmu pages created with different cr4.pge settings Date: Thu, 8 Jan 2009 20:53:21 +0100 Message-ID: <585C48B8-973C-4792-9122-F0ED36C05754@suse.de> References: <20081221184146.8E00B250012@cleopatra.tlv.redhat.com> <49621FA9.5080903@suse.de> <49633564.7070403@redhat.com> <20090106141151.GA3701@amt.cnet> <49636AE7.4090108@redhat.com> <20090106164311.GA4902@amt.cnet> <49645066.4040009@suse.de> <496481AE.1060102@redhat.com> <20090107104350.GA4170@amt.cnet> <496492D9.7030701@redhat.com> <20090107134606.GA4977@amt.cnet> Mime-Version: 1.0 (iPhone Mail 5F136) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Cc: Avi Kivity , "kvm@vger.kernel.org" , "joerg.roedel@amd.com" To: Marcelo Tosatti Return-path: Received: from mx2.suse.de ([195.135.220.15]:37296 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755414AbZAHTxW (ORCPT ); Thu, 8 Jan 2009 14:53:22 -0500 In-Reply-To: <20090107134606.GA4977@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: Sorry for the late reply - I wanted to know who kvm hangs in the host kernel context :) On 07.01.2009, at 14:46, 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. > > This comment is worrying > > /* > * FIXME: Tis shouldn't be necessary here, but there is a flush > * missing in the MMU code. Until we find this bug, flush the > * complete TLB here on an NPF > */ > if (npt_enabled) > svm_flush_tlb(&svm->vcpu); > This is in, because netbench in an npt-guest failed after a few minutes (see Alex W's bug report) and this appeard to fix it. > Alexander, you might want to try this patch, -ENONPT here (and > revert the previous > one). Eh, what? > I have no clue, what else could be causing this? > > diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c > index 10bdb2a..bf68e5b 100644 > --- a/arch/x86/kvm/mmu.c > +++ b/arch/x86/kvm/mmu.c > @@ -33,6 +33,7 @@ > #include > #include > #include > +#include > > /* > * When setting this variable to true it enables Two-Dimensional- > Paging > @@ -1850,6 +1851,11 @@ static int __direct_map(struct kvm_vcpu > *vcpu, gpa_t v, int write, > > if (*iterator.sptep == shadow_trap_nonpresent_pte) { > pseudo_gfn = (iterator.addr & PT64_DIR_BASE_ADDR_MASK) >> > PAGE_SHIFT; > + > + kvm_flush_remote_tlbs(vcpu->kvm); > + kvm_mmu_flush_tlb(vcpu); > + __flush_tlb(); > + > sp = kvm_mmu_get_page(vcpu, pseudo_gfn, iterator.addr, > iterator.level - 1, > 1, ACC_ALL, iterator.sptep); > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html