Skip to contentSkip to conversation

ppc: Implement print_info interface function for the CPU class

PATCH New Nicholas Piggin 1 participant 1 message Mar 31, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc: Implement print_info interface function for the CPU class

PPC CPU has TYPE_INTERRUPT_STATS_PROVIDER interface but it does not implement the print_info function. This causes 'info pic' to print a line like:

Interrupt controller information not available for power10_v2.0-powerpc64-cpu.

Add a print_info panel for CPUs with irq delivery status.

---
 target/ppc/cpu.h         |   3 +
 target/ppc/cpu_init.c    |   1 +
 target/ppc/excp_helper.c | 116 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 120 insertions(+)
target/ppc/cpu.h +3 -0
index ff14f5b8a7f..dca84ca23cd 100644
@@ -27,6 +27,7 @@
 #include "cpu-qom.h"
 #include "qom/object.h"
 #include "hw/registerfields.h"
+#include "hw/intc/intc.h"
 
 #define CPU_RESOLVING_TYPE TYPE_POWERPC_CPU
 
@@ -1604,6 +1605,7 @@ int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
 void ppc_maybe_interrupt(CPUPPCState *env);
 void ppc_cpu_do_interrupt(CPUState *cpu);
 bool ppc_cpu_exec_interrupt(CPUState *cpu, int int_req);
+void ppc_cpu_irq_print_info(InterruptStatsProvider *obj, GString *buf);
 void ppc_cpu_do_system_reset(CPUState *cs);
 void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector);
 extern const VMStateDescription vmstate_ppc_cpu;
@@ -2686,6 +2688,7 @@ enum {
 #endif
 
 /* Hardware exceptions definitions */
+/* Keep powerpc_intr_name in sync */
 enum {
     /* External hardware exception sources */
     PPC_INTERRUPT_RESET     = 0x00001,  /* Reset exception                    */
target/ppc/cpu_init.c +1 -0
index b3d6599abd2..36742136309 100644
@@ -7527,6 +7527,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data)
 #ifndef CONFIG_USER_ONLY
     cc->sysemu_ops = &ppc_sysemu_ops;
     INTERRUPT_STATS_PROVIDER_CLASS(oc)->get_statistics = ppc_get_irq_stats;
+    INTERRUPT_STATS_PROVIDER_CLASS(oc)->print_info = ppc_cpu_irq_print_info;
 
     /* check_prot_access_type relies on MMU access and PAGE bits relations */
     qemu_build_assert(MMU_DATA_LOAD == 0 && MMU_DATA_STORE == 1 &&
target/ppc/excp_helper.c +116 -0

128 lines not on this page · raw message

Signature · 1 line
2.47.1