From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Blue Swirl <blauwirbel@gmail.com>,
Anthony Liguori <aliguori@us.ibm.com>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] target-i386: Mask NX bit from cpu_get_phys_page_debug result
Date: Tue, 06 Mar 2012 14:56:32 +0200 [thread overview]
Message-ID: <4F560980.2060803@redhat.com> (raw)
In-Reply-To: <4F5601BF.3070107@siemens.com>
On 03/06/2012 02:23 PM, Jan Kiszka wrote:
> This was a long pending bug, now revealed by the assert in
> phys_page_find that stumbled over the large page index returned by
> cpu_get_phys_page_debug for NX-marked pages.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>
> Was easily triggerable by attaching gdb to the guest and doing some
> backtraces that reached into stack addresses.
>
> target-i386/helper.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/target-i386/helper.c b/target-i386/helper.c
> index af6bba2..40fe407 100644
> --- a/target-i386/helper.c
> +++ b/target-i386/helper.c
> @@ -947,7 +947,7 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
> }
>
> page_offset = (addr & TARGET_PAGE_MASK) & (page_size - 1);
> - paddr = (pte & TARGET_PAGE_MASK) + page_offset;
> + paddr = (pte & TARGET_PAGE_MASK & ~PG_NX_MASK) + page_offset;
> return paddr;
> }
>
Should we not, in addition, mask the software available bits (53-62 IIRC)?
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-03-06 12:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-06 12:23 [Qemu-devel] [PATCH] target-i386: Mask NX bit from cpu_get_phys_page_debug result Jan Kiszka
2012-03-06 12:56 ` Avi Kivity [this message]
2012-03-06 13:07 ` Avi Kivity
2012-03-06 14:22 ` [Qemu-devel] [PATCH v2] " Jan Kiszka
2012-03-06 14:31 ` Avi Kivity
2012-03-11 16:07 ` Blue Swirl
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=4F560980.2060803@redhat.com \
--to=avi@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=blauwirbel@gmail.com \
--cc=jan.kiszka@siemens.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).