On 02/10/2012 03:25 PM, Takuya Yoshikawa wrote: > Avi Kivity <avi@xxxxxxxxxx> wrote: > > > > 2. When we create(and shift?) a memory slot, we call kvm_arch_flush_shadow() > > > to clear all mmio sptes, again not restricted to that slot. > > > > > > /* > > > * 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); > > > > This is pretty rare outside the previous scenario (memory/pci hotplug). > > Is this condition correct? > > When npages != 0 and old.npages == 0, the slot is being newly created, do we > really need to flush shadow pages? > > This should be > if (npages && old.npages && (old.base_gfn != base_gfn)) > Your condition is more correct, but in practice there's no difference. If old.npages == 0, then old.base_gfn will be 0, and the condition will fail, except for the first slot created (when the shadow cache is empty anyway). -- error compiling committee.c: too many arguments to function -- 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