Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=caa5b8a5ed27708521e0667649699fea202043b2
Commit:     caa5b8a5ed27708521e0667649699fea202043b2
Parent:     ec10f4750db5e810cafef114a592428f8242b640
Author:     Eddie Dong <[EMAIL PROTECTED]>
AuthorDate: Tue Dec 18 06:08:27 2007 +0800
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 18:01:19 2008 +0200

    KVM: MMU: Coalesce remote tlb flushes
    
    Host side TLB flush can be merged together if multiple
    spte need to be write-protected.
    
    Signed-off-by: Yaozu (Eddie) Dong <[EMAIL PROTECTED]>
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 arch/x86/kvm/mmu.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 401eb7c..9a57e1a 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -513,6 +513,7 @@ static void rmap_write_protect(struct kvm *kvm, u64 gfn)
 {
        unsigned long *rmapp;
        u64 *spte;
+       int write_protected = 0;
 
        gfn = unalias_gfn(kvm, gfn);
        rmapp = gfn_to_rmap(kvm, gfn);
@@ -522,11 +523,14 @@ static void rmap_write_protect(struct kvm *kvm, u64 gfn)
                BUG_ON(!spte);
                BUG_ON(!(*spte & PT_PRESENT_MASK));
                rmap_printk("rmap_write_protect: spte %p %llx\n", spte, *spte);
-               if (is_writeble_pte(*spte))
+               if (is_writeble_pte(*spte)) {
                        set_shadow_pte(spte, *spte & ~PT_WRITABLE_MASK);
-               kvm_flush_remote_tlbs(kvm);
+                       write_protected = 1;
+               }
                spte = rmap_next(kvm, rmapp, spte);
        }
+       if (write_protected)
+               kvm_flush_remote_tlbs(kvm);
 }
 
 #ifdef MMU_DEBUG
-
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  http://vger.kernel.org/majordomo-info.html

Reply via email to