aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r--virt/kvm/kvm_main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 659bc12ad16a..2b7cd6c0d9ca 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -429,7 +429,7 @@ static struct kvm *kvm_create_vm(void)
429 kvm_eventfd_init(kvm); 429 kvm_eventfd_init(kvm);
430 mutex_init(&kvm->lock); 430 mutex_init(&kvm->lock);
431 mutex_init(&kvm->irq_lock); 431 mutex_init(&kvm->irq_lock);
432 init_rwsem(&kvm->slots_lock); 432 mutex_init(&kvm->slots_lock);
433 atomic_set(&kvm->users_count, 1); 433 atomic_set(&kvm->users_count, 1);
434 spin_lock(&kvm_lock); 434 spin_lock(&kvm_lock);
435 list_add(&kvm->vm_list, &vm_list); 435 list_add(&kvm->vm_list, &vm_list);
@@ -763,9 +763,9 @@ int kvm_set_memory_region(struct kvm *kvm,
763{ 763{
764 int r; 764 int r;
765 765
766 down_write(&kvm->slots_lock); 766 mutex_lock(&kvm->slots_lock);
767 r = __kvm_set_memory_region(kvm, mem, user_alloc); 767 r = __kvm_set_memory_region(kvm, mem, user_alloc);
768 up_write(&kvm->slots_lock); 768 mutex_unlock(&kvm->slots_lock);
769 return r; 769 return r;
770} 770}
771EXPORT_SYMBOL_GPL(kvm_set_memory_region); 771EXPORT_SYMBOL_GPL(kvm_set_memory_region);
@@ -1997,7 +1997,7 @@ int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
1997 return -EOPNOTSUPP; 1997 return -EOPNOTSUPP;
1998} 1998}
1999 1999
2000/* Caller must have write lock on slots_lock. */ 2000/* Caller must hold slots_lock. */
2001int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, 2001int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx,
2002 struct kvm_io_device *dev) 2002 struct kvm_io_device *dev)
2003{ 2003{
@@ -2019,7 +2019,7 @@ int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx,
2019 return 0; 2019 return 0;
2020} 2020}
2021 2021
2022/* Caller must have write lock on slots_lock. */ 2022/* Caller must hold slots_lock. */
2023int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, 2023int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx,
2024 struct kvm_io_device *dev) 2024 struct kvm_io_device *dev)
2025{ 2025{