qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 8/8] exec: fix ram_list dirty map optimization


From: Juan Quintela
Subject: [Qemu-devel] [PATCH 8/8] exec: fix ram_list dirty map optimization
Date: Tue, 4 Feb 2014 16:19:45 +0100

From: Alexey Kardashevskiy <address@hidden>

The ae2810c4bb3b383176e8e1b33931b16c01483aab patch introduced
optimization for ram_list.dirty_memory update. However it can only
work correctly if hpratio is 1 as the @bitmap parameter stores 1 bits
per system page size (may vary, 4K or 64K on PPC64) and
ram_list.dirty_memory stores 1 bit per TARGET_PAGE_SIZE
(which is hardcoded to 4K).

This fixes hpratio!=1 case to fall back to the slow path.

Signed-off-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
 include/exec/ram_addr.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index 481a447..2edfa96 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -93,7 +93,8 @@ static inline void 
cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap,
     unsigned long page = BIT_WORD(start >> TARGET_PAGE_BITS);

     /* start address is aligned at the start of a word? */
-    if (((page * BITS_PER_LONG) << TARGET_PAGE_BITS) == start) {
+    if ((((page * BITS_PER_LONG) << TARGET_PAGE_BITS) == start) &&
+        (hpratio == 1)) {
         long k;
         long nr = BITS_TO_LONGS(pages);

-- 
1.8.5.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]