From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uefs0-0000Yc-8C for qemu-devel@nongnu.org; Tue, 21 May 2013 02:16:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uefrz-0007Ss-6h for qemu-devel@nongnu.org; Tue, 21 May 2013 02:16:24 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:36671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uefrz-0007SJ-2Y for qemu-devel@nongnu.org; Tue, 21 May 2013 02:16:23 -0400 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 21 May 2013 02:16:18 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 91ECF38C8045 for ; Tue, 21 May 2013 02:16:15 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r4L6GGk7278288 for ; Tue, 21 May 2013 02:16:16 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r4L6GFwd011865 for ; Tue, 21 May 2013 03:16:15 -0300 Message-ID: <519B112E.7040100@linux.vnet.ibm.com> Date: Tue, 21 May 2013 01:16:14 -0500 From: Jesse Larrew MIME-Version: 1.0 References: <1369105221-26307-1-git-send-email-qiaonuohan@cn.fujitsu.com> In-Reply-To: <1369105221-26307-1-git-send-email-qiaonuohan@cn.fujitsu.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Fix mask of pte index List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Qiao Nuohan Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org On 05/20/2013 10:00 PM, Qiao Nuohan wrote: > 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); > } > Verified that this agrees with the spec for IA-32e/PAE paging. Note that walk_pte2() is correct; only walk_pte() has the typo. Reviewed by: Jesse Larrew Jesse Larrew Software Engineer, KVM Team IBM Linux Technology Center Phone: (512) 973-2052 (T/L: 363-2052) jlarrew@linux.vnet.ibm.com