qemu-devel
[Top][All Lists]
Advanced

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

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


From: Anthony Liguori
Subject: Re: [Qemu-devel] [RESEND #3][PATCH] i386: Catch all non-present ptes in cpu_get_phys_page_debug
Date: Mon, 18 Aug 2008 08:58:20 -0500
User-agent: Thunderbird 2.0.0.16 (X11/20080723)

Jan Kiszka wrote:
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;
         }

This looks redundant. In the PSE=1 case, the check for pde & PG_PRESENT_MASK takes care of it. In the PSE=0 clause, there is already a check for pte & PG_PRESENT_MASK.

The first chunk looks like a genuine fix though.

Regards,

Anthony Liguori

         pte = pte & env->a20_mask;
     }







reply via email to

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