From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmoy9-0008Iv-Jv for qemu-devel@nongnu.org; Wed, 21 Sep 2016 17:22:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmoy3-00084l-Ux for qemu-devel@nongnu.org; Wed, 21 Sep 2016 17:22:16 -0400 Received: from gate.crashing.org ([63.228.1.57]:40728) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmoy1-00082t-6B for qemu-devel@nongnu.org; Wed, 21 Sep 2016 17:22:11 -0400 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id u8LLLx5V015420 for ; Wed, 21 Sep 2016 16:22:03 -0500 Message-ID: <1474492918.2857.129.camel@kernel.crashing.org> From: Benjamin Herrenschmidt Date: Thu, 22 Sep 2016 07:21:58 +1000 Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] Fix tlb_vaddr_to_host with CONFIG_USER_ONLY List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org We use the wrong argument name for the g2h() macro ! The result ends up being something like (target_ulong)(uint64) + guest_base which is obviously wrong. Signed-off-by: Benjamin Herrenschmidt --- 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 b573df5..6eb5fe8 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -401,7 +401,7 @@ static inline void *tlb_vaddr_to_host(CPUArchState *env, target_ulong addr, int access_type, int mmu_idx) { #if defined(CONFIG_USER_ONLY) - return g2h(vaddr); + return g2h(addr); #else int index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1); CPUTLBEntry *tlbentry = &env->tlb_table[mmu_idx][index];