From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KV5GG-0006DB-S0 for qemu-devel@nongnu.org; Mon, 18 Aug 2008 09:59:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KV5GE-0006CW-5r for qemu-devel@nongnu.org; Mon, 18 Aug 2008 09:59:07 -0400 Received: from [199.232.76.173] (port=34013 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KV5GD-0006C8-Vk for qemu-devel@nongnu.org; Mon, 18 Aug 2008 09:59:06 -0400 Received: from mail-gx0-f19.google.com ([209.85.217.19]:54460) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KV5GD-0006IM-ES for qemu-devel@nongnu.org; Mon, 18 Aug 2008 09:59:05 -0400 Received: by gxk12 with SMTP id 12so3487239gxk.10 for ; Mon, 18 Aug 2008 06:59:04 -0700 (PDT) Message-ID: <48A97FFC.3010002@codemonkey.ws> Date: Mon, 18 Aug 2008 08:58:20 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [RESEND #3][PATCH] i386: Catch all non-present ptes in cpu_get_phys_page_debug References: <484BED67.7080007@web.de> <4869D210.80904@web.de> <4879F854.8070809@web.de> <48A9200E.4070104@web.de> In-Reply-To: <48A9200E.4070104@web.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Jan Kiszka wrote: > It helps debugging guests when yet unmapped pages are correctly reported > as, well, unmapped. > > Signed-off-by: Jan Kiszka > --- > target-i386/helper.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > Index: b/target-i386/helper.c > =================================================================== > --- a/target-i386/helper.c > +++ b/target-i386/helper.c > @@ -1192,6 +1192,8 @@ target_phys_addr_t cpu_get_phys_page_deb > page_size = 4096; > pte = ldq_phys(pte_addr); > } > + if (!(pte & PG_PRESENT_MASK)) > + return -1; > } else { > uint32_t pde; > > @@ -1211,10 +1213,10 @@ target_phys_addr_t cpu_get_phys_page_deb > /* page directory entry */ > pte_addr = ((pde & ~0xfff) + ((addr >> 10) & 0xffc)) & env->a20_mask; > pte = ldl_phys(pte_addr); > - if (!(pte & PG_PRESENT_MASK)) > - return -1; > page_size = 4096; > } > + if (!(pte & PG_PRESENT_MASK)) > + return -1; > } > This looks redundant. In the PSE=1 case, the check for pde & PG_PRESENT_MASK takes care of it. In the PSE=0 clause, there is already a check for pte & PG_PRESENT_MASK. The first chunk looks like a genuine fix though. Regards, Anthony Liguori > pte = pte & env->a20_mask; > } > > >