summaryrefslogtreecommitdiff
path: root/target-i386/helper2.c
diff options
context:
space:
mode:
Diffstat (limited to 'target-i386/helper2.c')
-rw-r--r--target-i386/helper2.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/target-i386/helper2.c b/target-i386/helper2.c
index 106720aa7..6cf218fa0 100644
--- a/target-i386/helper2.c
+++ b/target-i386/helper2.c
@@ -800,8 +800,17 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
#else
-/* Bits 52-62 of a PTE are reserved. Bit 63 is the NX bit. */
-#define PHYS_ADDR_MASK 0xffffffffff000L
+/* XXX: This value should match the one returned by CPUID
+ * and in exec.c */
+#if defined(USE_KQEMU)
+#define PHYS_ADDR_MASK 0xfffff000L
+#else
+# if defined(TARGET_X86_64)
+# define PHYS_ADDR_MASK 0xfffffff000L
+# else
+# define PHYS_ADDR_MASK 0xffffff000L
+# endif
+#endif
/* return value:
-1 = cannot handle fault