From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhLT2-0001x2-JW for qemu-devel@nongnu.org; Tue, 28 May 2013 11:05:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhLSx-0007fz-PF for qemu-devel@nongnu.org; Tue, 28 May 2013 11:05:40 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44351 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhLSx-0007fO-Iv for qemu-devel@nongnu.org; Tue, 28 May 2013 11:05:35 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 28 May 2013 17:05:20 +0200 Message-Id: <1369753526-7020-2-git-send-email-afaerber@suse.de> In-Reply-To: <1369753526-7020-1-git-send-email-afaerber@suse.de> References: <1369753526-7020-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH qom-cpu v2 1/7] target-i386: Fix mask of pte index in memory mapping List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, Qiao Nuohan , =?UTF-8?q?Andreas=20F=C3=A4rber?= From: Qiao Nuohan Function walk_pte() needs pte index to calculate virtual address. However, pte index of PAE paging or IA-32e paging is 9 bit, so the mask should be 0x1ff. Signed-off-by: Qiao Nuohan Reviewed-by: Jesse Larrew Signed-off-by: Andreas F=C3=A4rber --- target-i386/arch_memory_mapping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-i386/arch_memory_mapping.c b/target-i386/arch_memory_= mapping.c index 844893f..a2eb7e7 100644 --- a/target-i386/arch_memory_mapping.c +++ b/target-i386/arch_memory_mapping.c @@ -38,7 +38,7 @@ static void walk_pte(MemoryMappingList *list, hwaddr pt= e_start_addr, continue; } =20 - start_vaddr =3D start_line_addr | ((i & 0x1fff) << 12); + start_vaddr =3D start_line_addr | ((i & 0x1ff) << 12); memory_mapping_list_add_merge_sorted(list, start_paddr, start_vaddr, 1 << 12); } --=20 1.8.1.4