From patchwork Sat Sep 18 18:45:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 514251 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp682458jao; Sat, 18 Sep 2021 12:18:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws5wDT3HxkJ9qZGCgbx1xIAbevVnBC6jIAcz4fDIHBvLGB5Gu8CJ+dL2WDdZdI4Pc14BBr X-Received: by 2002:a5e:930a:: with SMTP id k10mr10011484iom.61.1631992696886; Sat, 18 Sep 2021 12:18:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631992696; cv=none; d=google.com; s=arc-20160816; b=Kdah2NxfU08kZqiCeHn8HS3iwGbMrUtYuEs/QkcmjpzpLcrs1LdJHLY10YPR300022 8GRTaFrvsll1zSnBDz8ZREIap5B+HptVxm4RBfvWu6HYDUxckRKukXZZwRzt2JY9okeC BRsv8E7TqToVv0oPdZ/l2dI7vsQrArUGR+rsNebz0TTT3LkwdT+nYlcVizHt5SHxlKvn B/lTkRn0RnO7MerzP2+FAHoyzbWdDtzWK0gIiYEhOkY+KIlifkjih0rGsCz4OGMuDRyU bDaeP46zwI6WRAQ7iL1mA2IxhqlNZmvkOsJzfDwKA3ISgvSP9GQuyKZCb7AxSVlNOEy/ ec3A== 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=evwYpaYtIeusJUHkEEt0rDRSAZ60QDEAx/EDgh8MFt8=; b=yMu+xtUSlA3j2pPqiY0vO9+ucC56JE0NZaC7FQrxye9Svkolde3YvclMO7D8dw969D s2xWKPMN0aXfDs/y1a+wlNKJFfN4yoPJYIRlKoxz1lbnEt/DgiriqbyO8XHUvT2r6XS+ ei7GreM6+DeoLP2kWYo5kJtj2Sy6PCDUXZ2WjSqOfi/xF/uaNE3pHcRf3QwlsKu//AD2 wVioOywD3BJryb+K+D2PZyt1dPY1AFPl58CxQTVQ8shyPIvnG4B4oxdEga60pQ00M9fE qqC5H6tBEIC4T2ZuUHrchNjWHxHMQ2NsXE0YZZ5ZS+oTnP9KmTvn2351yzrPWpqAeYgw meKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yd1OrPle; 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 h199si9014276iof.50.2021.09.18.12.18.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 Sep 2021 12:18:16 -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=yd1OrPle; 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]:34146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRfqq-0001vo-C0 for patch@linaro.org; Sat, 18 Sep 2021 15:18:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRfOb-00026a-Kq for qemu-devel@nongnu.org; Sat, 18 Sep 2021 14:49:05 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:43776) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mRfOZ-0000Y1-Ti for qemu-devel@nongnu.org; Sat, 18 Sep 2021 14:49:05 -0400 Received: by mail-pg1-x535.google.com with SMTP id r2so13090825pgl.10 for ; Sat, 18 Sep 2021 11:49:03 -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=evwYpaYtIeusJUHkEEt0rDRSAZ60QDEAx/EDgh8MFt8=; b=yd1OrPle+GMfowzsFnb2GpLny3itCxb1b1Fjs50fC6JIyetlNtQQBRGb7Y8cWGrEor 7T8KpI5djlt8zaJPhYx//iQRhi9wLLT+rZKLyFz047ytIAstoOttuU5fvAAfsig19ASY HlTpDWTjQZa4WstMWOyhriNUWg0gL0MBHgporCCnsngkjxkgP6Al5XYAVe3jPpwEBOr5 P3GhZQ1xurjtFpKCQJbCgjekW6Ob0F4VkKU8EGHLXnMcppYXB1CtCXlun7QDONrocJbT v0O6flus8sX2zWFHaPDFV/sQ2GOyVs0zS3tK09um/wh657iGvOTYMHsG9ZLgMHEzjaqs RnsA== 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=evwYpaYtIeusJUHkEEt0rDRSAZ60QDEAx/EDgh8MFt8=; b=dtezWKDbN0PczRsaWLi4VUCp444NOM/DM6UMlyHQm5CXcdoKj1SJF2v17ccvoPoco4 mmZ7M8Q70jBldMQodygVKAg/MgtvhlRvmyimNJIcnlMZcWi2LzC+qtjbh7FUZI4HIbbb rwxmJEHDOKMl8nEpQjJTe0N2//YHd77ZhJkYLLFIMfoWJjSpsufb1p8NtB2pm1qsmaFH 4Bj05XH+dvslVB4ocT9sT8a6jKUzxiFIf/3qW6G7UwOHoxmDQMMGu3wmuZ59g6ukVEl/ BW1pPARLAp6AOXaJ+zzMdYu+8X7eJBSCfxnrYRfme/wjkpLLGWcajcuufg2BoyJNulA4 y53A== X-Gm-Message-State: AOAM530xkBwovwNBlLHOU1pWDcG8TlsEUq8QI3B59G56/ud1o9LDFtMf HmYMw1ABoGLmjedxlFtncAc+PMAVIApPLA== X-Received: by 2002:a63:1914:: with SMTP id z20mr15963906pgl.87.1631990942447; Sat, 18 Sep 2021 11:49:02 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id p30sm9916522pfh.116.2021.09.18.11.49.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Sep 2021 11:49:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 40/41] target/xtensa: Make xtensa_cpu_tlb_fill sysemu only Date: Sat, 18 Sep 2021 11:45:26 -0700 Message-Id: <20210918184527.408540-41-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::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.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 xtensa. Remove the code from cpu_loop that raised SIGSEGV. Signed-off-by: Richard Henderson --- target/xtensa/cpu.h | 2 +- linux-user/xtensa/cpu_loop.c | 9 --------- target/xtensa/cpu.c | 2 +- target/xtensa/helper.c | 22 +--------------------- 4 files changed, 3 insertions(+), 32 deletions(-) -- 2.25.1 diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index 646965f379..cf0fffbd26 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -563,10 +563,10 @@ struct XtensaCPU { }; +#ifndef CONFIG_USER_ONLY bool xtensa_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); -#ifndef CONFIG_USER_ONLY void xtensa_cpu_do_interrupt(CPUState *cpu); bool xtensa_cpu_exec_interrupt(CPUState *cpu, int interrupt_request); void xtensa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, diff --git a/linux-user/xtensa/cpu_loop.c b/linux-user/xtensa/cpu_loop.c index 64831c9199..b48781c6e8 100644 --- a/linux-user/xtensa/cpu_loop.c +++ b/linux-user/xtensa/cpu_loop.c @@ -224,15 +224,6 @@ void cpu_loop(CPUXtensaState *env) queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; - case LOAD_PROHIBITED_CAUSE: - case STORE_PROHIBITED_CAUSE: - info.si_signo = TARGET_SIGSEGV; - info.si_errno = 0; - info.si_code = TARGET_SEGV_ACCERR; - info._sifields._sigfault._addr = env->sregs[EXCVADDR]; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; - default: fprintf(stderr, "exccause = %d\n", env->sregs[EXCCAUSE]); g_assert_not_reached(); diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 5cb19a8881..c289c4e679 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -192,11 +192,11 @@ static const struct SysemuCPUOps xtensa_sysemu_ops = { static const struct TCGCPUOps xtensa_tcg_ops = { .initialize = xtensa_translate_init, - .tlb_fill = xtensa_cpu_tlb_fill, .debug_excp_handler = xtensa_breakpoint_handler, #ifndef CONFIG_USER_ONLY .has_work = xtensa_cpu_has_work, + .tlb_fill = xtensa_cpu_tlb_fill, .cpu_exec_interrupt = xtensa_cpu_exec_interrupt, .do_interrupt = xtensa_cpu_do_interrupt, .do_transaction_failed = xtensa_cpu_do_transaction_failed, diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c index f18ab383fd..29d216ec1b 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -242,27 +242,7 @@ void xtensa_cpu_list(void) } } -#ifdef CONFIG_USER_ONLY - -bool xtensa_cpu_tlb_fill(CPUState *cs, vaddr address, int size, - MMUAccessType access_type, int mmu_idx, - bool probe, uintptr_t retaddr) -{ - XtensaCPU *cpu = XTENSA_CPU(cs); - CPUXtensaState *env = &cpu->env; - - qemu_log_mask(CPU_LOG_INT, - "%s: rw = %d, address = 0x%08" VADDR_PRIx ", size = %d\n", - __func__, access_type, address, size); - env->sregs[EXCVADDR] = address; - env->sregs[EXCCAUSE] = (access_type == MMU_DATA_STORE ? - STORE_PROHIBITED_CAUSE : LOAD_PROHIBITED_CAUSE); - cs->exception_index = EXC_USER; - cpu_loop_exit_restore(cs, retaddr); -} - -#else /* !CONFIG_USER_ONLY */ - +#ifndef CONFIG_USER_ONLY void xtensa_cpu_do_unaligned_access(CPUState *cs, vaddr addr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr)