summaryrefslogtreecommitdiffstats
path: root/include/linux/kvm_host.h
diff options
context:
space:
mode:
authorMarcelo Tosatti2007-12-21 01:18:26 +0100
committerAvi Kivity2008-01-30 17:01:21 +0100
commitaaee2c94f7a1f7726e360a6cfb40173bd552bcff (patch)
treee9066ae5509c349bfd6a187e85d52cc476e16a12 /include/linux/kvm_host.h
parentKVM: MMU: Avoid calling gfn_to_page() in mmu_set_spte() (diff)
downloadkernel-qcow2-linux-aaee2c94f7a1f7726e360a6cfb40173bd552bcff.tar.gz
kernel-qcow2-linux-aaee2c94f7a1f7726e360a6cfb40173bd552bcff.tar.xz
kernel-qcow2-linux-aaee2c94f7a1f7726e360a6cfb40173bd552bcff.zip
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>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r--include/linux/kvm_host.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index a020fb280540..2714068ee8bc 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -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 +