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
@@ -1477,7 +1477,6 @@ static int alloc_apic_access_page(struct kvm *kvm)
|
||||
struct kvm_userspace_memory_region kvm_userspace_mem;
|
||||
int r = 0;
|
||||
|
||||
mutex_lock(&kvm->lock);
|
||||
down_write(¤t->mm->mmap_sem);
|
||||
if (kvm->arch.apic_access_page)
|
||||
goto out;
|
||||
@@ -1491,7 +1490,6 @@ static int alloc_apic_access_page(struct kvm *kvm)
|
||||
kvm->arch.apic_access_page = gfn_to_page(kvm, 0xfee00);
|
||||
out:
|
||||
up_write(¤t->mm->mmap_sem);
|
||||
mutex_unlock(&kvm->lock);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user