qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target-i386: Mask NX bit from cpu_get_phys_page_debug result
@ 2012-03-06 12:23 Jan Kiszka
  2012-03-06 12:56 ` Avi Kivity
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2012-03-06 12:23 UTC (permalink / raw)
  To: qemu-devel, Anthony Liguori, Blue Swirl; +Cc: Avi Kivity

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-11 16:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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