Patchwork exec-obsolete: fix length handling

login
register
mail settings
Submitter Blue Swirl
Date Jan. 29, 2012, 1:17 p.m.
Message ID <CAAu8pHsTPqyU2Wpo5O7x0zhF9O10O-86F4y2s5uufhNfvmCdxw@mail.gmail.com>
Download mbox | patch
Permalink /patch/138436/
State New
Headers show

Comments

Blue Swirl - Jan. 29, 2012, 1:17 p.m.
Fix suspend/resume broken by off-by-one error in
59abb06198ee9471e29c970f294eae80c0b39be1, based on patch by
Stefan Berger.

Reported-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 exec-obsolete.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

 }
@@ -101,7 +101,7 @@ static inline void
cpu_physical_memory_mask_dirty_range(ram_addr_t start,
     end = start + length;
     mask = ~dirty_flags;
     p = ram_list.phys_dirty + (start >> TARGET_PAGE_BITS);
-    for (addr = start; addr <= end; addr += TARGET_PAGE_SIZE) {
+    for (addr = start; addr < end; addr += TARGET_PAGE_SIZE) {
         *p++ &= mask;
     }
 }

Patch

From bd2cf8f212fe5b683f24c978f8844e93efab2aca Mon Sep 17 00:00:00 2001
Message-Id: <bd2cf8f212fe5b683f24c978f8844e93efab2aca.1327842793.git.blauwirbel@gmail.com>
From: Blue Swirl <blauwirbel@gmail.com>
Date: Sat, 28 Jan 2012 18:02:08 +0000
Subject: [PATCH] exec-obsolete: fix length handling

Fix suspend/resume broken by off-by-one error in
59abb06198ee9471e29c970f294eae80c0b39be1, based on patch by
Stefan Berger.

Reported-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 exec-obsolete.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/exec-obsolete.h b/exec-obsolete.h
index 03cf35e..5a1e468 100644
--- a/exec-obsolete.h
+++ b/exec-obsolete.h
@@ -85,7 +85,7 @@  static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start,
 
     end = start + length;
     p = ram_list.phys_dirty + (start >> TARGET_PAGE_BITS);
-    for (addr = start; addr <= end; addr += TARGET_PAGE_SIZE) {
+    for (addr = start; addr < end; addr += TARGET_PAGE_SIZE) {
         *p++ |= dirty_flags;
     }
 }
@@ -101,7 +101,7 @@  static inline void cpu_physical_memory_mask_dirty_range(ram_addr_t start,
     end = start + length;
     mask = ~dirty_flags;
     p = ram_list.phys_dirty + (start >> TARGET_PAGE_BITS);
-    for (addr = start; addr <= end; addr += TARGET_PAGE_SIZE) {
+    for (addr = start; addr < end; addr += TARGET_PAGE_SIZE) {
         *p++ &= mask;
     }
 }
-- 
1.7.2.5