qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC v2 08/12] target/ppc: Remove unimplemented interrupt code


From: Fabiano Rosas
Subject: [RFC v2 08/12] target/ppc: Remove unimplemented interrupt code
Date: Mon, 20 Dec 2021 15:18:59 -0300

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]