qemu-devel
[Top][All Lists]
Advanced

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

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


From: Jan Kiszka
Subject: [Qemu-devel] Re: [RESEND #3][PATCH] i386: Catch all non-present ptes in cpu_get_phys_page_debug
Date: Mon, 18 Aug 2008 17:50:08 +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

Anthony Liguori wrote:
> 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.

True.

> 
> The first chunk looks like a genuine fix though.

Here is the stripped-down version:

-----------

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;
 




reply via email to

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