From: Hu Tao Date: Thu, 29 Aug 2013 10:21:16 +0000 (+0800) Subject: exec: check offset_within_address_space for register subpage X-Git-Tag: qemu-xen-4.4.0-rc1~1^2~25 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1110014801d368388bca2ed7c28aa695560c4991;p=qemu-upstream-4.6-testing.git exec: check offset_within_address_space for register subpage 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 --- diff --git a/exec.c b/exec.c index 08eecb35e..f6674e5bf 100644 --- a/exec.c +++ b/exec.c @@ -869,7 +869,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 {