]> git.ipfire.org Git - thirdparty/linux.git/commit - include/linux/kvm_host.h
KVM: Add barriers to allow mmu_notifier_retry to be used locklessly
authorPaul Mackerras <paulus@samba.org>
Mon, 12 Dec 2011 12:37:21 +0000 (12:37 +0000)
committerAvi Kivity <avi@redhat.com>
Mon, 5 Mar 2012 12:52:38 +0000 (14:52 +0200)
commita355aa54f1d25dff83c0feef8863d83a76988fdb
tree4fe27e8dd1a3935757b319726a8b8bdc10496930
parent342d3db763f2621ed4546ebf8f6c61cb29d7fbdb
KVM: Add barriers to allow mmu_notifier_retry to be used locklessly

This adds an smp_wmb in kvm_mmu_notifier_invalidate_range_end() and an
smp_rmb in mmu_notifier_retry() so that mmu_notifier_retry() will give
the correct answer when called without kvm->mmu_lock being held.
PowerPC Book3S HV KVM wants to use a bitlock per guest page rather than
a single global spinlock in order to improve the scalability of updates
to the guest MMU hashed page table, and so needs this.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Acked-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
include/linux/kvm_host.h
virt/kvm/kvm_main.c