From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHdBo-0001VS-1o for qemu-devel@nongnu.org; Thu, 05 Sep 2013 13:17:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHdBi-0000wc-Pi for qemu-devel@nongnu.org; Thu, 05 Sep 2013 13:17:51 -0400 Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 5 Sep 2013 19:17:32 +0200 Message-Id: <1378401455-583-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1378401455-583-1-git-send-email-pbonzini@redhat.com> References: <1378401455-583-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PULL 2/5] exec: check offset_within_address_space for register subpage List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Hu Tao , qemu-stable@nongnu.org, Blue Swirl , anthony@codemonkey.ws, =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson From: Hu Tao 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 --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { -- 1.8.3.1