From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4tQk-0007p4-5w for qemu-devel@nongnu.org; Tue, 06 Mar 2012 07:24:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S4tQU-0004hi-Ju for qemu-devel@nongnu.org; Tue, 06 Mar 2012 07:23:49 -0500 Received: from thoth.sbs.de ([192.35.17.2]:27158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4tQU-0004hO-9b for qemu-devel@nongnu.org; Tue, 06 Mar 2012 07:23:34 -0500 Message-ID: <4F5601BF.3070107@siemens.com> Date: Tue, 06 Mar 2012 13:23:27 +0100 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] target-i386: Mask NX bit from cpu_get_phys_page_debug result List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 --- 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