From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: KVM: MMU: nuke shadowed pgtable pages and pte's on memslot destruction Date: Mon, 21 Jul 2008 18:34:40 -0300 Message-ID: <20080721213440.GA15961@dmt.cnet> References: <20080704010618.GA25834@dmt.cnet> <486FAE8A.2050308@qumranet.com> <20080705192344.GA16596@dmt.cnet> <486FE48C.7030002@qumranet.com> <20080707173155.GB10372@dmt.cnet> <20080707195822.GA16787@dmt.cnet> <48761FCB.4080307@qumranet.com> <1215716304.16858.64.camel@localhost.localdomain> <20080710234931.GA5295@dmt.cnet> <1216674207.22095.18.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm-devel , "Zhang, Xiantao" To: Hollis Blanchard Return-path: Received: from mx1.redhat.com ([66.187.233.31]:58076 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753159AbYGUVip (ORCPT ); Mon, 21 Jul 2008 17:38:45 -0400 Content-Disposition: inline In-Reply-To: <1216674207.22095.18.camel@localhost.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Jul 21, 2008 at 04:03:27PM -0500, Hollis Blanchard wrote: > On Thu, 2008-07-10 at 20:49 -0300, Marcelo Tosatti wrote: > > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > > index b850d24..2c438a7 100644 > > --- a/arch/powerpc/kvm/powerpc.c > > +++ b/arch/powerpc/kvm/powerpc.c > > @@ -170,6 +170,11 @@ int kvm_arch_set_memory_region(struct kvm *kvm, > > return 0; > > } > > > > +void kvm_arch_flush_shadow(struct kvm *kvm) > > +{ > > + return; > > +} > > + > > struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int > > id) > > { > > struct kvm_vcpu *vcpu; > > By the way, what is the testcase for this, i.e. how do I remove a > memslot? The testcase I used was RH6.2 graphical install, which changes the cirrus mode from linear frame buffer to the standard one, thus destroying the vram memory slot (should be able to do that with the framebuffer driver). All you need on this callback is destroy all shadow mappings, to avoid the MMU code from referencing a memslot that is no longer existant.