Re: [PATCH v2] KVM: Avoid zapping unrelated shadows in __kvm_set_memory_region()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 13 Apr 2012 18:33:39 -0300
Marcelo Tosatti <mtosatti@xxxxxxxxxx> wrote:

> >  	kvm_arch_commit_memory_region(kvm, mem, old, user_alloc);
> >  
> > -	/*
> > -	 * If the new memory slot is created, we need to clear all
> > -	 * mmio sptes.
> > -	 */
> > -	if (npages && old.base_gfn != mem->guest_phys_addr >> PAGE_SHIFT)
> > -		kvm_arch_flush_shadow(kvm);
> > +	/* Need to clear all mmio sptes used before. */
> > +	if (npages && old.npages && base_gfn != old.base_gfn)
> > +		kvm_arch_flush_shadow(kvm, mem->slot);
> 
> mmio sptes are not related to any particular slot (by definition),
> i think you misunderstood the purpose of this flush. It handles
> 
> 1) [start, end] gpa range unmapped.
> 2) mmio sptes are created that map this range.
> 3) a new slot is created. mmio sptes that map [start, end] range,
> which is now backed by new memslot should be removed.

Ah, OK.

> Perhaps there is an efficient way to clear all mmio sptes, or all
> mmio sptes pointing to [start, end] (instead of all sptes), here.

Well, I am OK -- though not happy -- with flushing everything during
the guest start-up.

But once shadows are fully created, we do not want to do that.

So maybe worth thinking such an efficient way!

	Takuya
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux