qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] x86: clear NX bit from address in cpu_get_phys_page_debug
@ 2009-02-13  5:41 andrzej zaborowski
  0 siblings, 0 replies; only message in thread
From: andrzej zaborowski @ 2009-02-13  5:41 UTC (permalink / raw)
  To: qemu-devel@nongnu.org

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;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-13  5:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-13  5:41 [Qemu-devel] [PATCH] x86: clear NX bit from address in cpu_get_phys_page_debug andrzej zaborowski

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).