From patchwork Tue Nov 2 11:07:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 516661 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp4419294iml; Tue, 2 Nov 2021 04:36:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTv4DHIhOndkgf3EwPNAvueKN+oNsU2CBoJpUt0oRKQbP/EQRhJgPddhJx8jYy0Aoom6Lp X-Received: by 2002:a9d:de1:: with SMTP id 88mr13558269ots.286.1635852997325; Tue, 02 Nov 2021 04:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635852997; cv=none; d=google.com; s=arc-20160816; b=HKqThp0DO0YDripGjdrBL+rUzTiNffiS8gVp8ARpPKFoCS1Kx+JftvmVj5EiwWcAQC FK0GsykpoHqfgrlxRC+klgphmObDJJF/ybt0CZLYK6kfMF0Cc6si0cEQkZUNa6ZOY1Jr CHMmYbBXt3BU1DvImzuZSgqGzDMvth+QGyPGtEVTUjRQb68eEdwAEWL/CFFvWnH6kE6u DNFQpTBpi4fOsaXMz4twK33hYaHXVRP67O/MbRGHa9CxiWnsavKpTs+dvK9utDRBFTUT RJiBYDEA/ebXETPXQzgZ7eeOamHwmBApEdc/UK4kCHD0wlVVPLxCF5fNwuth8GUl5TPl 8afw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=OFBASZgYo/dnEXgBhwjQsgVMikt4qFVfoC5aZFh8E0o=; b=TLiQbTkgvlosjB9VjC1joqAv6DAPvwInnyaeWf11X0rUJzgYBydB3ixS8IXIf7TwXh oUUssWvaRF0l3RTnX5BvML2G28a22Kl4b8TAwvKcjzs9iZLdyciTOQZr6avLJ3yZ2/Yw f5ouxTrFW68Pt4wQhEojde4LbLeqOBxIkpLJo5IRWz1dbBLhc7DuT8sdF4GLkW3Yiuxo m64x0jv9jfyazHaPZrADq5rlXpDc38qNmL/21F9ZJ+83WRhLb/dym3m97mPO5g5yw4/g RHqWK7uTOKnFfr+G8LRGYGi3dpvkmuco7b5MJ4dwDozn2i0v3LIC15au92mHzmsFfI/u kQ6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RspD3Pxt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o83si17558096oig.138.2021.11.02.04.36.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Nov 2021 04:36:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RspD3Pxt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhs5k-00019R-Lc for patch@linaro.org; Tue, 02 Nov 2021 07:36:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhreJ-00042c-B3 for qemu-devel@nongnu.org; Tue, 02 Nov 2021 07:08:15 -0400 Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]:47035) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mhreE-0000y7-6v for qemu-devel@nongnu.org; Tue, 02 Nov 2021 07:08:15 -0400 Received: by mail-qt1-x834.google.com with SMTP id s1so17058386qta.13 for ; Tue, 02 Nov 2021 04:08:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OFBASZgYo/dnEXgBhwjQsgVMikt4qFVfoC5aZFh8E0o=; b=RspD3Pxth3eGJHiFoziZyuA2hRtEnZ118TfuUQX67JE+8vb4q1k3lnZeWRx5P/7Djg NFUsA4hOC8C1EIdHz10qFWzADBB4GLOTiJkR8H4CHJjoGtEVghBfdo5uivt8XVk5O3IS K+JgjqX6sy3hcuPnxyQJmZT1AiIypGUpwu7QqcUiDijXPwtFksBeFAOHf/tBrwfEkFLC bbjGoXUFhDqnLSsI1HV7p49HIhXvfbaVV2leHeO0NHOrrmmbeKy2qSVORYX3gdmE3GhW WRizh9U7dkJp2hRKeCF/51vbtMPuRko/IgOLTQnJPK0ArIjtB2QNDalquMNq7NqozrVn FLuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OFBASZgYo/dnEXgBhwjQsgVMikt4qFVfoC5aZFh8E0o=; b=NRQWvSlSOjrMdnTa8FFtAgYDbu4aJXHpGJrWxgDWuh2o4jqMScH6mAa3X6tJh7y/Ku QsfHwgFObqYcxA+X1muttrunm/mKoVOoKVgOj73hYzgi+NUrfGYkvfEDwYYbcJJoABTg GlHy8ZizS+bABUQ7B2An1M8Pjp+j7EgfGJjZRUUkTH6gNFIv3txqCV3UFXr1wVxurbhd ZCiWB4p/InKOzc3dPLHcXR1p+eC8VZzIyOQqcWQybnIpOPxtp2V1FHOZ9+XID3wwEOvM AurfS9HFVMHucNtgC/qFjPkYcBoK2EqIRjnBFSZu7P8PuklzrZAEYxgvzKz1cNfefSzw cKuw== X-Gm-Message-State: AOAM532iUs8A6k3KpMM6HrTJRYv6kkjf1k6YW2O61a0ZjvQhNhuN3Bd2 wvkqvzy1gR3qCt1wFIbOV8HsJz2IcwLfeQ== X-Received: by 2002:ac8:5744:: with SMTP id 4mr36840046qtx.289.1635851284563; Tue, 02 Nov 2021 04:08:04 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-57.nyc.biz.rr.com. [172.254.253.57]) by smtp.gmail.com with ESMTPSA id bm7sm3568612qkb.86.2021.11.02.04.08.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 04:08:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 39/60] target/sparc: Make sparc_cpu_tlb_fill sysemu only Date: Tue, 2 Nov 2021 07:07:19 -0400 Message-Id: <20211102110740.215699-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211102110740.215699-1-richard.henderson@linaro.org> References: <20211102110740.215699-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::834; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x834.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Cave-Ayland , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The fallback code in cpu_loop_exit_sigsegv is sufficient for sparc linux-user. This makes all of the code in mmu_helper.c sysemu only, so remove the ifdefs and move the file to sparc_softmmu_ss. Remove the code from cpu_loop that handled TT_DFAULT and TT_TFAULT. Cc: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 25 ------------------------- target/sparc/cpu.c | 2 +- target/sparc/mmu_helper.c | 25 ------------------------- target/sparc/meson.build | 2 +- 4 files changed, 2 insertions(+), 52 deletions(-) -- 2.25.1 diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index ad29b4eb6a..0ba65e431c 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -219,17 +219,6 @@ void cpu_loop (CPUSPARCState *env) case TT_WIN_UNF: /* window underflow */ restore_window(env); break; - case TT_TFAULT: - case TT_DFAULT: - { - info.si_signo = TARGET_SIGSEGV; - info.si_errno = 0; - /* XXX: check env->error_code */ - info.si_code = TARGET_SEGV_MAPERR; - info._sifields._sigfault._addr = env->mmuregs[4]; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - } - break; #else case TT_SPILL: /* window overflow */ save_window(env); @@ -237,20 +226,6 @@ void cpu_loop (CPUSPARCState *env) case TT_FILL: /* window underflow */ restore_window(env); break; - case TT_TFAULT: - case TT_DFAULT: - { - info.si_signo = TARGET_SIGSEGV; - info.si_errno = 0; - /* XXX: check env->error_code */ - info.si_code = TARGET_SEGV_MAPERR; - if (trapnr == TT_DFAULT) - info._sifields._sigfault._addr = env->dmmu.mmuregs[4]; - else - info._sifields._sigfault._addr = cpu_tsptr(env)->tpc; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - } - break; #ifndef TARGET_ABI32 case 0x16e: flush_windows(env); diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 21dd27796d..55268ed2a1 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -865,9 +865,9 @@ static const struct SysemuCPUOps sparc_sysemu_ops = { static const struct TCGCPUOps sparc_tcg_ops = { .initialize = sparc_tcg_init, .synchronize_from_tb = sparc_cpu_synchronize_from_tb, - .tlb_fill = sparc_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .tlb_fill = sparc_cpu_tlb_fill, .cpu_exec_interrupt = sparc_cpu_exec_interrupt, .do_interrupt = sparc_cpu_do_interrupt, .do_transaction_failed = sparc_cpu_do_transaction_failed, diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index a44473a1c7..2ad47391d0 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -25,30 +25,6 @@ /* Sparc MMU emulation */ -#if defined(CONFIG_USER_ONLY) - -bool sparc_cpu_tlb_fill(CPUState *cs, vaddr address, int size, - MMUAccessType access_type, int mmu_idx, - bool probe, uintptr_t retaddr) -{ - SPARCCPU *cpu = SPARC_CPU(cs); - CPUSPARCState *env = &cpu->env; - - if (access_type == MMU_INST_FETCH) { - cs->exception_index = TT_TFAULT; - } else { - cs->exception_index = TT_DFAULT; -#ifdef TARGET_SPARC64 - env->dmmu.mmuregs[4] = address; -#else - env->mmuregs[4] = address; -#endif - } - cpu_loop_exit_restore(cs, retaddr); -} - -#else - #ifndef TARGET_SPARC64 /* * Sparc V8 Reference MMU (SRMMU) @@ -926,4 +902,3 @@ hwaddr sparc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) } return phys_addr; } -#endif diff --git a/target/sparc/meson.build b/target/sparc/meson.build index a3638b9503..a801802ee2 100644 --- a/target/sparc/meson.build +++ b/target/sparc/meson.build @@ -6,7 +6,6 @@ sparc_ss.add(files( 'gdbstub.c', 'helper.c', 'ldst_helper.c', - 'mmu_helper.c', 'translate.c', 'win_helper.c', )) @@ -16,6 +15,7 @@ sparc_ss.add(when: 'TARGET_SPARC64', if_true: files('int64_helper.c', 'vis_helpe sparc_softmmu_ss = ss.source_set() sparc_softmmu_ss.add(files( 'machine.c', + 'mmu_helper.c', 'monitor.c', ))