From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KI0ut-0001OU-NQ for qemu-devel@nongnu.org; Sun, 13 Jul 2008 08:43:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KI0us-0001Nu-Be for qemu-devel@nongnu.org; Sun, 13 Jul 2008 08:43:03 -0400 Received: from [199.232.76.173] (port=37740 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KI0us-0001Np-2T for qemu-devel@nongnu.org; Sun, 13 Jul 2008 08:43:02 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:37112) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KI0us-0003j5-CX for qemu-devel@nongnu.org; Sun, 13 Jul 2008 08:43:02 -0400 Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate02.web.de (Postfix) with ESMTP id C3376E59D014 for ; Sun, 13 Jul 2008 14:43:00 +0200 (CEST) Received: from [88.64.30.223] (helo=[192.168.1.198]) by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.109 #226) id 1KI0uq-0007YZ-00 for qemu-devel@nongnu.org; Sun, 13 Jul 2008 14:43:00 +0200 Message-ID: <4879F854.8070809@web.de> Date: Sun, 13 Jul 2008 14:43:00 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <484BED67.7080007@web.de> <4869D210.80904@web.de> In-Reply-To: <4869D210.80904@web.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@web.de Subject: [Qemu-devel] [RESEND #2][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; }