repository: /home/avi/kvm/linux-2.6 branch: master commit bb1d1fee77d97efba72dccec85d857378e3abea5 Author: Avi Kivity <[EMAIL PROTECTED]> Date: Thu Oct 18 17:35:57 2007 +0200
KVM: MMU: Fix dirty bit pte gpa calculation The host physical address has no business in there. Noticed by Izik Eidus. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index f274ae9..0f0266a 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h @@ -151,23 +151,19 @@ static int FNAME(walk_addr)(struct guest_walker *walker, --walker->level; kvm_release_page(page); } - kvm_release_page(page); if (write_fault && !is_dirty_pte(pte)) { - hpa_t hpa; - mark_page_dirty(vcpu->kvm, table_gfn); pte |= PT_DIRTY_MASK; table = kmap_atomic(page, KM_USER0); table[index] = pte; kunmap_atomic(table, KM_USER0); - hpa = gpa_to_hpa(vcpu->kvm, pte & PT64_BASE_ADDR_MASK); - pte_gpa = hpa + index * sizeof(pt_element_t); + pte_gpa = table_gfn << PAGE_SHIFT; + pte_gpa += index * sizeof(pt_element_t); kvm_mmu_pte_write(vcpu, pte_gpa, (u8 *)&pte, sizeof(pte)); - kvm_release_page(pfn_to_page((hpa & PT64_BASE_ADDR_MASK) - >> PAGE_SHIFT)); } + kvm_release_page(page); walker->pte = pte; pgprintk("%s: pte %llx\n", __FUNCTION__, (u64)pte); return 1; ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ kvm-commits mailing list kvm-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-commits