diff options
author | Sheng Yang <sheng.yang@intel.com> | 2008-09-01 07:41:20 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-10-15 04:15:25 -0400 |
commit | d40a1ee4859c673677c9811ae84475c4051baca5 (patch) | |
tree | deedab33a187c41b23db799bd610af0508820cd4 /arch/x86/kvm/paging_tmpl.h | |
parent | 8c4b537da7eceab1246695df21beea10f180d460 (diff) |
KVM: MMU: Modify kvm_shadow_walk.entry to accept u64 addr
EPT is 4 level by default in 32pae(48 bits), but the addr parameter
of kvm_shadow_walk->entry() only accept unsigned long as virtual
address, which is 32bit in 32pae. This result in SHADOW_PT_INDEX()
overflow when try to fetch level 4 index.
Fix it by extend kvm_shadow_walk->entry() to accept 64bit addr in
parameter.
Signed-off-by: Sheng Yang <sheng.yang@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/paging_tmpl.h')
-rw-r--r-- | arch/x86/kvm/paging_tmpl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index b7064e1e1e17..b671f61be41e 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h | |||
@@ -286,7 +286,7 @@ static void FNAME(update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *page, | |||
286 | * Fetch a shadow pte for a specific level in the paging hierarchy. | 286 | * Fetch a shadow pte for a specific level in the paging hierarchy. |
287 | */ | 287 | */ |
288 | static int FNAME(shadow_walk_entry)(struct kvm_shadow_walk *_sw, | 288 | static int FNAME(shadow_walk_entry)(struct kvm_shadow_walk *_sw, |
289 | struct kvm_vcpu *vcpu, gva_t addr, | 289 | struct kvm_vcpu *vcpu, u64 addr, |
290 | u64 *sptep, int level) | 290 | u64 *sptep, int level) |
291 | { | 291 | { |
292 | struct shadow_walker *sw = | 292 | struct shadow_walker *sw = |
@@ -326,7 +326,7 @@ static int FNAME(shadow_walk_entry)(struct kvm_shadow_walk *_sw, | |||
326 | metaphysical = 0; | 326 | metaphysical = 0; |
327 | table_gfn = gw->table_gfn[level - 2]; | 327 | table_gfn = gw->table_gfn[level - 2]; |
328 | } | 328 | } |
329 | shadow_page = kvm_mmu_get_page(vcpu, table_gfn, addr, level-1, | 329 | shadow_page = kvm_mmu_get_page(vcpu, table_gfn, (gva_t)addr, level-1, |
330 | metaphysical, access, sptep); | 330 | metaphysical, access, sptep); |
331 | if (!metaphysical) { | 331 | if (!metaphysical) { |
332 | r = kvm_read_guest_atomic(vcpu->kvm, gw->pte_gpa[level - 2], | 332 | r = kvm_read_guest_atomic(vcpu->kvm, gw->pte_gpa[level - 2], |