From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KDZaU-0004lm-96 for qemu-devel@nongnu.org; Tue, 01 Jul 2008 02:43:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KDZaS-0004k6-1D for qemu-devel@nongnu.org; Tue, 01 Jul 2008 02:43:37 -0400 Received: from [199.232.76.173] (port=38214 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KDZaR-0004k3-Pe for qemu-devel@nongnu.org; Tue, 01 Jul 2008 02:43:35 -0400 Received: from mx20.gnu.org ([199.232.41.8]:27696) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KDZaR-0005G3-HY for qemu-devel@nongnu.org; Tue, 01 Jul 2008 02:43:35 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KDZaN-0006FO-Fz for qemu-devel@nongnu.org; Tue, 01 Jul 2008 02:43:31 -0400 Received: from smtp06.web.de (fmsmtp06.dlan.cinetic.de [172.20.5.172]) by fmmailgate03.web.de (Postfix) with ESMTP id 13B96E1E36CC for ; Tue, 1 Jul 2008 08:43:29 +0200 (CEST) Received: from [88.64.25.246] (helo=[192.168.1.198]) by smtp06.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.109 #226) id 1KDZaK-0003z2-00 for qemu-devel@nongnu.org; Tue, 01 Jul 2008 08:43:28 +0200 Message-ID: <4869D210.80904@web.de> Date: Tue, 01 Jul 2008 08:43:28 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <484BED67.7080007@web.de> In-Reply-To: <484BED67.7080007@web.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@web.de Subject: [Qemu-devel] [RESEND][PATCH] i386: Catch all non-present ptes in cpu_get_phys_page_debug 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 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; } pte = pte & env->a20_mask; }