From 3489ae0d28630f52ec1f8de7bb5440e2eac2c861 Mon Sep 17 00:00:00 2001 From: Hu Tao Date: Thu, 29 Aug 2013 18:21:16 +0800 Subject: [PATCH] exec: check offset_within_address_space for register subpage MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Cc: Richard Henderson Cc: "Andreas Färber" Cc: Peter Maydell Cc: Blue Swirl Signed-off-by: Hu Tao Signed-off-by: Paolo Bonzini (cherry picked from commit 88266249701032211c1d7449460d063fbc01bf12) Signed-off-by: Michael Roth --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index d9ca4df..f78239f 100644 --- a/exec.c +++ b/exec.c @@ -870,7 +870,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 { -- 2.7.4