diff options
author | Zhang Xiantao <xiantao.zhang@intel.com> | 2007-12-13 21:20:16 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:58:10 -0500 |
commit | bfc6d222bdb1123d12c1193bcd7c755e6617b405 (patch) | |
tree | 72fb596179845648c3a050669f6f8ab16a834d3b /drivers/kvm/vmx.c | |
parent | d7deeeb02cf73fd98cb71a6a0a5dffab9ef79556 (diff) |
KVM: Portability: Move round_robin_prev_vcpu and tss_addr to kvm_arch
This patches moves two fields round_robin_prev_vcpu and tss 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/vmx.c')
-rw-r--r-- | drivers/kvm/vmx.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index d0f431d4fe4d..7e61a560aab5 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -1143,12 +1143,12 @@ static void enter_pmode(struct kvm_vcpu *vcpu) | |||
1143 | 1143 | ||
1144 | static gva_t rmode_tss_base(struct kvm *kvm) | 1144 | static gva_t rmode_tss_base(struct kvm *kvm) |
1145 | { | 1145 | { |
1146 | if (!kvm->tss_addr) { | 1146 | if (!kvm->arch.tss_addr) { |
1147 | gfn_t base_gfn = kvm->memslots[0].base_gfn + | 1147 | gfn_t base_gfn = kvm->memslots[0].base_gfn + |
1148 | kvm->memslots[0].npages - 3; | 1148 | kvm->memslots[0].npages - 3; |
1149 | return base_gfn << PAGE_SHIFT; | 1149 | return base_gfn << PAGE_SHIFT; |
1150 | } | 1150 | } |
1151 | return kvm->tss_addr; | 1151 | return kvm->arch.tss_addr; |
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | static void fix_rmode_seg(int seg, struct kvm_save_segment *save) | 1154 | static void fix_rmode_seg(int seg, struct kvm_save_segment *save) |
@@ -1473,7 +1473,7 @@ static int alloc_apic_access_page(struct kvm *kvm) | |||
1473 | int r = 0; | 1473 | int r = 0; |
1474 | 1474 | ||
1475 | mutex_lock(&kvm->lock); | 1475 | mutex_lock(&kvm->lock); |
1476 | if (kvm->apic_access_page) | 1476 | if (kvm->arch.apic_access_page) |
1477 | goto out; | 1477 | goto out; |
1478 | kvm_userspace_mem.slot = APIC_ACCESS_PAGE_PRIVATE_MEMSLOT; | 1478 | kvm_userspace_mem.slot = APIC_ACCESS_PAGE_PRIVATE_MEMSLOT; |
1479 | kvm_userspace_mem.flags = 0; | 1479 | kvm_userspace_mem.flags = 0; |
@@ -1482,7 +1482,7 @@ static int alloc_apic_access_page(struct kvm *kvm) | |||
1482 | r = __kvm_set_memory_region(kvm, &kvm_userspace_mem, 0); | 1482 | r = __kvm_set_memory_region(kvm, &kvm_userspace_mem, 0); |
1483 | if (r) | 1483 | if (r) |
1484 | goto out; | 1484 | goto out; |
1485 | kvm->apic_access_page = gfn_to_page(kvm, 0xfee00); | 1485 | kvm->arch.apic_access_page = gfn_to_page(kvm, 0xfee00); |
1486 | out: | 1486 | out: |
1487 | mutex_unlock(&kvm->lock); | 1487 | mutex_unlock(&kvm->lock); |
1488 | return r; | 1488 | return r; |
@@ -1699,7 +1699,7 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu) | |||
1699 | 1699 | ||
1700 | if (vm_need_virtualize_apic_accesses(vmx->vcpu.kvm)) | 1700 | if (vm_need_virtualize_apic_accesses(vmx->vcpu.kvm)) |
1701 | vmcs_write64(APIC_ACCESS_ADDR, | 1701 | vmcs_write64(APIC_ACCESS_ADDR, |
1702 | page_to_phys(vmx->vcpu.kvm->apic_access_page)); | 1702 | page_to_phys(vmx->vcpu.kvm->arch.apic_access_page)); |
1703 | 1703 | ||
1704 | vmx->vcpu.arch.cr0 = 0x60000010; | 1704 | vmx->vcpu.arch.cr0 = 0x60000010; |
1705 | vmx_set_cr0(&vmx->vcpu, vmx->vcpu.arch.cr0); /* enter rmode */ | 1705 | vmx_set_cr0(&vmx->vcpu, vmx->vcpu.arch.cr0); /* enter rmode */ |
@@ -1789,7 +1789,7 @@ static int vmx_set_tss_addr(struct kvm *kvm, unsigned int addr) | |||
1789 | ret = kvm_set_memory_region(kvm, &tss_mem, 0); | 1789 | ret = kvm_set_memory_region(kvm, &tss_mem, 0); |
1790 | if (ret) | 1790 | if (ret) |
1791 | return ret; | 1791 | return ret; |
1792 | kvm->tss_addr = addr; | 1792 | kvm->arch.tss_addr = addr; |
1793 | return 0; | 1793 | return 0; |
1794 | } | 1794 | } |
1795 | 1795 | ||