Re: KVM: MMU: nuke shadowed pgtable pages and pte's on memslot destruction

Marcelo Tosatti
2008-07-21T21:38:45Z

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.