repository: /home/avi/kvm/linux-2.6 branch: rmap-corruption-fix commit 1f2bd2b86ea44b78321591002b844499ea12a0c7 Author: Avi Kivity <[EMAIL PROTECTED]> Date: Thu Oct 11 12:57:30 2007 +0200
KVM: MMU: Different roles for clean and dirty huge pages A clean large page will not have writable mappings; while a clean one may. (WIP, broken) Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index 4ab487c..68e0ecf 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h @@ -102,7 +102,8 @@ struct kvm_pte_chain { * bits 4:7 - page table level for this shadow (1-4) * bits 8:9 - page table quadrant for 2-level guests * bit 16 - "metaphysical" - gfn is not a real page (huge page/real mode) - * bits 17:19 - "access" - the user, writable, and nx bits of a huge page pde + * bits 17:19 - "access" - the user, writable, nx, and dirty bits of a + * huge page pde */ union kvm_mmu_page_role { unsigned word; @@ -112,7 +113,8 @@ union kvm_mmu_page_role { unsigned quadrant : 2; unsigned pad_for_nice_hex_output : 6; unsigned metaphysical : 1; - unsigned hugepage_access : 3; + unsigned more_padding : 3; + unsigned hugepage_access : 4; }; }; diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index 8bbfe16..59bff63 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c @@ -902,7 +902,8 @@ static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, hpa_t p) >> PAGE_SHIFT; new_table = kvm_mmu_get_page(vcpu, pseudo_gfn, v, level - 1, - 1, 0, &table[index]); + 1, 0xb, + &table[index]); if (!new_table) { pgprintk("nonpaging_map: ENOMEM\n"); return -ENOMEM; diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h index 8d152e8..ff45425 100644 --- a/drivers/kvm/paging_tmpl.h +++ b/drivers/kvm/paging_tmpl.h @@ -385,6 +385,8 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, if (walker->pte & PT64_NX_MASK) hugepage_access |= (1 << 2); hugepage_access >>= PT_WRITABLE_SHIFT; + if (is_dirty_pte(walker->pte)) + hugepage_access |= (1 << 3); table_gfn = (walker->pte & PT_BASE_ADDR_MASK) >> PAGE_SHIFT; } else { ------------------------------------------------------------------------- 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