[PATCH 02/18] target/sparc: limit cpu_check_irqs to system emulation

Paolo Bonzini posted 18 patches 1 week ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Cameron Esfahani <dirty@apple.com>, Roman Bolshakov <rbolshakov@ddn.com>, Phil Dennis-Jordan <phil@philjordan.eu>, Mads Ynddal <mads@ynddal.dk>, Riku Voipio <riku.voipio@iki.fi>, Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Nicholas Piggin <npiggin@gmail.com>, Chinmay Rath <rathc@linux.ibm.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, Laurent Vivier <laurent@vivier.eu>, Brian Cain <brian.cain@oss.qualcomm.com>, "Alex Bennée" <alex.bennee@linaro.org>, Peter Maydell <peter.maydell@linaro.org>, Michael Rolnik <mrolnik@gmail.com>, Marcelo Tosatti <mtosatti@redhat.com>, Reinoud Zandijk <reinoud@netbsd.org>, Sunil Muthuswamy <sunilmut@microsoft.com>, Stafford Horne <shorne@gmail.com>, Yoshinori Sato <yoshinori.sato@nifty.com>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Artyom Tarasenko <atar4qemu@gmail.com>
[PATCH 02/18] target/sparc: limit cpu_check_irqs to system emulation
Posted by Paolo Bonzini 1 week ago
It is not used by user-mode emulation and is the only caller of
cpu_interrupt() in qemu-sparc* binaries.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target/sparc/int32_helper.c | 2 ++
 target/sparc/int64_helper.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/target/sparc/int32_helper.c b/target/sparc/int32_helper.c
index 39db4ffa70a..fdcaa0a578b 100644
--- a/target/sparc/int32_helper.c
+++ b/target/sparc/int32_helper.c
@@ -65,6 +65,7 @@ static const char *excp_name_str(int32_t exception_index)
     return excp_names[exception_index];
 }
 
+#if !defined(CONFIG_USER_ONLY)
 void cpu_check_irqs(CPUSPARCState *env)
 {
     CPUState *cs;
@@ -96,6 +97,7 @@ void cpu_check_irqs(CPUSPARCState *env)
         cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);
     }
 }
+#endif
 
 void sparc_cpu_do_interrupt(CPUState *cs)
 {
diff --git a/target/sparc/int64_helper.c b/target/sparc/int64_helper.c
index 49e4e51c6dc..23adda4cad7 100644
--- a/target/sparc/int64_helper.c
+++ b/target/sparc/int64_helper.c
@@ -62,6 +62,7 @@ static const char * const excp_names[0x80] = {
 };
 #endif
 
+#if !defined(CONFIG_USER_ONLY)
 void cpu_check_irqs(CPUSPARCState *env)
 {
     CPUState *cs;
@@ -127,6 +128,7 @@ void cpu_check_irqs(CPUSPARCState *env)
         cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);
     }
 }
+#endif
 
 void sparc_cpu_do_interrupt(CPUState *cs)
 {
-- 
2.51.0
Re: [PATCH 02/18] target/sparc: limit cpu_check_irqs to system emulation
Posted by Philippe Mathieu-Daudé 4 days, 16 hours ago
On 29/8/25 17:28, Paolo Bonzini wrote:
> It is not used by user-mode emulation and is the only caller of
> cpu_interrupt() in qemu-sparc* binaries.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   target/sparc/int32_helper.c | 2 ++
>   target/sparc/int64_helper.c | 2 ++
>   2 files changed, 4 insertions(+)
> 
> diff --git a/target/sparc/int32_helper.c b/target/sparc/int32_helper.c
> index 39db4ffa70a..fdcaa0a578b 100644
> --- a/target/sparc/int32_helper.c
> +++ b/target/sparc/int32_helper.c
> @@ -65,6 +65,7 @@ static const char *excp_name_str(int32_t exception_index)
>       return excp_names[exception_index];
>   }
>   
> +#if !defined(CONFIG_USER_ONLY)
>   void cpu_check_irqs(CPUSPARCState *env)
>   {
>       CPUState *cs;
> @@ -96,6 +97,7 @@ void cpu_check_irqs(CPUSPARCState *env)
>           cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);
>       }
>   }
> +#endif

I'd rather see these moved in system-specific files.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>


Re: [PATCH 02/18] target/sparc: limit cpu_check_irqs to system emulation
Posted by Richard Henderson 1 week ago
On 8/30/25 01:28, Paolo Bonzini wrote:
> It is not used by user-mode emulation and is the only caller of
> cpu_interrupt() in qemu-sparc* binaries.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   target/sparc/int32_helper.c | 2 ++
>   target/sparc/int64_helper.c | 2 ++
>   2 files changed, 4 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>