aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kvm
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2009-12-23 11:35:16 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2010-03-01 10:35:43 -0500
commit46a26bf55714c1e2f17e34683292a389acb8e601 (patch)
tree3df70225ce6a076d7e4be604a5d72465383043ee /arch/ia64/kvm
parent2044892d4a005a78796c92fd1aef4633be896698 (diff)
KVM: modify memslots layout in struct kvm
Have a pointer to an allocated region inside struct kvm. [alex: fix ppc book 3s] Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/ia64/kvm')
-rw-r--r--arch/ia64/kvm/kvm-ia64.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c
index 5fdeec5fddcf..1ca1dbf48117 100644
--- a/arch/ia64/kvm/kvm-ia64.c
+++ b/arch/ia64/kvm/kvm-ia64.c
@@ -1377,12 +1377,14 @@ static void free_kvm(struct kvm *kvm)
1377 1377
1378static void kvm_release_vm_pages(struct kvm *kvm) 1378static void kvm_release_vm_pages(struct kvm *kvm)
1379{ 1379{
1380 struct kvm_memslots *slots;
1380 struct kvm_memory_slot *memslot; 1381 struct kvm_memory_slot *memslot;
1381 int i, j; 1382 int i, j;
1382 unsigned long base_gfn; 1383 unsigned long base_gfn;
1383 1384
1384 for (i = 0; i < kvm->nmemslots; i++) { 1385 slots = kvm->memslots;
1385 memslot = &kvm->memslots[i]; 1386 for (i = 0; i < slots->nmemslots; i++) {
1387 memslot = &slots->memslots[i];
1386 base_gfn = memslot->base_gfn; 1388 base_gfn = memslot->base_gfn;
1387 1389
1388 for (j = 0; j < memslot->npages; j++) { 1390 for (j = 0; j < memslot->npages; j++) {
@@ -1802,7 +1804,7 @@ static int kvm_ia64_sync_dirty_log(struct kvm *kvm,
1802 if (log->slot >= KVM_MEMORY_SLOTS) 1804 if (log->slot >= KVM_MEMORY_SLOTS)
1803 goto out; 1805 goto out;
1804 1806
1805 memslot = &kvm->memslots[log->slot]; 1807 memslot = &kvm->memslots->memslots[log->slot];
1806 r = -ENOENT; 1808 r = -ENOENT;
1807 if (!memslot->dirty_bitmap) 1809 if (!memslot->dirty_bitmap)
1808 goto out; 1810 goto out;
@@ -1840,7 +1842,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
1840 /* If nothing is dirty, don't bother messing with page tables. */ 1842 /* If nothing is dirty, don't bother messing with page tables. */
1841 if (is_dirty) { 1843 if (is_dirty) {
1842 kvm_flush_remote_tlbs(kvm); 1844 kvm_flush_remote_tlbs(kvm);
1843 memslot = &kvm->memslots[log->slot]; 1845 memslot = &kvm->memslots->memslots[log->slot];
1844 n = ALIGN(memslot->npages, BITS_PER_LONG) / 8; 1846 n = ALIGN(memslot->npages, BITS_PER_LONG) / 8;
1845 memset(memslot->dirty_bitmap, 0, n); 1847 memset(memslot->dirty_bitmap, 0, n);
1846 } 1848 }