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: 9344263 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 488DB607D0 for ; Wed, 21 Sep 2016 21:22:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39F0F2A0AC for ; Wed, 21 Sep 2016 21:22:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CFBB2A449; Wed, 21 Sep 2016 21:22:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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 mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E8EF72A0AC for ; Wed, 21 Sep 2016 21:22:35 +0000 (UTC) Received: from localhost ([::1]:57460 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmoyQ-0008Mv-E6 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Sep 2016 17:22:34 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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];