From 706b6018c063ca281e7440700a5139eef4efac91 Mon Sep 17 00:00:00 2001
From: Juan Quintela <quintela@redhat.com>
Date: Fri, 4 Feb 2011 12:19:58 -0200
Subject: [RHEL6 qemu-kvm PATCH 22/27] KVM don't care about TLB handling

RH-Author: Juan Quintela <quintela@redhat.com>
Message-id: <f2ba097a9f78b8a448194eb25f9d93cbb0b71c69.1296800499.git.quintela@redhat.com>
Patchwork-id: 17734
O-Subject: [PATCH 3/8] KVM don't care about TLB handling
Bugzilla: 643970
RH-Acked-by: Alex Williamson <alex.williamson@redhat.com>
RH-Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>
RH-Acked-by: Amit Shah <amit.shah@redhat.com>

TLB handling is only used in TCG mode.  It is very costly for guests with lots
of memory ad lots of CPU's.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 exec.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 exec.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/exec.c b/exec.c
index f21faf0..d6c773d 100644
--- a/exec.c
+++ b/exec.c
@@ -1961,6 +1961,9 @@ void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end,
     for(i = 0; i < len; i++)
         p[i] &= mask;
 
+    if (kvm_enabled())
+        return;
+
     /* we modify the TLB cache so that the dirty bit will be set again
        when accessing the range */
     start1 = (unsigned long)qemu_get_ram_ptr(start);
-- 
1.7.3.2

