From patchwork Sat Sep 18 18:45:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 514247 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp679429jao; Sat, 18 Sep 2021 12:12:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzM9ziNf+0rwrqnLkUxqu0vxsPQjXnD69WnoCDO9JihIMopJYpPnedSoNnM3ZvnZBe0pp/M X-Received: by 2002:a25:5956:: with SMTP id n83mr20315880ybb.109.1631992343613; Sat, 18 Sep 2021 12:12:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631992343; cv=none; d=google.com; s=arc-20160816; b=GRdqMwGq9XNBCfOW3PLbS/tsYwQ5Ne+A37n92SP3ijMSlDB0KnQ/K3+ZKE4M2AmPAF vp/aUtb84m7thcZX0DNizn3H6104yo9ZDgqBuYL8iHD1KUh8yPY9sjtRWNIvKU3pvQDq j1Laww/pvrWt8QZ883CzdWUJz9iwB6Jxbl5sQDNzC1ryaMdLadQIlBqyGhIhOzOQMJiv YI0q1gZj5uEnQYTHGfqaWd5x2Gz4ouZCJEUbEQDt3pQ2Qd5Rx5CNEIfmlJFYr+dztGto JqkB498rswwaNQxO2TQw6sf/PAKyxg+1bileTqjPhI2q3pzRR3z0ZfSMdG+7ybcQYW78 H3Fw== 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=yhN8ow8bafB9lvcE0BZaSXFoylrPitNEFmmVqtlA/N4=; b=i4rmcft8x5hbC3LjTqE3aUje5f+07yUxLdmK5niRW74Y8HgwbJ0AMxygh3F3mUtbvT sKn036V544vPDa6v/yWDRk4oZXO4YWKnkg/nz8qkGvBd7wuiP+qiJJ6cRIWuFaIXgO1z Yzmk1nAg+8x/vnTJWpf/j6zhC2AnkN2+3zf7cgmvEScm2T6FUQV6uP5Cak5CytyDJ4QU AK6LTftxxYrSAnzFNVa1tuQtX3rOij7wJeMaaUrDZwJAMZaE3PGiOhMPgL23lTbozRsX uFXxNc3DFhSCM9KFOpCuGMU1+p7SDUAWbEQQUVj739C9UykxEbvl3SgliYCd1LfYoSPN HFJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t28LFLBB; 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 u14si11426360ybp.265.2021.09.18.12.12.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 Sep 2021 12:12:23 -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=t28LFLBB; 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]:46990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRfl9-0008JH-0R for patch@linaro.org; Sat, 18 Sep 2021 15:12:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRfLf-0005D0-Q2 for qemu-devel@nongnu.org; Sat, 18 Sep 2021 14:46:04 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:37439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRfLS-0006ts-Vi for qemu-devel@nongnu.org; Sat, 18 Sep 2021 14:46:00 -0400 Received: by mail-pg1-x536.google.com with SMTP id 17so13098847pgp.4 for ; Sat, 18 Sep 2021 11:45:49 -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=yhN8ow8bafB9lvcE0BZaSXFoylrPitNEFmmVqtlA/N4=; b=t28LFLBBoCwttS/Xsn/H8Z9+uNlnEzbRSDN3S0d9ZoOOEEi2AmnrupLxJTTYpyeG2q Rd6fCBIqZkbl15zwrzgNsB/kcvG1ytYlp/lpS2jDdh1A3s9uaaaSS5v7BZBMQEbrMdAM 7rl4sGMtQOOimiryyJ7aHmsHBDE8xJGwaNn19S5xBeflat+k0pGu7mEN3H2dvJPfWWTl /8idErSCwZ3w5K/Zs3EucKPtlKMD55ipH89m8u7nkasTX4+iVAVtVNvzuqpKh11y7UAz BuNyzNzMC9+1zWM6TMrMrUJ4Z07LoqcUkmQ+zXotlIEeX/7og/uPaZiDke/uiCodTNwz LJkg== 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=yhN8ow8bafB9lvcE0BZaSXFoylrPitNEFmmVqtlA/N4=; b=K0kkcaNKQEvfOQjdpUFg0xvDn07B/lC51sYUBIhCFkSAAOKctYU/Pbq04RWiNaofOL nfF/KilqLi9bpGN1amIzMPqsrMa9DWYUcLpVOReRAc+vl83E1aJVo6xJ5O17E1HyXLc1 7fOjoEwhX/Eled9fdIcYH/Gqmm23kjt6hFM8CnkiveBIv7CKXNT9YvfFu9hd6vjsJ/oq yXaI6bVvmX3IHgdq64sNqlJt/25w+sTG9B6TpduX8O8SV53O6Xb+gSOrfpcLyPhuPd17 NKl6G3iWrC214QiTKO84MN1dH73Slp04T1BYcZ3RxTMw6jMheWIk1bjH7J27NIxvcRt9 TQeA== X-Gm-Message-State: AOAM531P/R26LXymrPgMk2+nT1WcEnSkgGrw60VUbeb80Bw68JASnY3a M1ZDOmsWQD/u05Zgpu/IKjdQergBc1nwUQ== X-Received: by 2002:a05:6a00:1481:b0:43d:275b:7ba4 with SMTP id v1-20020a056a00148100b0043d275b7ba4mr17032200pfu.63.1631990748685; Sat, 18 Sep 2021 11:45:48 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id y26sm9555858pfe.69.2021.09.18.11.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Sep 2021 11:45:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 24/41] target/cris: Make cris_cpu_tlb_fill sysemu only Date: Sat, 18 Sep 2021 11:45:10 -0700 Message-Id: <20210918184527.408540-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210918184527.408540-1-richard.henderson@linaro.org> References: <20210918184527.408540-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The fallback code in raise_sigsegv is sufficient for cris-linux-user. Remove the code from cpu_loop that handled the unnamed 0xaa exception. This makes all of the code in helper.c sysemu only, so remove the ifdefs and move the file to cris_softmmu_ss. Signed-off-by: Richard Henderson --- target/cris/cpu.h | 8 ++++---- linux-user/cris/cpu_loop.c | 10 ---------- target/cris/cpu.c | 4 ++-- target/cris/helper.c | 18 ------------------ target/cris/meson.build | 7 +++++-- 5 files changed, 11 insertions(+), 36 deletions(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/target/cris/cpu.h b/target/cris/cpu.h index 6603565f83..b445b194ea 100644 --- a/target/cris/cpu.h +++ b/target/cris/cpu.h @@ -189,6 +189,10 @@ extern const VMStateDescription vmstate_cris_cpu; void cris_cpu_do_interrupt(CPUState *cpu); void crisv10_cpu_do_interrupt(CPUState *cpu); bool cris_cpu_exec_interrupt(CPUState *cpu, int int_req); + +bool cris_cpu_tlb_fill(CPUState *cs, vaddr address, int size, + MMUAccessType access_type, int mmu_idx, + bool probe, uintptr_t retaddr); #endif void cris_cpu_dump_state(CPUState *cs, FILE *f, int flags); @@ -251,10 +255,6 @@ static inline int cpu_mmu_index (CPUCRISState *env, bool ifetch) return !!(env->pregs[PR_CCS] & U_FLAG); } -bool cris_cpu_tlb_fill(CPUState *cs, vaddr address, int size, - MMUAccessType access_type, int mmu_idx, - bool probe, uintptr_t retaddr); - /* Support function regs. */ #define SFR_RW_GC_CFG 0][0 #define SFR_RW_MM_CFG env->pregs[PR_SRS]][0 diff --git a/linux-user/cris/cpu_loop.c b/linux-user/cris/cpu_loop.c index 334edddd1e..0de941c0b4 100644 --- a/linux-user/cris/cpu_loop.c +++ b/linux-user/cris/cpu_loop.c @@ -35,16 +35,6 @@ void cpu_loop(CPUCRISState *env) process_queued_cpu_work(cs); switch (trapnr) { - case 0xaa: - { - 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->pregs[PR_EDA]; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - } - break; case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ break; diff --git a/target/cris/cpu.c b/target/cris/cpu.c index b9f30ba58f..b8ac1b9f25 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -207,10 +207,10 @@ static const struct SysemuCPUOps cris_sysemu_ops = { static const struct TCGCPUOps crisv10_tcg_ops = { .initialize = cris_initialize_crisv10_tcg, - .tlb_fill = cris_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY .has_work = cris_cpu_has_work, + .tlb_fill = cris_cpu_tlb_fill, .cpu_exec_interrupt = cris_cpu_exec_interrupt, .do_interrupt = crisv10_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ @@ -218,9 +218,9 @@ static const struct TCGCPUOps crisv10_tcg_ops = { static const struct TCGCPUOps crisv32_tcg_ops = { .initialize = cris_initialize_tcg, - .tlb_fill = cris_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .tlb_fill = cris_cpu_tlb_fill, .cpu_exec_interrupt = cris_cpu_exec_interrupt, .do_interrupt = cris_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ diff --git a/target/cris/helper.c b/target/cris/helper.c index 36926faf32..a0d6ecdcd3 100644 --- a/target/cris/helper.c +++ b/target/cris/helper.c @@ -39,22 +39,6 @@ #define D_LOG(...) do { } while (0) #endif -#if defined(CONFIG_USER_ONLY) - -bool cris_cpu_tlb_fill(CPUState *cs, vaddr address, int size, - MMUAccessType access_type, int mmu_idx, - bool probe, uintptr_t retaddr) -{ - CRISCPU *cpu = CRIS_CPU(cs); - - cs->exception_index = 0xaa; - cpu->env.pregs[PR_EDA] = address; - cpu_loop_exit_restore(cs, retaddr); -} - -#else /* !CONFIG_USER_ONLY */ - - static void cris_shift_ccs(CPUCRISState *env) { uint32_t ccs; @@ -304,5 +288,3 @@ bool cris_cpu_exec_interrupt(CPUState *cs, int interrupt_request) return ret; } - -#endif /* !CONFIG_USER_ONLY */ diff --git a/target/cris/meson.build b/target/cris/meson.build index 67c3793c85..c1e326d950 100644 --- a/target/cris/meson.build +++ b/target/cris/meson.build @@ -2,13 +2,16 @@ cris_ss = ss.source_set() cris_ss.add(files( 'cpu.c', 'gdbstub.c', - 'helper.c', 'op_helper.c', 'translate.c', )) cris_softmmu_ss = ss.source_set() -cris_softmmu_ss.add(files('mmu.c', 'machine.c')) +cris_softmmu_ss.add(files( + 'helper.c', + 'machine.c', + 'mmu.c', +)) target_arch += {'cris': cris_ss} target_softmmu_arch += {'cris': cris_softmmu_ss}