From: Jan Kiszka <jan.kiszka@web.de>
To: qemu-devel@nongnu.org
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 [thread overview]
Message-ID: <48A99A30.5040708@web.de> (raw)
In-Reply-To: <48A97FFC.3010002@codemonkey.ws>
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 <jan.kiszka@web.de>
>> ---
>> 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 <jan.kiszka@web.de>
---
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;
next prev parent reply other threads:[~2008-08-18 15:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-08 14:32 [Qemu-devel] [PATCH] i386: Catch all non-present ptes in cpu_get_phys_page_debug Jan Kiszka
2008-07-01 6:43 ` [Qemu-devel] [RESEND][PATCH] " Jan Kiszka
2008-07-13 12:43 ` [Qemu-devel] [RESEND #2][PATCH] " Jan Kiszka
2008-08-18 7:09 ` [Qemu-devel] [RESEND #3][PATCH] " Jan Kiszka
2008-08-18 13:58 ` Anthony Liguori
2008-08-18 15:50 ` Jan Kiszka [this message]
2008-08-18 18:00 ` [Qemu-devel] " Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48A99A30.5040708@web.de \
--to=jan.kiszka@web.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.