From patchwork Mon Jul 2 15:10:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 10501911 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 CB96360325 for ; Mon, 2 Jul 2018 15:28:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCFD127FB3 for ; Mon, 2 Jul 2018 15:28:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B127828C99; Mon, 2 Jul 2018 15:28:57 +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=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 595BB27FB3 for ; Mon, 2 Jul 2018 15:28:57 +0000 (UTC) Received: from localhost ([::1]:33544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa0l6-0001eW-Ji for patchwork-qemu-devel@patchwork.kernel.org; Mon, 02 Jul 2018 11:28:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fa0UD-0004Sm-Fp for qemu-devel@nongnu.org; Mon, 02 Jul 2018 11:11:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fa0U8-0008Dw-Cu for qemu-devel@nongnu.org; Mon, 02 Jul 2018 11:11:29 -0400 Received: from mail-pl0-x22a.google.com ([2607:f8b0:400e:c01::22a]:34288) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fa0U8-0008DK-6r for qemu-devel@nongnu.org; Mon, 02 Jul 2018 11:11:24 -0400 Received: by mail-pl0-x22a.google.com with SMTP id z9-v6so8098975plo.1 for ; Mon, 02 Jul 2018 08:11:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NfAVGhkiKG5LOSRz+0cX59oYyiQyF8X1AP8p2lZ3qxA=; b=Uf2xHVj3MI6W5u/5O/QamrcdkdSwB05YQZad7+QkpegOi9xNcUptWcELDGWlxvR48B 7AAes/zbYlTlr+896FBSx4F8GJyVA7tDpDM80cHaI1+q8YCzA/Nm1tSRUC4N2TJHwxOz gFJwmHNvtuHF9zKeXV5yY8MJffx4OP5KdSn/Xd4GJ4DcV94yqDL9FRH+dwq7R23h0h9r RVn7VG8JExGxCmkYsM35wNix/bB4AGwoIzPUhcHcuPMp+wKQeGK6TDM+W72UgyVQQYJ/ s2xJgynb77b4DDdbLxd4Sj8HSMmL6Up9xBNWO5END9EdjRrAWvMSSAmS0ZfGorrhdczj u/iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NfAVGhkiKG5LOSRz+0cX59oYyiQyF8X1AP8p2lZ3qxA=; b=Op6lcViZXbIP4/pJxyaLHWcmgOYaPcIlFksulfjjr2bDzsqqSIhK3wvqRFMgs+Q6o6 Pz1FRPuafl2s/uVP6zTTD4VmFTCu4CBUaIdrVbzZ+rXKRM/ipDL5uNu+a3Ej8qc1tU/H VLPDql8akfQqU+gNZE7mi7BAOAATylP+sLUFU/WIuXKGQunoYYGKPZbz4vtWgOsDfOQ1 6Z98iTHU+p3RVQYzVf65tPZzEtA28lV0F4p59AzYniTzmRxZOEI8AhgdyiwHXdAzug02 E2nPgh547rOt7ZjMY5CZRX/tlyZieELTxnNvoGwURFsngz7A+C1jwTsgo+iEu2WFzov/ 39Jw== X-Gm-Message-State: APt69E2dwZfVJ8HnGv2YDN4ri8WNll28mRSVRaYJTnd0mK7rA9bED1aH yjDd03BSFscpMZBsjA1AvIchlRCh X-Google-Smtp-Source: ADUXVKI0a5er0CHMH5CutADl7J+nahHLJcvo4XllUwr1fZqOoERUHDwrurXxWCpjuTLIK/JAz0E+rw== X-Received: by 2002:a17:902:6845:: with SMTP id f5-v6mr25982059pln.173.1530544283387; Mon, 02 Jul 2018 08:11:23 -0700 (PDT) Received: from localhost (g90.124-44-6.ppp.wakwak.ne.jp. [124.44.6.90]) by smtp.gmail.com with ESMTPSA id 125-v6sm8001766pgj.46.2018.07.02.08.11.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Jul 2018 08:11:22 -0700 (PDT) From: Stafford Horne To: Peter Maydell Date: Tue, 3 Jul 2018 00:10:16 +0900 Message-Id: <20180702151023.24532-19-shorne@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180702151023.24532-1-shorne@gmail.com> References: <20180702151023.24532-1-shorne@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::22a Subject: [Qemu-devel] [PULL v2 18/25] target/openrisc: Stub out handle_mmu_fault for softmmu 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: , Cc: Stafford Horne , Richard Henderson , QEMU Development Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Richard Henderson This hook is only used by CONFIG_USER_ONLY. Signed-off-by: Richard Henderson Signed-off-by: Stafford Horne --- target/openrisc/mmu.c | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/target/openrisc/mmu.c b/target/openrisc/mmu.c index a4613e9ae4..f4c0a3e217 100644 --- a/target/openrisc/mmu.c +++ b/target/openrisc/mmu.c @@ -177,42 +177,17 @@ static void cpu_openrisc_raise_mmu_exception(OpenRISCCPU *cpu, cpu->env.lock_addr = -1; } -#ifndef CONFIG_USER_ONLY int openrisc_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int size, int rw, int mmu_idx) { +#ifdef CONFIG_USER_ONLY OpenRISCCPU *cpu = OPENRISC_CPU(cs); - int ret = 0; - hwaddr physical = 0; - int prot = 0; - - ret = get_phys_addr(cpu, &physical, &prot, address, rw); - - if (ret == TLBRET_MATCH) { - tlb_set_page(cs, address & TARGET_PAGE_MASK, - physical & TARGET_PAGE_MASK, prot, - mmu_idx, TARGET_PAGE_SIZE); - ret = 0; - } else if (ret < 0) { - cpu_openrisc_raise_mmu_exception(cpu, address, rw, ret); - ret = 1; - } - - return ret; -} + cpu_openrisc_raise_mmu_exception(cpu, address, rw, 0); + return 1; #else -int openrisc_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int size, - int rw, int mmu_idx) -{ - OpenRISCCPU *cpu = OPENRISC_CPU(cs); - int ret = 0; - - cpu_openrisc_raise_mmu_exception(cpu, address, rw, ret); - ret = 1; - - return ret; -} + g_assert_not_reached(); #endif +} #ifndef CONFIG_USER_ONLY hwaddr openrisc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)