From patchwork Fri Apr 22 16:51:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 564847 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp664050map; Fri, 22 Apr 2022 10:04:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQVjMNz5ock/Y5SK+F4syg7TeaMsfjaZLHGwCgrqRYeEYAEBBXiY39KrTig/x4rVct4hlj X-Received: by 2002:ad4:5d69:0:b0:446:3d44:2fbe with SMTP id fn9-20020ad45d69000000b004463d442fbemr4283604qvb.16.1650647093172; Fri, 22 Apr 2022 10:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650647093; cv=none; d=google.com; s=arc-20160816; b=ybm1EpDnr/ROt16dIxoclcH9GbWlKjScBxH/HVuGVTKyYN3+IzTRlO/KDj14rFhBH9 KVrPuQR4JVX1tz1j9G6F8+LD4jephiJRjg3weOZM3SCfxw6Z/xP3HquloiGn17/ekwWN qUoniJI5jQBFJewZx1MUh3eU+IjFDBP9mbJaV+3uSbspiMrVkjqkWvLHo6CR+XIj91Vv MyRnbyUfWFZ/X7fjfU8t7rVScBLWsGZFVjvMjd/WfBfS5NrResNLkadRP/4VW4An7RQB NwbAce43NB/bR1vzQ3iBneOY7hLIMqpq2Mh/f2LOjUUmeXDBjXVjDpIRr5Q6yk1WRPiP l1aQ== 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=tSluLj2R1JhZMB4God4i50Z4RRfFTHgwIiUmh8NzNww=; b=ItTOpl1agZbqdBVjT11brEV8ZRpMNiSbUYt375BRqu2dFoEKuBPas0wIGRFihB9z3G skEV8LUvUyqUoK8F3PmqHk0aFjMxsrPw0IsZc+Q3hC0H/AQbh0L7ZZAHezAmCXN43wzy 0Mo05Myf++rXbC693IMAOdQzr2gxv6dkRi3xG19mDELauKLJQOrWCw6I8imJQjk8hK7w evR9ynKArkT3Wj/jHeq2Du8jZtjMvrvmybuFVNCxVFh9yJV3/wr5Vo/1SG2+JK6MnJXn mwJDbBEyuqUtCPp/3Tqw9me8bINGihsecNTskgpbAvWud9pPVZ5cKT+LyLreOUI+vhx2 KizQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RLCp3TyZ; 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 m2-20020a05622a118200b002ee87499f80si2594141qtk.171.2022.04.22.10.04.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Apr 2022 10:04:53 -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=RLCp3TyZ; 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]:45394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhwiC-0001ya-Ph for patch@linaro.org; Fri, 22 Apr 2022 13:04:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhwWk-0000dj-OT for qemu-devel@nongnu.org; Fri, 22 Apr 2022 12:53:02 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:44975) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhwWj-0007FB-3Z for qemu-devel@nongnu.org; Fri, 22 Apr 2022 12:53:02 -0400 Received: by mail-pl1-x630.google.com with SMTP id j8so12078909pll.11 for ; Fri, 22 Apr 2022 09:53:00 -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=tSluLj2R1JhZMB4God4i50Z4RRfFTHgwIiUmh8NzNww=; b=RLCp3TyZ1hCaxWgxWbV6hCtRSnxxyWMNkMRcY6H0qaB+S9Lv8hTX6TPOyJ7W1SgFPK KPz3CCCg3tt1qZE2pVTP9tajSRGmQWy5vXm/Rkw+ONT0n/EFVXIn9ZxoWHIzHOlNbAxT ZinDvGC64Im4kg4Ft8Z9jSmHJw3k/eduyxZKVKssqnbH3ExX9Ky1yaEWmbRUNGrKTxmk tG5Dohf5Vrfh7g+xoyM1y+yWCBvadHdn7PNul6FCVVvEOhKyAcrhX896medVBsxM+ytA jqUl9DPFL7tJZzmj+tP9e9EDBNz6HzPZ280OiwJYWETJBukw3gcIMA2DftRVwbmrDfDB ujmg== 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=tSluLj2R1JhZMB4God4i50Z4RRfFTHgwIiUmh8NzNww=; b=M60UvroaEYys9eVcKQKPdJ+51DLCkkTcP+wcAobNlNK/3SgsPUHBaZ29X6CsRTOJt5 24DAElxlRA3h1iuUQR1zCXS/bJqHsZ8il+I2Ut4qbkEpPruLsoMjGr/CR3Sv7erTxBna ++7prVWLoDZHyVg0wG2exdYt0htkv/PoZn0OyLZs34J8m5PruXEDSSIMaHFdhxMndk5p 4deVZI5LvCIOxIt3k50rqLcuxj37XB9Cl74zPkBsZ/eJr/EqkZeqBz3lNQeMOEtY8I3U FIqlvYqIx7Uun/Ji0pxyFKbITPgNXNIR9lJ6fTam2LIa3q3MjnUvr+iqZwmKw6P3C2t4 xOVg== X-Gm-Message-State: AOAM532VLGjOvvt/3WUtPcqevoMTsrTHiZZ5O7beIq8a/33t/83CzXHe pPUhubCx65b1djqJdCCf2GcCgr1jIIG521jA X-Received: by 2002:a17:903:120c:b0:154:c135:60d3 with SMTP id l12-20020a170903120c00b00154c13560d3mr5526141plh.48.1650646378707; Fri, 22 Apr 2022 09:52:58 -0700 (PDT) Received: from stoup.. ([2607:fb90:27d0:b0f2:934d:3e2:9f8c:dd1]) by smtp.gmail.com with ESMTPSA id 6-20020a17090a030600b001cd4989ff5fsm6835904pje.38.2022.04.22.09.52.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 09:52:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v8 10/68] target/nios2: Remove nios2_cpu_record_sigsegv Date: Fri, 22 Apr 2022 09:51:40 -0700 Message-Id: <20220422165238.1971496-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220422165238.1971496-1-richard.henderson@linaro.org> References: <20220422165238.1971496-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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: , Cc: Peter Maydell 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 Message-Id: <20220421151735.31996-11-richard.henderson@linaro.org> --- 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 1bab805bb0..3198c17213 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);