qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RESEND #3][PATCH] i386: Catch all non-present ptes in cpu_


From: Jan Kiszka
Subject: [Qemu-devel] [RESEND #3][PATCH] i386: Catch all non-present ptes in cpu_get_phys_page_debug
Date: Mon, 18 Aug 2008 09:09:02 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

It helps debugging guests when yet unmapped pages are correctly reported
as, well, unmapped.

Signed-off-by: Jan Kiszka <address@hidden>
---
 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;
     }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]