diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2009-12-23 11:35:21 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 10:35:44 -0500 |
commit | bc6678a33d9b952981a8e44a4f876c3ad64ca4d8 (patch) | |
tree | e26027179eb0d76f234509145a395dd6e5910074 /virt/kvm/iommu.c | |
parent | 3ad26d8139a82b0510b1e0435ee82ae461d33401 (diff) |
KVM: introduce kvm->srcu and convert kvm_set_memory_region to SRCU update
Use two steps for memslot deletion: mark the slot invalid (which stops
instantiation of new shadow pages for that slot, but allows destruction),
then instantiate the new empty slot.
Also simplifies kvm_handle_hva locking.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm/iommu.c')
-rw-r--r-- | virt/kvm/iommu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c index cf567d8033db..65a51432c8e5 100644 --- a/virt/kvm/iommu.c +++ b/virt/kvm/iommu.c | |||
@@ -78,7 +78,7 @@ static int kvm_iommu_map_memslots(struct kvm *kvm) | |||
78 | int i, r = 0; | 78 | int i, r = 0; |
79 | struct kvm_memslots *slots; | 79 | struct kvm_memslots *slots; |
80 | 80 | ||
81 | slots = kvm->memslots; | 81 | slots = rcu_dereference(kvm->memslots); |
82 | 82 | ||
83 | for (i = 0; i < slots->nmemslots; i++) { | 83 | for (i = 0; i < slots->nmemslots; i++) { |
84 | r = kvm_iommu_map_pages(kvm, &slots->memslots[i]); | 84 | r = kvm_iommu_map_pages(kvm, &slots->memslots[i]); |
@@ -214,7 +214,7 @@ static int kvm_iommu_unmap_memslots(struct kvm *kvm) | |||
214 | int i; | 214 | int i; |
215 | struct kvm_memslots *slots; | 215 | struct kvm_memslots *slots; |
216 | 216 | ||
217 | slots = kvm->memslots; | 217 | slots = rcu_dereference(kvm->memslots); |
218 | 218 | ||
219 | for (i = 0; i < slots->nmemslots; i++) { | 219 | for (i = 0; i < slots->nmemslots; i++) { |
220 | kvm_iommu_put_pages(kvm, slots->memslots[i].base_gfn, | 220 | kvm_iommu_put_pages(kvm, slots->memslots[i].base_gfn, |