From nobody Tue Feb 10 09:01:51 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1635789491; cv=none; d=zohomail.com; s=zohoarc; b=c8q8Ix6ckLsbZouM70CoI4a0L27SXaxg52E/sotuh7exBZTmasWEpguuh8F2GsWBneMFf0q1BPHEvLmU5mWunXs3G4gwfk/BgAlniPlxjfXnASM+VCst5LsQ6cZ6pqLEP/s41BD8eVrMWGQB4DQHwNf2S9O/LmYwAFO12u+10MA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635789491; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bSOPptd8n2vyIHjygFEkKtsmxu32Sh4/nm0zdx+yC2M=; b=TrfLW9+eZLVMwagnh1SiUGIw3dfipSYwzVsEvcKMwRkxwHdJH7aOrgo1gFvJOJ/m+pQFYmSO7ibLILI025TTC/lRWvPM2mw8Lajq4OJXK8isMsu6kU5Zd0oMhB+KTA/9xmDvuDA445Wo1MEyf3YB72vSeekeUl6Vy9PtYZ33IBA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1635789491285514.5373802124757; Mon, 1 Nov 2021 10:58:11 -0700 (PDT) Received: from localhost ([::1]:39796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhbZS-0008RO-7u for importer@patchew.org; Mon, 01 Nov 2021 13:58:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhb6G-0003w6-Ot for qemu-devel@nongnu.org; Mon, 01 Nov 2021 13:28:05 -0400 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]:38744) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mhb6A-0000g4-U2 for qemu-devel@nongnu.org; Mon, 01 Nov 2021 13:28:00 -0400 Received: by mail-qt1-x835.google.com with SMTP id h4so15922554qth.5 for ; Mon, 01 Nov 2021 10:27:53 -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 t5sm6075331qkf.34.2021.11.01.10.27.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 10:27:52 -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=bSOPptd8n2vyIHjygFEkKtsmxu32Sh4/nm0zdx+yC2M=; b=VpocW1Q8s0IHHHfzGmG5fOCrimmensfERl4uBlNSg+9cfByiEwoSVDLKB5uEcmqpH0 6e+GRLL9py63d+krAhWgBU5nwtcNHiPBJCGvBlVcIQxE8paQV03xYUnyeBVW/WDbd4aw OV7nLnijqO4rUS2WVP0gGdcSfD1aZMzr/qEGkRuLEIEmjTI/6eya2vtl5URUn3FUnWiW 29YtEQYEmaB2NyNMe/P1vioWVBREAJkwMIun1WFvWBaBQeoaV590x7Tc8/PWSdnoS/7K WCKb4GUiOO7c4GUcI3/WX07aWKEXVGkHAomeIdl3JTMSSvwOsRPg6RJF9iSXLZOlMplq Jy1A== 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=bSOPptd8n2vyIHjygFEkKtsmxu32Sh4/nm0zdx+yC2M=; b=b3D5pB4BwEAazVTVnm4cLiSSRN1gRU958UvBfO4c0TeIxorh0lNCGdQpYbhInPRLv4 /AXmWuQZHZAaRHqU24VSJwHy44YpmA6eOZ67F7lXYeB6tQGWBRG0w53J4CHRoQjAVjyX 5ArVaplIghvHQTsOV33148ku1Le0TQZZkkAhN//z5I/iyZd4vB1Zo1aVSRl/v23i9je1 IlCGXrUTx7NH2Q3FwUXVh4OVSINZdFX7rMuNFAGQNaG0mmJ/nADZ6Y/j5y+T5tzpJSyf oCAj/kP1i+Mkodx4UgbwRaIzYm7sSApo2hBPzZrymoV7tJRWgt1MqZjw+rDaXQsMc/oL TGYw== X-Gm-Message-State: AOAM532DsBai81z0zX2Ym8Js9c/4jBiJ4t24SPbULStLmPgoyidCbUKA WYgw1YAg5H+OCtkTEINsBUW4izCDaS0m5A== X-Google-Smtp-Source: ABdhPJxjvsiqQIWWlvyjjYaWrtUKiOg91hE8fAZwXx3AXpPrqpaABMPFj6QZnyR9vk3ENHruRD1cxQ== X-Received: by 2002:a05:622a:38c:: with SMTP id j12mr31842544qtx.63.1635787673114; Mon, 01 Nov 2021 10:27:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 38/60] target/sh4: Make sh4_cpu_tlb_fill sysemu only Date: Mon, 1 Nov 2021 13:27:07 -0400 Message-Id: <20211101172729.23149-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211101172729.23149-1-richard.henderson@linaro.org> References: <20211101172729.23149-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x835.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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1635789492396100001 The fallback code in cpu_loop_exit_sigsegv is sufficient for sh4 linux-user. Remove the code from cpu_loop that raised SIGSEGV. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- target/sh4/cpu.h | 6 +++--- linux-user/sh4/cpu_loop.c | 8 -------- target/sh4/cpu.c | 2 +- target/sh4/helper.c | 9 +-------- 4 files changed, 5 insertions(+), 20 deletions(-) diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index dc81406646..4cfb109f56 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -213,12 +213,12 @@ void superh_cpu_do_unaligned_access(CPUState *cpu, va= ddr addr, uintptr_t retaddr) QEMU_NORETURN; =20 void sh4_translate_init(void); +void sh4_cpu_list(void); + +#if !defined(CONFIG_USER_ONLY) bool superh_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr); - -void sh4_cpu_list(void); -#if !defined(CONFIG_USER_ONLY) void superh_cpu_do_interrupt(CPUState *cpu); bool superh_cpu_exec_interrupt(CPUState *cpu, int int_req); void cpu_sh4_invalidate_tlb(CPUSH4State *s); diff --git a/linux-user/sh4/cpu_loop.c b/linux-user/sh4/cpu_loop.c index 65b8972e3c..ac9b01840c 100644 --- a/linux-user/sh4/cpu_loop.c +++ b/linux-user/sh4/cpu_loop.c @@ -65,14 +65,6 @@ void cpu_loop(CPUSH4State *env) info.si_code =3D TARGET_TRAP_BRKPT; queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; - case 0xa0: - case 0xc0: - info.si_signo =3D TARGET_SIGSEGV; - info.si_errno =3D 0; - info.si_code =3D TARGET_SEGV_MAPERR; - info._sifields._sigfault._addr =3D env->tea; - queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); - break; case EXCP_ATOMIC: cpu_exec_step_atomic(cs); arch_interrupt =3D false; diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 2047742d03..06b2691dc4 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -236,9 +236,9 @@ static const struct SysemuCPUOps sh4_sysemu_ops =3D { static const struct TCGCPUOps superh_tcg_ops =3D { .initialize =3D sh4_translate_init, .synchronize_from_tb =3D superh_cpu_synchronize_from_tb, - .tlb_fill =3D superh_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .tlb_fill =3D superh_cpu_tlb_fill, .cpu_exec_interrupt =3D superh_cpu_exec_interrupt, .do_interrupt =3D superh_cpu_do_interrupt, .do_unaligned_access =3D superh_cpu_do_unaligned_access, diff --git a/target/sh4/helper.c b/target/sh4/helper.c index 53cb9c3b63..6a620e36fc 100644 --- a/target/sh4/helper.c +++ b/target/sh4/helper.c @@ -796,8 +796,6 @@ bool superh_cpu_exec_interrupt(CPUState *cs, int interr= upt_request) return false; } =20 -#endif /* !CONFIG_USER_ONLY */ - bool superh_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr) @@ -806,11 +804,6 @@ bool superh_cpu_tlb_fill(CPUState *cs, vaddr address, = int size, CPUSH4State *env =3D &cpu->env; int ret; =20 -#ifdef CONFIG_USER_ONLY - ret =3D (access_type =3D=3D MMU_DATA_STORE ? MMU_DTLB_VIOLATION_WRITE : - access_type =3D=3D MMU_INST_FETCH ? MMU_ITLB_VIOLATION : - MMU_DTLB_VIOLATION_READ); -#else target_ulong physical; int prot; =20 @@ -829,7 +822,6 @@ bool superh_cpu_tlb_fill(CPUState *cs, vaddr address, i= nt size, if (ret !=3D MMU_DTLB_MULTIPLE && ret !=3D MMU_ITLB_MULTIPLE) { env->pteh =3D (env->pteh & PTEH_ASID_MASK) | (address & PTEH_VPN_M= ASK); } -#endif =20 env->tea =3D address; switch (ret) { @@ -868,3 +860,4 @@ bool superh_cpu_tlb_fill(CPUState *cs, vaddr address, i= nt size, } cpu_loop_exit_restore(cs, retaddr); } +#endif /* !CONFIG_USER_ONLY */ --=20 2.25.1