diff options
author | Feng(Eric) Liu <eric.e.liu@intel.com> | 2008-01-22 18:01:08 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-22 12:05:21 +0200 |
commit | 29ae41a859a12aa71baacd35a9648511f335848e (patch) | |
tree | 23846e4e1a565760aa41d873ec6d9087e30076a2 | |
parent | 67704e250e558f937c25fa44b6dd0e4fb9f12341 (diff) |
KVM: MMU: Fix gpa truncation when reading a ptekvm-60
Since the type of gpa is u64, so extend pte_size to u64.
Otherwise, gpa may be truncated to u32.
Signed-off-by: Feng (Eric) Liu <eric.e.liu@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r-- | arch/x86/kvm/mmu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index cb62ef65d0bd..c85b90492743 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -1477,7 +1477,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa, if ((gpa & (pte_size - 1)) || (bytes < pte_size)) { gentry = 0; r = kvm_read_guest_atomic(vcpu->kvm, - gpa & ~(pte_size - 1), + gpa & ~(u64)(pte_size - 1), &gentry, pte_size); new = (const void *)&gentry; if (r < 0) |