From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KUyrV-0007Iv-TO for qemu-devel@nongnu.org; Mon, 18 Aug 2008 03:09:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KUyrT-0007HX-VI for qemu-devel@nongnu.org; Mon, 18 Aug 2008 03:09:09 -0400 Received: from [199.232.76.173] (port=54453 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KUyrT-0007HG-Nu for qemu-devel@nongnu.org; Mon, 18 Aug 2008 03:09:07 -0400 Received: from mx20.gnu.org ([199.232.41.8]:44250) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KUyrT-00072h-Ke for qemu-devel@nongnu.org; Mon, 18 Aug 2008 03:09:07 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KUyrS-0002h0-AQ for qemu-devel@nongnu.org; Mon, 18 Aug 2008 03:09:06 -0400 Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate01.web.de (Postfix) with ESMTP id 06741EB5584D for ; Mon, 18 Aug 2008 09:09:05 +0200 (CEST) Received: from [88.65.45.230] (helo=[192.168.1.198]) by smtp05.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.109 #226) id 1KUyrP-00011x-00 for qemu-devel@nongnu.org; Mon, 18 Aug 2008 09:09:03 +0200 Message-ID: <48A9200E.4070104@web.de> Date: Mon, 18 Aug 2008 09:09:02 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <484BED67.7080007@web.de> <4869D210.80904@web.de> <4879F854.8070809@web.de> In-Reply-To: <4879F854.8070809@web.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@web.de Subject: [Qemu-devel] [RESEND #3][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; }