aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/paging_tmpl.h
diff options
context:
space:
mode:
authorZhang Xiantao <xiantao.zhang@intel.com>2007-12-13 10:50:52 -0500
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:58:09 -0500
commitad312c7c79f781c822e37effe41307503a2bb85b (patch)
treed979bfb70e76ada58b79b456c61a0507a8f0847d /drivers/kvm/paging_tmpl.h
parent682c59a3f3f211ed555b17144f2d82eb8286a1db (diff)
KVM: Portability: Introduce kvm_vcpu_arch
Move all the architecture-specific fields in kvm_vcpu into a new struct kvm_vcpu_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/paging_tmpl.h')
-rw-r--r--drivers/kvm/paging_tmpl.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h
index fb19596c9589..56b88f7e83ef 100644
--- a/drivers/kvm/paging_tmpl.h
+++ b/drivers/kvm/paging_tmpl.h
@@ -129,11 +129,11 @@ static int FNAME(walk_addr)(struct guest_walker *walker,
129 129
130 pgprintk("%s: addr %lx\n", __FUNCTION__, addr); 130 pgprintk("%s: addr %lx\n", __FUNCTION__, addr);
131walk: 131walk:
132 walker->level = vcpu->mmu.root_level; 132 walker->level = vcpu->arch.mmu.root_level;
133 pte = vcpu->cr3; 133 pte = vcpu->arch.cr3;
134#if PTTYPE == 64 134#if PTTYPE == 64
135 if (!is_long_mode(vcpu)) { 135 if (!is_long_mode(vcpu)) {
136 pte = vcpu->pdptrs[(addr >> 30) & 3]; 136 pte = vcpu->arch.pdptrs[(addr >> 30) & 3];
137 if (!is_present_pte(pte)) 137 if (!is_present_pte(pte))
138 goto not_present; 138 goto not_present;
139 --walker->level; 139 --walker->level;
@@ -275,10 +275,10 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
275 if (!is_present_pte(walker->ptes[walker->level - 1])) 275 if (!is_present_pte(walker->ptes[walker->level - 1]))
276 return NULL; 276 return NULL;
277 277
278 shadow_addr = vcpu->mmu.root_hpa; 278 shadow_addr = vcpu->arch.mmu.root_hpa;
279 level = vcpu->mmu.shadow_root_level; 279 level = vcpu->arch.mmu.shadow_root_level;
280 if (level == PT32E_ROOT_LEVEL) { 280 if (level == PT32E_ROOT_LEVEL) {
281 shadow_addr = vcpu->mmu.pae_root[(addr >> 30) & 3]; 281 shadow_addr = vcpu->arch.mmu.pae_root[(addr >> 30) & 3];
282 shadow_addr &= PT64_BASE_ADDR_MASK; 282 shadow_addr &= PT64_BASE_ADDR_MASK;
283 --level; 283 --level;
284 } 284 }
@@ -380,7 +380,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
380 if (!r) { 380 if (!r) {
381 pgprintk("%s: guest page fault\n", __FUNCTION__); 381 pgprintk("%s: guest page fault\n", __FUNCTION__);
382 inject_page_fault(vcpu, addr, walker.error_code); 382 inject_page_fault(vcpu, addr, walker.error_code);
383 vcpu->last_pt_write_count = 0; /* reset fork detector */ 383 vcpu->arch.last_pt_write_count = 0; /* reset fork detector */
384 return 0; 384 return 0;
385 } 385 }
386 386
@@ -390,7 +390,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr,
390 shadow_pte, *shadow_pte, write_pt); 390 shadow_pte, *shadow_pte, write_pt);
391 391
392 if (!write_pt) 392 if (!write_pt)
393 vcpu->last_pt_write_count = 0; /* reset fork detector */ 393 vcpu->arch.last_pt_write_count = 0; /* reset fork detector */
394 394
395 /* 395 /*
396 * mmio: emulate if accessible, otherwise its a guest fault. 396 * mmio: emulate if accessible, otherwise its a guest fault.