From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UecpQ-0007ZR-HU for qemu-devel@nongnu.org; Mon, 20 May 2013 23:01:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UecpO-0000Iq-88 for qemu-devel@nongnu.org; Mon, 20 May 2013 23:01:32 -0400 Received: from [222.73.24.84] (port=53831 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UecpN-0000IX-Ro for qemu-devel@nongnu.org; Mon, 20 May 2013 23:01:30 -0400 From: Qiao Nuohan Date: Tue, 21 May 2013 11:00:21 +0800 Message-Id: <1369105221-26307-1-git-send-email-qiaonuohan@cn.fujitsu.com> Subject: [Qemu-devel] [PATCH] Fix mask of pte index List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, 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. --- target-i386/arch_memory_mapping.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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 pte_start_addr, continue; } - start_vaddr = start_line_addr | ((i & 0x1fff) << 12); + start_vaddr = start_line_addr | ((i & 0x1ff) << 12); memory_mapping_list_add_merge_sorted(list, start_paddr, start_vaddr, 1 << 12); } -- 1.7.1