aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorHu Tao <hutao@cn.fujitsu.com>2013-08-29 18:21:16 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2013-09-05 18:11:37 +0200
commit88266249701032211c1d7449460d063fbc01bf12 (patch)
tree117a640abbe2a15148c54035cf423d44c19dfac3 /exec.c
parent098178f2749a63fbbb1a626dcc7d939d5cb2bde7 (diff)
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 <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>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/exec.c b/exec.c
index b52ec80951..e6f04d82a1 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 {