From: andrzej zaborowski <balrogg@gmail.com>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] x86: clear NX bit from address in cpu_get_phys_page_debug
Date: Fri, 13 Feb 2009 06:41:34 +0100 [thread overview]
Message-ID: <fb249edb0902122141j793ab9baja9e740a1673fa8f5@mail.gmail.com> (raw)
All bits outside of PHYS_ADDR_MASK are zeroed in
cpu_x86_handle_mmu_fault to produce the physical address, but not in
cpu_get_phys_page_debug. The return value of
cpu_get_phys_page_debug() is directly added to phys_ram_base by users
so if the NX bit was set in the PTE, qemu will try to access outside
phys_ram_base.
(This is my interpretation of the error but I'm no expert on x86)
Cheers
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1274,7 +1274,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 & PHYS_ADDR_MASK) + page_offset;
return paddr;
}
reply other threads:[~2009-02-13 5:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=fb249edb0902122141j793ab9baja9e740a1673fa8f5@mail.gmail.com \
--to=balrogg@gmail.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).