peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame 0024-exec-check-offset_within_address_space-for-register-.patch

298366
From 1110014801d368388bca2ed7c28aa695560c4991 Mon Sep 17 00:00:00 2001
298366
From: Hu Tao <hutao@cn.fujitsu.com>
298366
Date: Thu, 29 Aug 2013 18:21:16 +0800
298366
Subject: [PATCH] exec: check offset_within_address_space for register subpage
298366
MIME-Version: 1.0
298366
Content-Type: text/plain; charset=UTF-8
298366
Content-Transfer-Encoding: 8bit
298366
298366
If offset_within_address_space falls in a page, then we register a
298366
subpage. So check offset_within_address_space rather than
298366
offset_within_region.
298366
298366
Cc: qemu-stable@nongnu.org
298366
Cc: Paolo Bonzini <pbonzini@redhat.com>
298366
Cc: Richard Henderson <rth@twiddle.net>
298366
Cc: "Andreas Färber" <afaerber@suse.de>
298366
Cc: Peter Maydell <peter.maydell@linaro.org>
298366
Cc: Blue Swirl <blauwirbel@gmail.com>
298366
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
298366
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
298366
(cherry picked from commit 88266249701032211c1d7449460d063fbc01bf12)
298366
298366
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
298366
---
298366
 exec.c | 2 +-
298366
 1 file changed, 1 insertion(+), 1 deletion(-)
298366
298366
diff --git a/exec.c b/exec.c
298366
index 08eecb3..f6674e5 100644
298366
--- a/exec.c
298366
+++ b/exec.c
298366
@@ -869,7 +869,7 @@ static void mem_add(MemoryListener *listener, MemoryRegionSection *section)
298366
         now = remain;
298366
         if (int128_lt(remain.size, page_size)) {
298366
             register_subpage(d, &now;;
298366
-        } else if (remain.offset_within_region & ~TARGET_PAGE_MASK) {
298366
+        } else if (remain.offset_within_address_space & ~TARGET_PAGE_MASK) {
298366
             now.size = page_size;
298366
             register_subpage(d, &now;;
298366
         } else {