KVM: MMU: Switch to mmu spinlock
Convert the synchronization of the shadow handling to a separate mmu_lock spinlock. Also guard fetch() by mmap_sem in read-mode to protect against alias and memslot changes. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
This commit is contained in:
committed by
Avi Kivity
parent
d7824fff89
commit
aaee2c94f7
@@ -104,7 +104,8 @@ struct kvm_memory_slot {
|
||||
};
|
||||
|
||||
struct kvm {
|
||||
struct mutex lock; /* protects everything except vcpus */
|
||||
struct mutex lock; /* protects the vcpus array and APIC accesses */
|
||||
spinlock_t mmu_lock;
|
||||
struct mm_struct *mm; /* userspace tied to this vm */
|
||||
int nmemslots;
|
||||
struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS +
|
||||
|
||||
Reference in New Issue
Block a user