From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEzNI-000808-0R for qemu-devel@nongnu.org; Thu, 29 Aug 2013 06:22:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEzNE-0000vY-2G for qemu-devel@nongnu.org; Thu, 29 Aug 2013 06:22:47 -0400 Received: from [222.73.24.84] (port=44821 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEzND-0000up-Md for qemu-devel@nongnu.org; Thu, 29 Aug 2013 06:22:43 -0400 From: Hu Tao Date: Thu, 29 Aug 2013 18:21:16 +0800 Message-Id: <1377771676-6883-1-git-send-email-hutao@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] 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 , Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Blue Swirl , Richard Henderson If offset=5Fwithin=5Faddress=5Fspace falls in a page, then we register a subpage. So check offset=5Fwithin=5Faddress=5Fspace rather than offset=5Fwithin=5Fregion. Cc: Paolo Bonzini Cc: Richard Henderson Cc: "Andreas F=C3=A4rber" Cc: Peter Maydell Cc: Blue Swirl Signed-off-by: Hu Tao --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 3ca9381..f1f9151 100644 --- a/exec.c +++ b/exec.c @@ -869,7 +869,7 @@ static void mem=5Fadd(MemoryListener *listener, MemoryR= egionSection *section) now =3D remain; if (int128=5Flt(remain.size, page=5Fsize)) { register=5Fsubpage(d, &now); - } else if (remain.offset=5Fwithin=5Fregion & ~TARGET=5FPAGE=5FMASK= ) { + } else if (remain.offset=5Fwithin=5Faddress=5Fspace & ~TARGET=5FPA= GE=5FMASK) { now.size =3D page=5Fsize; register=5Fsubpage(d, &now); } else { --=20 1.8.1.4 =