Commit:     a25f7e1f8c1ff68213a63dada9d5e32dc1a0f587
Parent:     05e0c8c344dd356b42e81bdf0d47d2b884bf49b5
Author:     Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Mon Apr 30 17:05:38 2007 +0300
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Mon Jul 16 12:05:38 2007 +0300

    KVM: Reduce misfirings of the fork detector
    The kvm mmu tries to detects forks by looking for repeated writes to a
    page table.  If it sees a fork, it unshadows the page table so the page
    table copying can proceed at native speed instead of being emulated.
    However, the detector also triggered on simple demand paging access 
    a linear walk of memory would of course cause repeated writes to the same
    pagetable page, causing it to unshadow prematurely.
    Fix by resetting the fork detector if we detect a demand fault.
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
 drivers/kvm/paging_tmpl.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h
index 73ffbff..bc64cce 100644
--- a/drivers/kvm/paging_tmpl.h
+++ b/drivers/kvm/paging_tmpl.h
@@ -421,6 +421,7 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t 
                pgprintk("%s: guest page fault\n", __FUNCTION__);
                inject_page_fault(vcpu, addr, walker.error_code);
+               vcpu->last_pt_write_count = 0; /* reset fork detector */
                return 0;
@@ -442,6 +443,9 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t 
+       if (!write_pt)
+               vcpu->last_pt_write_count = 0; /* reset fork detector */
         * mmio: emulate if accessible, otherwise its a guest fault.
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to