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: Wed, 07 Jan 2009 07:49:10 +0100 Message-ID: <49645066.4040009@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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , "kvm@vger.kernel.org" , joerg.roedel@amd.com To: Marcelo Tosatti Return-path: Received: from mx1.suse.de ([195.135.220.2]:45288 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752605AbZAGGsx (ORCPT ); Wed, 7 Jan 2009 01:48:53 -0500 In-Reply-To: <20090106164311.GA4902@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: Marcelo Tosatti wrote: > On Tue, Jan 06, 2009 at 04:29:59PM +0200, Avi Kivity wrote: > >> Yes... >> >> Looks like kvm_unsync_page can be folded into mmu_need_write_protect >> (after which we can drop lookup_page(), which is not a good API). But >> that's after we solve the current problem. >> >> Looks like the addition of a second role for non-pge mode confuses the >> mmu. After the second page is created, mmu_need_write_protect() will >> return 1, but previously existing sptes can still be writable? >> >> Looks like we need to call rmap_write_protect() when the new page is >> created. >> > > I'm not sure about the details, but I suspect that multiple shadows > confuse NPT somehow. > > Alexander can you give this a try: > 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? Maybe this actually even breaks EPT? I remember having seen a lot of CR4 hacks in svm.c when npt is enabled. Maybe that is related? Alex