From: Fabiano Rosas <farosas@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: danielhb413@gmail.com, qemu-ppc@nongnu.org, clg@kaod.org,
david@gibson.dropbear.id.au
Subject: [RFC v2 08/12] target/ppc: Remove unimplemented interrupt code
Date: Mon, 20 Dec 2021 15:18:59 -0300 [thread overview]
Message-ID: <20211220181903.3456898-9-farosas@linux.ibm.com> (raw)
In-Reply-To: <20211220181903.3456898-1-farosas@linux.ibm.com>
Now that PPCInterrupt holds the interrupt name, we can remove all
functions that just emitted the "unimplemented" message and leave that
to the error handling at powerpc_excp():
if (!intr->fn) {
cpu_abort(cs, "%s exception is not implemented yet !\n", intr->name);
}
The user visible change here is that the error message shown when QEMU
tries to dispatch an interrupt that has no implementation will change
from a custom one depending on the exception to a standard one (above)
with the interrupt name as defined in interrupts.c.
(I added ITLBE/DTLBE which were not being handled)
Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
---
target/ppc/interrupts.c | 205 ++++------------------------------------
target/ppc/ppc_intr.h | 17 ----
2 files changed, 19 insertions(+), 203 deletions(-)
diff --git a/target/ppc/interrupts.c b/target/ppc/interrupts.c
index 2dd3815167..1e4fb2d6db 100644
--- a/target/ppc/interrupts.c
+++ b/target/ppc/interrupts.c
@@ -334,33 +334,6 @@ void ppc_intr_spe_unavailable(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
env->spr[SPR_BOOKE_ESR] = ESR_SPV;
}
-void ppc_intr_embedded_fp_data(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- CPUPPCState *env = &cpu->env;
-
- /* XXX: TODO */
- cpu_abort(CPU(cpu), "Embedded floating point data exception "
- "is not implemented yet !\n");
- env->spr[SPR_BOOKE_ESR] = ESR_SPV;
-}
-
-void ppc_intr_embedded_fp_round(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- CPUPPCState *env = &cpu->env;
-
- /* XXX: TODO */
- cpu_abort(CPU(cpu), "Embedded floating point round exception "
- "is not implemented yet !\n");
- env->spr[SPR_BOOKE_ESR] = ESR_SPV;
-}
-
-void ppc_intr_embedded_perf_monitor(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- /* XXX: TODO */
- cpu_abort(CPU(cpu),
- "Performance counter exception is not implemented yet !\n");
-}
-
void ppc_intr_embedded_doorbell_crit(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
{
regs->sprn_srr0 = SPR_BOOKE_CSRR0;
@@ -499,24 +472,6 @@ void ppc_intr_programmable_timer(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignor
trace_ppc_excp_print("PIT");
}
-void ppc_intr_io_error(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- /* XXX: TODO */
- cpu_abort(CPU(cpu), "601 IO error exception is not implemented yet !\n");
-}
-
-void ppc_intr_run_mode(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- /* XXX: TODO */
- cpu_abort(CPU(cpu), "601 run mode exception is not implemented yet !\n");
-}
-
-void ppc_intr_emulation(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- /* XXX: TODO */
- cpu_abort(CPU(cpu), "602 emulation trap exception is not implemented yet !\n");
-}
-
void ppc_intr_tlb_miss(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
{
CPUPPCState *env = &cpu->env;
@@ -575,79 +530,6 @@ void ppc_intr_tlb_miss(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
}
}
-void ppc_intr_fpa(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- /* XXX: TODO */
- cpu_abort(CPU(cpu), "Floating point assist exception "
- "is not implemented yet !\n");
-}
-
-void ppc_intr_dabr(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- /* XXX: TODO */
- cpu_abort(CPU(cpu), "DABR exception is not implemented yet !\n");
-}
-
-void ppc_intr_iabr(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- /* XXX: TODO */
- cpu_abort(CPU(cpu), "IABR exception is not implemented yet !\n");
-}
-
-void ppc_intr_smi(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- /* XXX: TODO */
- cpu_abort(CPU(cpu), "SMI exception is not implemented yet !\n");
-}
-
-void ppc_intr_therm(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- /* XXX: TODO */
- cpu_abort(CPU(cpu), "Thermal management exception "
- "is not implemented yet !\n");
-}
-
-void ppc_intr_perfm(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- /* XXX: TODO */
- cpu_abort(CPU(cpu),
- "Performance counter exception is not implemented yet !\n");
-}
-
-void ppc_intr_vpua(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- /* XXX: TODO */
- cpu_abort(CPU(cpu), "VPU assist exception is not implemented yet !\n");
-}
-
-void ppc_intr_softp(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- /* XXX: TODO */
- cpu_abort(CPU(cpu),
- "970 soft-patch exception is not implemented yet !\n");
-}
-
-void ppc_intr_maint(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- /* XXX: TODO */
- cpu_abort(CPU(cpu),
- "970 maintenance exception is not implemented yet !\n");
-}
-
-void ppc_intr_mextbr(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- /* XXX: TODO */
- cpu_abort(CPU(cpu), "Maskable external exception "
- "is not implemented yet !\n");
-}
-
-void ppc_intr_nmextbr(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore)
-{
- /* XXX: TODO */
- cpu_abort(CPU(cpu), "Non maskable external exception "
- "is not implemented yet !\n");
-}
-
PPCInterrupt interrupts[POWERPC_EXCP_NB] = {
[POWERPC_EXCP_ALIGN] = {
"Alignment", ppc_intr_alignment
@@ -657,10 +539,6 @@ PPCInterrupt interrupts[POWERPC_EXCP_NB] = {
"Critical input", ppc_intr_critical
},
- [POWERPC_EXCP_DABR] = {
- "Data address breakpoint", ppc_intr_dabr
- },
-
[POWERPC_EXCP_DEBUG] = {
"Debug", ppc_intr_debug
},
@@ -681,22 +559,6 @@ PPCInterrupt interrupts[POWERPC_EXCP_NB] = {
"Data store TLB error", ppc_intr_tlb_miss
},
- [POWERPC_EXCP_EFPDI] = {
- "Embedded floating-point data", ppc_intr_embedded_fp_data
- },
-
- [POWERPC_EXCP_EFPRI] = {
- "Embedded floating-point round", ppc_intr_embedded_fp_round
- },
-
- [POWERPC_EXCP_EMUL] = {
- "Emulation trap", ppc_intr_emulation
- },
-
- [POWERPC_EXCP_EPERFM] = {
- "Embedded perf. monitor", ppc_intr_embedded_perf_monitor
- },
-
[POWERPC_EXCP_EXTERNAL] = {
"External", ppc_intr_external
},
@@ -705,10 +567,6 @@ PPCInterrupt interrupts[POWERPC_EXCP_NB] = {
"Fixed-interval timer", ppc_intr_fit
},
- [POWERPC_EXCP_FPA] = {
- "Floating-point assist", ppc_intr_fpa
- },
-
[POWERPC_EXCP_FU] = {
"Facility unavailable", ppc_intr_facility_unavail
},
@@ -745,42 +603,18 @@ PPCInterrupt interrupts[POWERPC_EXCP_NB] = {
"Hypervisor facility unavailable" , ppc_intr_hv_facility_unavail
},
- [POWERPC_EXCP_IABR] = {
- "Insn address breakpoint", ppc_intr_iabr
- },
-
[POWERPC_EXCP_IFTLB] = {
"Insn fetch TLB error", ppc_intr_tlb_miss
},
- [POWERPC_EXCP_IO] = {
- "IO error", ppc_intr_io_error
- },
-
[POWERPC_EXCP_ISI] = {
"Instruction storage", ppc_intr_insn_storage
},
- [POWERPC_EXCP_MAINT] = {
- "Maintenance", ppc_intr_maint
- },
-
[POWERPC_EXCP_MCHECK] = {
"Machine check", ppc_intr_machine_check
},
- [POWERPC_EXCP_MEXTBR] = {
- "Maskable external", ppc_intr_mextbr
- },
-
- [POWERPC_EXCP_NMEXTBR] = {
- "Non-maskable external", ppc_intr_nmextbr
- },
-
- [POWERPC_EXCP_PERFM] = {
- "Performance counter", ppc_intr_perfm
- },
-
[POWERPC_EXCP_PIT] = {
"Programmable interval timer", ppc_intr_programmable_timer
},
@@ -793,22 +627,10 @@ PPCInterrupt interrupts[POWERPC_EXCP_NB] = {
"System reset", ppc_intr_system_reset
},
- [POWERPC_EXCP_RUNM] = {
- "Run mode", ppc_intr_run_mode
- },
-
[POWERPC_EXCP_SDOOR_HV] = {
"Hypervisor doorbell", ppc_intr_hv_doorbell
},
- [POWERPC_EXCP_SMI] = {
- "System management", ppc_intr_smi
- },
-
- [POWERPC_EXCP_SOFTP] = {
- "Soft patch", ppc_intr_softp
- },
-
[POWERPC_EXCP_SPEU] = {
"SPE/embedded FP unavailable/VPU", ppc_intr_spe_unavailable
},
@@ -821,14 +643,6 @@ PPCInterrupt interrupts[POWERPC_EXCP_NB] = {
"System call vectored", ppc_intr_system_call_vectored
},
- [POWERPC_EXCP_THERM] = {
- "Thermal management", ppc_intr_therm
- },
-
- [POWERPC_EXCP_VPUA] = {
- "Vector assist", ppc_intr_vpua
- },
-
[POWERPC_EXCP_VPU] = {
"Vector unavailable", ppc_intr_facility_unavail
},
@@ -852,6 +666,25 @@ PPCInterrupt interrupts[POWERPC_EXCP_NB] = {
[POWERPC_EXCP_TRACE] = { "Trace", ppc_intr_noop },
/* Not implemented */
+ [POWERPC_EXCP_DABR] = { "Data address breakpoint" },
+ [POWERPC_EXCP_DTLBE] = { "Data TLB error" },
+ [POWERPC_EXCP_EFPDI] = { "Embedded floating-point data" },
+ [POWERPC_EXCP_EFPRI] = { "Embedded floating-point round" },
+ [POWERPC_EXCP_EMUL] = { "Emulation trap" },
+ [POWERPC_EXCP_EPERFM] = { "Embedded perf. monitor" },
+ [POWERPC_EXCP_FPA] = { "Floating-point assist" },
[POWERPC_EXCP_HV_MAINT] = { "Hypervisor maintenance" },
+ [POWERPC_EXCP_IABR] = { "Insn address breakpoint" },
+ [POWERPC_EXCP_IO] = { "IO error" },
+ [POWERPC_EXCP_ITLBE] = { "Instruction TLB error" },
+ [POWERPC_EXCP_MAINT] = { "Maintenance" },
+ [POWERPC_EXCP_MEXTBR] = { "Maskable external" },
+ [POWERPC_EXCP_NMEXTBR] = { "Non-maskable external" },
+ [POWERPC_EXCP_PERFM] = { "Performance counter" },
+ [POWERPC_EXCP_RUNM] = { "Run mode" },
[POWERPC_EXCP_SDOOR] = { "Server doorbell" },
+ [POWERPC_EXCP_SMI] = { "System management" },
+ [POWERPC_EXCP_SOFTP] = { "Soft patch" },
+ [POWERPC_EXCP_THERM] = { "Thermal management" },
+ [POWERPC_EXCP_VPUA] = { "Vector assist" },
};
diff --git a/target/ppc/ppc_intr.h b/target/ppc/ppc_intr.h
index 82372ca227..a96062c583 100644
--- a/target/ppc/ppc_intr.h
+++ b/target/ppc/ppc_intr.h
@@ -21,18 +21,12 @@ struct PPCInterrupt {
void ppc_intr_alignment(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_critical(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_dabr(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_data_storage(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_debug(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_embedded_doorbell_crit(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_embedded_fp_data(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_embedded_fp_round(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_embedded_perf_monitor(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_emulation(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_external(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_facility_unavail(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_fit(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_fpa(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_hv_data_segment(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_hv_data_storage(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_hv_decrementer(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
@@ -42,27 +36,16 @@ void ppc_intr_hv_facility_unavail(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *igno
void ppc_intr_hv_insn_segment(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_hv_insn_storage(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_hv_virtualization(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_iabr(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_insn_storage(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_io_error(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_machine_check(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_maint(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_mextbr(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_nmextbr(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_noop(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_perfm(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_program(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_programmable_timer(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_run_mode(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_smi(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_softp(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_spe_unavailable(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_system_call(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_system_call_vectored(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_system_reset(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_therm(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_tlb_miss(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
-void ppc_intr_vpua(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
void ppc_intr_watchdog(PowerPCCPU *cpu, PPCIntrArgs *regs, bool *ignore);
extern PPCInterrupt interrupts[POWERPC_EXCP_NB];
--
2.33.1
next prev parent reply other threads:[~2021-12-20 19:49 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-20 18:18 [RFC v2 00/12] target/ppc: powerpc_excp improvements Fabiano Rosas
2021-12-20 18:18 ` [RFC v2 01/12] target/ppc: powerpc_excp: Set alternate SRRs directly Fabiano Rosas
2021-12-21 23:32 ` Richard Henderson
2021-12-22 6:46 ` Cédric Le Goater
2021-12-23 4:39 ` David Gibson
2021-12-20 18:18 ` [RFC v2 02/12] target/ppc: powerpc_excp: Set vector earlier Fabiano Rosas
2021-12-22 6:48 ` Cédric Le Goater
2021-12-25 10:45 ` Nicholas Piggin
2021-12-24 0:11 ` Richard Henderson
2021-12-24 11:14 ` Fabiano Rosas
2021-12-20 18:18 ` [RFC v2 03/12] target/ppc: powerpc_excp: Move system call vectored code together Fabiano Rosas
2021-12-22 6:48 ` Cédric Le Goater
2021-12-24 0:12 ` Richard Henderson
2021-12-20 18:18 ` [RFC v2 04/12] target/ppc: powerpc_excp: Stop passing excp_model around Fabiano Rosas
2021-12-22 6:48 ` Cédric Le Goater
2021-12-24 0:13 ` Richard Henderson
2021-12-25 6:33 ` David Gibson
2021-12-20 18:18 ` [RFC v2 05/12] target/ppc: powerpc_excp: Standardize arguments to interrupt code Fabiano Rosas
2021-12-25 6:35 ` David Gibson
2021-12-27 17:13 ` Fabiano Rosas
2021-12-20 18:18 ` [RFC v2 06/12] target/ppc: Extract interrupt routines into a new file Fabiano Rosas
2021-12-20 18:18 ` [RFC v2 07/12] target/ppc: Introduce PPCInterrupt Fabiano Rosas
2021-12-20 18:18 ` Fabiano Rosas [this message]
2021-12-20 18:19 ` [RFC v2 09/12] target/ppc: Use common code for Hypervisor interrupts Fabiano Rosas
2021-12-20 18:19 ` [RFC v2 10/12] target/ppc: Split powerpc_excp into book3s, booke and 32 bit Fabiano Rosas
2021-12-20 18:19 ` [RFC v2 11/12] target/ppc: Create new files for book3s, booke and ppc32 exception code Fabiano Rosas
2021-12-20 18:19 ` [RFC v2 12/12] target/ppc: Do not enable all interrupts when running KVM Fabiano Rosas
2021-12-26 16:48 ` [RFC v2 00/12] target/ppc: powerpc_excp improvements Cédric Le Goater
2021-12-29 14:18 ` Fabiano Rosas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211220181903.3456898-9-farosas@linux.ibm.com \
--to=farosas@linux.ibm.com \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.