From patchwork Wed Sep 21 21:21:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 673056 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sfXfM0M1cz9s5g for ; Thu, 22 Sep 2016 07:23:05 +1000 (AEST) Received: from localhost ([::1]:57477 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmoys-0000cW-CT for incoming@patchwork.ozlabs.org; Wed, 21 Sep 2016 17:23:02 -0400 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 To: qemu-devel@nongnu.org Date: Thu, 22 Sep 2016 07:21:58 +1000 X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 63.228.1.57 Subject: [Qemu-devel] [PATCH] Fix tlb_vaddr_to_host with CONFIG_USER_ONLY X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Laurent Vivier --- 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];