Received: from eggs.gnu.org ([208.118.235.92]:33345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui4Sg-0000xr-Cz for qemu-devel@nongnu.org; Thu, 30 May 2013 11:08:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ui4SY-0000Xy-Q1 for qemu-devel@nongnu.org; Thu, 30 May 2013 11:08:18 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44002 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui4SY-0000Xk-JO for qemu-devel@nongnu.org; Thu, 30 May 2013 11:08:10 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 30 May 2013 17:07:54 +0200 Message-Id: <1369926481-20720-3-git-send-email-afaerber@suse.de> In-Reply-To: <1369926481-20720-1-git-send-email-afaerber@suse.de> References: <1369926481-20720-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 v3 2/9] 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, qiaonuohan@cn.fujitsu.com, =?UTF-8?q?Andreas=20F=C3=A4rber?= , lcapitulino@redhat.com 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