From nobody Tue Feb 10 11:56:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.46 as permitted sender) client-ip=209.85.128.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1631379372; cv=none; d=zohomail.com; s=zohoarc; b=iU5lLIYEucm5lBHBBiDFSY49oej57UvkxZhDOgVPy+daa7Mo+Hokd85KRM13d67RFYgxkHUr6ZpfIMwUPrTHOd9bH0241sdNUuV3LecvnkmPIUkhlAQFuUytosmyyCUlBZ+QlrYPfSgTRLMx4pqqA19j/WsmcCkekSqHB26C0u4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631379372; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UtJq3N+o/FB/vJogkj3xMiVffE8zdE5GfFgTZhZFv9U=; b=WbDtns0/j4ZMUssQZ2INUp+/VT7s5aUkTn3icw+BJyjxEWi+sHa9lpHwp9sp/TusL6PpZ5rVyw8h6QAwPB4uQEQyH0iugqq27d5TpmBSLGz5B2Iyp77o44ZClropoIYo2YkX1pNLtDzqQe7KZuSnsyel12ZSf17GeJouKPXSf5s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx.zohomail.com with SMTPS id 1631379372815583.104005650249; Sat, 11 Sep 2021 09:56:12 -0700 (PDT) Received: by mail-wm1-f46.google.com with SMTP id 196-20020a1c04cd000000b002fa489ffe1fso3719865wme.4 for ; Sat, 11 Sep 2021 09:56:12 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (21.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.21]) by smtp.gmail.com with ESMTPSA id q128sm2415301wma.27.2021.09.11.09.56.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Sep 2021 09:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UtJq3N+o/FB/vJogkj3xMiVffE8zdE5GfFgTZhZFv9U=; b=Jj3pZJubcki583hST9Ml4WiUPpALow/vOMXxn5XAYawBnV40NEe3Lbv3VO8WHQFoE0 U3yjryoh43IJsIM/bS7c5s60L66lA2xuuSxJOjhaG0Uhkz5ZlTtubZETEanE2Yvh3EpZ 9Y30oQCi4esU6I9Y91kjPwxw1NWEnKjdkQ62wv9pn6fwUgPGOH2WclrppGrdbsTSSLAP kNAqvkXsrDWh0gjy3NPMSo/rcdDA7IjepDbtLQ9ScW+P/uC4oOYDVSjiM8kO02FCjmOZ IGWBbDjJ+hV9BbuayjKnBM5097ECxZv24Bn2r2RpPQ4fOFTCoUVxd7S81aUy3xPD8mz7 nVGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=UtJq3N+o/FB/vJogkj3xMiVffE8zdE5GfFgTZhZFv9U=; b=Op59Wd1PxeEqmSjFSMLzp4HCwh074F+qHk4Ga938Tn3OpjnLrrAch34E0Fb+p82Vdv zG7EbkBhr/JgDEkDqJyAIG2KiUUjJKuoi09ugTUEwoXeUbttRLasNKK8F6sGKf5gqQka TfjrmNCSJt3vW5uE7j7g2u6RuBXm2LR2C5UrxbwYY06ofhQ8aOykauXnigKUe62za0sj lMCtT90B4ghoUnQbJ8ohO4T/1+Df26qp8KTSAQaM4SJMFjUTGBfiO0bee4qSfaQanGGt YRbpfTppeQ7n/0NykM02KDZVyNhw0vHNRD2zI5DD0II4aw4mg+S4ZUwYxGdlXug/dDW7 upaw== X-Gm-Message-State: AOAM5305C1hcNpoWtAOTQMegZj2bzUq5S/Bw7UulvFatVHskWCEwOVQ7 ttmQ/1S3NhhdkzJ3MVY+PkIqMUHfkT4= X-Google-Smtp-Source: ABdhPJzgG56PUPSFjtbFUA/91RlH06oMeAM8Tni8zC9INHsQ7Grgo4frnIz/HLxRar1Fxxlr5hamWQ== X-Received: by 2002:a05:600c:4fc8:: with SMTP id o8mr3327597wmq.153.1631379371097; Sat, 11 Sep 2021 09:56:11 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Warner Losh Subject: [PATCH v3 19/24] target/sh4: Restrict cpu_exec_interrupt() handler to sysemu Date: Sat, 11 Sep 2021 18:54:29 +0200 Message-Id: <20210911165434.531552-20-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210911165434.531552-1-f4bug@amsat.org> References: <20210911165434.531552-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1631379375012100001 Restrict cpu_exec_interrupt() and its callees to sysemu. Reviewed-by: Warner Losh Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/sh4/cpu.h | 4 ++-- target/sh4/cpu.c | 2 +- target/sh4/helper.c | 9 ++------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index 01c43440822..017a7702140 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -204,8 +204,6 @@ struct SuperHCPU { }; =20 =20 -void superh_cpu_do_interrupt(CPUState *cpu); -bool superh_cpu_exec_interrupt(CPUState *cpu, int int_req); void superh_cpu_dump_state(CPUState *cpu, FILE *f, int flags); hwaddr superh_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); int superh_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); @@ -223,6 +221,8 @@ bool superh_cpu_tlb_fill(CPUState *cs, vaddr address, i= nt size, =20 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); uint32_t cpu_sh4_read_mmaped_itlb_addr(CPUSH4State *s, hwaddr addr); diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 83269229421..2047742d03c 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -236,10 +236,10 @@ 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, - .cpu_exec_interrupt =3D superh_cpu_exec_interrupt, .tlb_fill =3D superh_cpu_tlb_fill, =20 #ifndef CONFIG_USER_ONLY + .cpu_exec_interrupt =3D superh_cpu_exec_interrupt, .do_interrupt =3D superh_cpu_do_interrupt, .do_unaligned_access =3D superh_cpu_do_unaligned_access, .io_recompile_replay_branch =3D superh_io_recompile_replay_branch, diff --git a/target/sh4/helper.c b/target/sh4/helper.c index 2d622081e85..53cb9c3b631 100644 --- a/target/sh4/helper.c +++ b/target/sh4/helper.c @@ -45,11 +45,6 @@ =20 #if defined(CONFIG_USER_ONLY) =20 -void superh_cpu_do_interrupt(CPUState *cs) -{ - cs->exception_index =3D -1; -} - int cpu_sh4_is_cached(CPUSH4State *env, target_ulong addr) { /* For user mode, only U0 area is cacheable. */ @@ -784,8 +779,6 @@ int cpu_sh4_is_cached(CPUSH4State * env, target_ulong a= ddr) return 0; } =20 -#endif - bool superh_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { if (interrupt_request & CPU_INTERRUPT_HARD) { @@ -803,6 +796,8 @@ 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) --=20 2.31.1