From 3f2cbf0d1a1340bed4a63e05b044c46df93f4768 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Tue, 6 Mar 2012 15:22:02 +0100 Subject: target-i386: Mask NX bit from cpu_get_phys_page_debug result 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: We need to mask out NX and all user-definable bits 52..62 from PDEs and the final PTE to avoid corrupting physical addresses. Reviewed-by: Avi Kivity Signed-off-by: Jan Kiszka Signed-off-by: Blue Swirl --- target-i386/cpu.h | 1 + 1 file changed, 1 insertion(+) (limited to 'target-i386/cpu.h') diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 196b0c5c40..36e3d29ea0 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -241,6 +241,7 @@ #define PG_DIRTY_MASK (1 << PG_DIRTY_BIT) #define PG_PSE_MASK (1 << PG_PSE_BIT) #define PG_GLOBAL_MASK (1 << PG_GLOBAL_BIT) +#define PG_HI_USER_MASK 0x7ff0000000000000LL #define PG_NX_MASK (1LL << PG_NX_BIT) #define PG_ERROR_W_BIT 1 -- cgit v1.2.3