diff options
author | Zhang Xiantao <xiantao.zhang@intel.com> | 2007-12-13 20:54:20 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:58:10 -0500 |
commit | d69fb81f0554fb980e4b1d3db4e44351c2c4a4a2 (patch) | |
tree | c2b6f6081ceb31fba9c37401f0cc81afaa3b6d1f /drivers/kvm/x86.c | |
parent | 77b4c255af34e73ea1efd1c3384bbe91361c81e6 (diff) |
KVM: Portability: Move memslot aliases to new struct kvm_arch
This patches create kvm_arch to hold arch-specific kvm fileds
and moves fields naliases and aliases to kvm_arch.
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
Acked-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/x86.c')
-rw-r--r-- | drivers/kvm/x86.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c index 60f9722a06ba..7e1bd526bd5c 100644 --- a/drivers/kvm/x86.c +++ b/drivers/kvm/x86.c | |||
@@ -1191,8 +1191,8 @@ gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn) | |||
1191 | int i; | 1191 | int i; |
1192 | struct kvm_mem_alias *alias; | 1192 | struct kvm_mem_alias *alias; |
1193 | 1193 | ||
1194 | for (i = 0; i < kvm->naliases; ++i) { | 1194 | for (i = 0; i < kvm->arch.naliases; ++i) { |
1195 | alias = &kvm->aliases[i]; | 1195 | alias = &kvm->arch.aliases[i]; |
1196 | if (gfn >= alias->base_gfn | 1196 | if (gfn >= alias->base_gfn |
1197 | && gfn < alias->base_gfn + alias->npages) | 1197 | && gfn < alias->base_gfn + alias->npages) |
1198 | return alias->target_gfn + gfn - alias->base_gfn; | 1198 | return alias->target_gfn + gfn - alias->base_gfn; |
@@ -1228,15 +1228,15 @@ static int kvm_vm_ioctl_set_memory_alias(struct kvm *kvm, | |||
1228 | 1228 | ||
1229 | mutex_lock(&kvm->lock); | 1229 | mutex_lock(&kvm->lock); |
1230 | 1230 | ||
1231 | p = &kvm->aliases[alias->slot]; | 1231 | p = &kvm->arch.aliases[alias->slot]; |
1232 | p->base_gfn = alias->guest_phys_addr >> PAGE_SHIFT; | 1232 | p->base_gfn = alias->guest_phys_addr >> PAGE_SHIFT; |
1233 | p->npages = alias->memory_size >> PAGE_SHIFT; | 1233 | p->npages = alias->memory_size >> PAGE_SHIFT; |
1234 | p->target_gfn = alias->target_phys_addr >> PAGE_SHIFT; | 1234 | p->target_gfn = alias->target_phys_addr >> PAGE_SHIFT; |
1235 | 1235 | ||
1236 | for (n = KVM_ALIAS_SLOTS; n > 0; --n) | 1236 | for (n = KVM_ALIAS_SLOTS; n > 0; --n) |
1237 | if (kvm->aliases[n - 1].npages) | 1237 | if (kvm->arch.aliases[n - 1].npages) |
1238 | break; | 1238 | break; |
1239 | kvm->naliases = n; | 1239 | kvm->arch.naliases = n; |
1240 | 1240 | ||
1241 | kvm_mmu_zap_all(kvm); | 1241 | kvm_mmu_zap_all(kvm); |
1242 | 1242 | ||