From patchwork Thu Apr 21 15:16:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 564374 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp560011map; Thu, 21 Apr 2022 08:55:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVQRIJ4nHQ1+dqqfZmSKubgy6OuhHF/anHn5xGBnvpUwjUFfLN7+W0D6e83m62XMKPzRnC X-Received: by 2002:a25:d84e:0:b0:645:8124:bcba with SMTP id p75-20020a25d84e000000b006458124bcbamr281098ybg.491.1650556536445; Thu, 21 Apr 2022 08:55:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650556536; cv=none; d=google.com; s=arc-20160816; b=usTVV186xriiJK8u8Ob6vj/tOYDqVcVHFxhDEZ/6AFHDRsNzb3oE1I1Zvex940t+jf tTOLnzZYw0A6ecesRtKk/XUMICpWFRXNH2cdBpFr6CcOSAyPtlbZHwFHgoAZ+jCEiEns PHrtZsrdS1TqosmlRRLSjkJYFaK+SpH+0G7yJ6MBWqcRir5sLhdmgDZy7WgM128tVSfk oC8ghL626F/BPkDT97WU8Gl3BW3xu0hBiq/2Vb4e91NJgpmi4/rrcdH1dtsV/lDsvrFY NYZy1QzDvbKsMqm+OsY4a+SszMXNXsjKjPbHcSXgggQlOxtbWTb3zu4yJR4Ndti3WHi+ VLtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=mRXh6kle+5JC3fg5GhdP1NKq046Rc6qP/+3/3QkWOfw=; b=HULjQl7fkggoEIIv+2wd2PrJ0X9rimQh0//6/YUmROLyrFozSXBY6sZLMQF13gKiS2 VhNGQmbA+nIOh8t+/59Y53Ngvci7ABflx63CvSEJdwtRxtaLiZioSifE4SazU6B3fgT6 GMao9oI1VbyULoEdTbPx0HpijfWejT4fa7KyXk2v6VQgx165J5tnb9+Bk7iQ0PY2R2Xu szMTiC5h4eXLaprj7tMVg81Vt7vXG+L9SR8ZCRpsKIKYT9kw7jfYFwoKH1NuUPxCwfLN WlbDyCnmGIr+0lJvd62Tx1+My9Q6kFNTYnsMFQpTjCX8Tw/FCxbhuID7c1BUH3IL+s5c k4RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tdnXFdBy; 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 p63-20020a819842000000b002ec2b428f53si2444649ywg.552.2022.04.21.08.55.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Apr 2022 08:55:36 -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=tdnXFdBy; 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]:59500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhZ9b-0005YZ-RY for patch@linaro.org; Thu, 21 Apr 2022 11:55:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYZA-00074e-Fa for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:17:56 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:43919) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhYZ8-0006Eq-Pu for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:17:56 -0400 Received: by mail-pf1-x432.google.com with SMTP id y14so4517670pfe.10 for ; Thu, 21 Apr 2022 08:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=mRXh6kle+5JC3fg5GhdP1NKq046Rc6qP/+3/3QkWOfw=; b=tdnXFdByOKfeykxmj7FK+DSQqtgi1bzP8sk3P7sc8TsV/ldx340CZVAs0R7WuVnucG Z7ENJ2YP3qtnIp7wULTfYsJ0IeLufWLWtapBImYmzSubMhPso9uAcJPS1U3bZVsiiLfW wIOltH07Ew3ASsaPSs/x9c/UWGBJKAIlaN7/Dr6hYi2IqXwd+DAnjXUgz6XIsb5MNw5L AW3w1rHJVR3NErxgI0SGNEFB91mAcqstE7clSGi/109ruCl9WiH3Dyr+zwAoKc2dwsUH 3k2iPmtyJWF4Jx+Spxoa5HXCQjwH+oz88AtbvOuAJt0dxAEtR3kLzqtlruALOhmSQzYU 9EFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mRXh6kle+5JC3fg5GhdP1NKq046Rc6qP/+3/3QkWOfw=; b=1dIkvqmm3focVetiKQ2e5SC+QEfQOhD4YGoibRbqoLKRMTPqBBqZH6yzJcl6hZ2zzT EXgrvMWPTmjXK7PjsoOzLP9uAsViSGOxA/DIU83I7jqpT6QUPQ/DHcTzYNz07mNqrzeM 23E9kauibb2aF7eX5ijR5xirmYx7SkGrjVPynBg1lKfYoRCpY9l1/j0/BX6t1m9+p0js 6H2Ki/A15LeK4GXnHL1LcFYy8oxCnWufHw5qHV9T9Rgopd5u/Tx1k2n22K1lD+MK8cf1 CIse1sDyZNJ99ymCusboaoyfyeOcJmIBWDD8KJYqFFRN4CjSy85s+B+1mfQAXT6jUspL faGg== X-Gm-Message-State: AOAM533fwqWrYk+KN79AIzcQL2GL8i5T5jbMA8JDjH76+id7ipWSRJd9 7tridQBC7OP012q85fmF0aFzMgBzvoSiNw== X-Received: by 2002:a65:52cc:0:b0:3a9:fd44:1d7 with SMTP id z12-20020a6552cc000000b003a9fd4401d7mr18211024pgp.211.1650554273514; Thu, 21 Apr 2022 08:17:53 -0700 (PDT) Received: from stoup.. ([2607:fb90:80c8:6cf3:a91a:4957:ba18:ac18]) by smtp.gmail.com with ESMTPSA id z16-20020a056a00241000b004f3a647ae89sm24616248pfh.174.2022.04.21.08.17.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 08:17:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 10/64] target/nios2: Remove nios2_cpu_record_sigsegv Date: Thu, 21 Apr 2022 08:16:41 -0700 Message-Id: <20220421151735.31996-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220421151735.31996-1-richard.henderson@linaro.org> References: <20220421151735.31996-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Since f5ef0e518d0, we have a real page mapped for kuser, which means the special casing for SIGSEGV can go away. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/nios2/cpu.h | 6 +----- linux-user/nios2/cpu_loop.c | 10 ---------- target/nios2/cpu.c | 4 +--- target/nios2/helper.c | 14 +------------- 4 files changed, 3 insertions(+), 31 deletions(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index ca0f3420cd..7b75641788 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -216,11 +216,7 @@ static inline int cpu_mmu_index(CPUNios2State *env, bool ifetch) MMU_SUPERVISOR_IDX; } -#ifdef CONFIG_USER_ONLY -void nios2_cpu_record_sigsegv(CPUState *cpu, vaddr addr, - MMUAccessType access_type, - bool maperr, uintptr_t ra); -#else +#ifndef CONFIG_USER_ONLY bool nios2_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c index 2963fc62b4..f37850fe81 100644 --- a/linux-user/nios2/cpu_loop.c +++ b/linux-user/nios2/cpu_loop.c @@ -126,16 +126,6 @@ void cpu_loop(CPUNios2State *env) info.si_code = TARGET_TRAP_BRKPT; queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; - case 0xaa: - { - info.si_signo = TARGET_SIGSEGV; - info.si_errno = 0; - /* TODO: check env->error_code */ - info.si_code = TARGET_SEGV_MAPERR; - info._sifields._sigfault._addr = env->regs[R_PC]; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - } - break; default: EXCP_DUMP(env, "\nqemu: unhandled CPU exception %#x - aborting\n", trapnr); diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index b0877cb39e..9774a3b8a4 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -210,9 +210,7 @@ static const struct SysemuCPUOps nios2_sysemu_ops = { static const struct TCGCPUOps nios2_tcg_ops = { .initialize = nios2_tcg_init, -#ifdef CONFIG_USER_ONLY - .record_sigsegv = nios2_cpu_record_sigsegv, -#else +#ifndef CONFIG_USER_ONLY .tlb_fill = nios2_cpu_tlb_fill, .cpu_exec_interrupt = nios2_cpu_exec_interrupt, .do_interrupt = nios2_cpu_do_interrupt, diff --git a/target/nios2/helper.c b/target/nios2/helper.c index 678fd96c4e..55b8fb0bcb 100644 --- a/target/nios2/helper.c +++ b/target/nios2/helper.c @@ -28,19 +28,7 @@ #include "exec/helper-proto.h" #include "semihosting/semihost.h" -#if defined(CONFIG_USER_ONLY) - -void nios2_cpu_record_sigsegv(CPUState *cs, vaddr addr, - MMUAccessType access_type, - bool maperr, uintptr_t retaddr) -{ - /* FIXME: Disentangle kuser page from linux-user sigsegv handling. */ - cs->exception_index = 0xaa; - cpu_loop_exit_restore(cs, retaddr); -} - -#else /* !CONFIG_USER_ONLY */ - +#if !defined(CONFIG_USER_ONLY) void nios2_cpu_do_interrupt(CPUState *cs) { Nios2CPU *cpu = NIOS2_CPU(cs);