aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/iommu.c
diff options
context:
space:
mode:
Diffstat (limited to 'virt/kvm/iommu.c')
-rw-r--r--virt/kvm/iommu.c4
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,