Re: [PATCH 3/6] kvm.git allow browsing memslots with mmu_lock

Marcelo Tosatti
2008-07-28T21:54:24Z

On Fri, Jul 25, 2008 at 04:32:03PM +0200, Andrea Arcangeli wrote:
> This allows reading memslots with only the mmu_lock hold for mmu
> notifiers that runs in atomic context and with mmu_lock held.
>
> Compared to previous versions I had to move this:
>
> - if (mem->slot >= kvm->nmemslots)
> - kvm->nmemslots = mem->slot + 1;
>
> after the call to kvm_arch_flush_shadow but that's ok as they're
> mutually exclusive: npages being null asks to remove the memslot and
> you can't remove a memslot that doesn't exist yet even if there's no
> explicit check that forbids it. In any case the ordering didn't seem
> meaningful if slots is set higher than nmemslots. But please Marcelo
> double check, thanks!
>
> Signed-off-by: Andrea Arcangeli <andrea@qumranet.com>

Looks good.