From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUmeV-0001em-8Q for qemu-devel@nongnu.org; Tue, 02 Aug 2016 23:15:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUmeR-0007TC-2A for qemu-devel@nongnu.org; Tue, 02 Aug 2016 23:15:26 -0400 Received: from gate.crashing.org ([63.228.1.57]:51502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUmeQ-0007T8-Mw for qemu-devel@nongnu.org; Tue, 02 Aug 2016 23:15:22 -0400 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id u733FKCW020149 for ; Tue, 2 Aug 2016 22:15:21 -0500 Message-ID: <1470194119.12584.43.camel@kernel.crashing.org> From: Benjamin Herrenschmidt Date: Wed, 03 Aug 2016 13:15:19 +1000 Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 2/2] Fix g2h() for 32-bit targets on 64-bit hosts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The current constructs ends up cropping the host address to 32-bit which crashes for me running 32-bit ppc programs on an x86_64. Signed-off-by: Benjamin Herrenschmidt --- Not sure who to CC for this... include/exec/cpu_ldst.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index 6eb5fe8..0164535 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -49,7 +49,7 @@ #if defined(CONFIG_USER_ONLY) /* All direct uses of g2h and h2g need to go away for usermode softmmu. */ -#define g2h(x) ((void *)((unsigned long)(target_ulong)(x) + guest_base)) +#define g2h(x) ((void *)(guest_base + (unsigned long)(target_ulong)(x))) #if HOST_LONG_BITS <= TARGET_VIRT_ADDR_SPACE_BITS #define h2g_valid(x) 1