thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-memory-create-function-to-set-a-single-dirty-bit.patch

0a122b
From 7c7071e191d00c972db07e90eddb40ad9214fe59 Mon Sep 17 00:00:00 2001
0a122b
From: Juan Quintela <quintela@redhat.com>
0a122b
Date: Tue, 14 Jan 2014 15:07:16 +0100
0a122b
Subject: [PATCH 05/40] memory: create function to set a single dirty bit
0a122b
0a122b
RH-Author: Juan Quintela <quintela@redhat.com>
0a122b
Message-id: <1389712071-23303-6-git-send-email-quintela@redhat.com>
0a122b
Patchwork-id: 56657
0a122b
O-Subject: [RHEL7 qemu-kvm PATCH 05/40] memory: create function to set a single dirty bit
0a122b
Bugzilla: 997559
0a122b
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
0a122b
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
0a122b
RH-Acked-by: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>
0a122b
0a122b
Signed-off-by: Juan Quintela <quintela@redhat.com>
0a122b
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
0a122b
Reviewed-by: Eric Blake <eblake@redhat.com>
0a122b
(cherry picked from commit a1390db4df32ad95bf7854944180d2343f7f6368)
0a122b
Signed-off-by: Juan Quintela <quintela@trasno.org>
0a122b
---
0a122b
 cputlb.c                       | 2 +-
0a122b
 include/exec/memory-internal.h | 6 ++++++
0a122b
 2 files changed, 7 insertions(+), 1 deletion(-)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 cputlb.c                       |    2 +-
0a122b
 include/exec/memory-internal.h |    6 ++++++
0a122b
 2 files changed, 7 insertions(+), 1 deletions(-)
0a122b
0a122b
diff --git a/cputlb.c b/cputlb.c
0a122b
index aba7e44..84e83e0 100644
0a122b
--- a/cputlb.c
0a122b
+++ b/cputlb.c
0a122b
@@ -137,7 +137,7 @@ void tlb_protect_code(ram_addr_t ram_addr)
0a122b
 void tlb_unprotect_code_phys(CPUArchState *env, ram_addr_t ram_addr,
0a122b
                              target_ulong vaddr)
0a122b
 {
0a122b
-    cpu_physical_memory_set_dirty_flags(ram_addr, CODE_DIRTY_FLAG);
0a122b
+    cpu_physical_memory_set_dirty_flag(ram_addr, CODE_DIRTY_FLAG);
0a122b
 }
0a122b
 
0a122b
 static bool tlb_is_dirty_ram(CPUTLBEntry *tlbe)
0a122b
diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h
0a122b
index eac149a..4f476d2 100644
0a122b
--- a/include/exec/memory-internal.h
0a122b
+++ b/include/exec/memory-internal.h
0a122b
@@ -85,6 +85,12 @@ static inline void cpu_physical_memory_set_dirty_flags(ram_addr_t addr,
0a122b
     ram_list.phys_dirty[addr >> TARGET_PAGE_BITS] |= dirty_flags;
0a122b
 }
0a122b
 
0a122b
+static inline void cpu_physical_memory_set_dirty_flag(ram_addr_t addr,
0a122b
+                                                      int dirty_flag)
0a122b
+{
0a122b
+    ram_list.phys_dirty[addr >> TARGET_PAGE_BITS] |= dirty_flag;
0a122b
+}
0a122b
+
0a122b
 static inline void cpu_physical_memory_set_dirty(ram_addr_t addr)
0a122b
 {
0a122b
     cpu_physical_memory_set_dirty_flags(addr, 0xff);
0a122b
-- 
0a122b
1.7.1
0a122b