Patchwork [PULL,2/5] exec: check offset_within_address_space for register subpage

login
register
mail settings
Submitter Paolo Bonzini
Date Sept. 5, 2013, 5:17 p.m.
Message ID <1378401455-583-3-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/272915/
State New
Headers show

Comments

Paolo Bonzini - Sept. 5, 2013, 5:17 p.m.
From: Hu Tao <hutao@cn.fujitsu.com>

If offset_within_address_space falls in a page, then we register a
subpage. So check offset_within_address_space rather than
offset_within_region.

Cc: qemu-stable@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: "Andreas Färber" <afaerber@suse.de>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 exec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/exec.c b/exec.c
index b52ec80..e6f04d8 100644
--- a/exec.c
+++ b/exec.c
@@ -854,7 +854,7 @@  static void mem_add(MemoryListener *listener, MemoryRegionSection *section)
         now = remain;
         if (int128_lt(remain.size, page_size)) {
             register_subpage(d, &now);
-        } else if (remain.offset_within_region & ~TARGET_PAGE_MASK) {
+        } else if (remain.offset_within_address_space & ~TARGET_PAGE_MASK) {
             now.size = page_size;
             register_subpage(d, &now);
         } else {