Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202383
b: refs/heads/master
c: 95c87e2
h: refs/heads/master
i:
  202381: 24223ea
  202379: 27f70de
  202375: 32c5797
  202367: bb55bde
v: v3
  • Loading branch information
Sheng Yang authored and Avi Kivity committed Aug 1, 2010
1 parent d73853c commit 6100da8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fef093bec0364ff5e6fd488cd81637f6bb3a2d0d
refs/heads/master: 95c87e2b4460a488ec7ce42f273893e410ab385a
8 changes: 6 additions & 2 deletions trunk/virt/kvm/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,18 @@ int kvm_iommu_map_pages(struct kvm *kvm, struct kvm_memory_slot *slot)

static int kvm_iommu_map_memslots(struct kvm *kvm)
{
int i, r = 0;
int i, idx, r = 0;
struct kvm_memslots *slots;

idx = srcu_read_lock(&kvm->srcu);
slots = kvm_memslots(kvm);

for (i = 0; i < slots->nmemslots; i++) {
r = kvm_iommu_map_pages(kvm, &slots->memslots[i]);
if (r)
break;
}
srcu_read_unlock(&kvm->srcu, idx);

return r;
}
Expand Down Expand Up @@ -285,15 +287,17 @@ static void kvm_iommu_put_pages(struct kvm *kvm,

static int kvm_iommu_unmap_memslots(struct kvm *kvm)
{
int i;
int i, idx;
struct kvm_memslots *slots;

idx = srcu_read_lock(&kvm->srcu);
slots = kvm_memslots(kvm);

for (i = 0; i < slots->nmemslots; i++) {
kvm_iommu_put_pages(kvm, slots->memslots[i].base_gfn,
slots->memslots[i].npages);
}
srcu_read_unlock(&kvm->srcu, idx);

return 0;
}
Expand Down

0 comments on commit 6100da8

Please sign in to comment.