From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K5LwL-0004B8-5q for qemu-devel@nongnu.org; Sun, 08 Jun 2008 10:32:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K5LwI-000488-Pk for qemu-devel@nongnu.org; Sun, 08 Jun 2008 10:32:11 -0400 Received: from [199.232.76.173] (port=33736 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K5LwI-00047v-KS for qemu-devel@nongnu.org; Sun, 08 Jun 2008 10:32:10 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:49779) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K5LwI-0002S2-GZ for qemu-devel@nongnu.org; Sun, 08 Jun 2008 10:32:10 -0400 Received: from smtp07.web.de (fmsmtp07.dlan.cinetic.de [172.20.5.215]) by fmmailgate03.web.de (Postfix) with ESMTP id 69186DF0F880 for ; Sun, 8 Jun 2008 16:32:08 +0200 (CEST) Received: from [88.64.22.242] (helo=[192.168.1.198]) by smtp07.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.109 #226) id 1K5LwG-0006hw-00 for qemu-devel@nongnu.org; Sun, 08 Jun 2008 16:32:08 +0200 Message-ID: <484BED67.7080007@web.de> Date: Sun, 08 Jun 2008 16:32:07 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@web.de Subject: [Qemu-devel] [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 [ Caused some hair pulling here, until I realized that some supposedly corrupted page was not the bug I'm looking for, but a bug in the debug code. ] 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 @@ -1174,6 +1174,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; @@ -1193,10 +1195,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; }