hw/ppc: Prefer HumanReadableText over Monitor
cover hw/ppc: Prefer HumanReadableText over Monitor
Hi,
This series remove uses of Monitor in hw/ppc/, replacing by the more generic HumanReadableText. Care is taken to keep the commit bisectables by updating functions one by one, also easing review.
For rationale see previous series from Daniel:
https://lore.kernel.org/qemu-devel/[email protected]/
Regards,
Phil.
Philippe Mathieu-Daudé (26):
hw/ppc: Avoid using Monitor in pnv_phb3_msi_pic_print_info() hw/ppc: Avoid using Monitor in icp_pic_print_info() hw/ppc: Avoid using Monitor in xive_tctx_pic_print_info() hw/ppc: Avoid using Monitor in ics_pic_print_info() hw/ppc: Avoid using Monitor in PnvChipClass::intc_print_info() hw/ppc: Avoid using Monitor in xive_end_queue_pic_print_info() hw/ppc: Avoid using Monitor in spapr_xive_end_pic_print_info() hw/ppc: Avoid using Monitor in spapr_xive_pic_print_info() hw/ppc: Avoid using Monitor in xive_source_pic_print_info() hw/ppc: Avoid using Monitor in pnv_phb4_pic_print_info() hw/ppc: Avoid using Monitor in xive_eas_pic_print_info() hw/ppc: Avoid using Monitor in xive_end_pic_print_info() hw/ppc: Avoid using Monitor in xive_end_eas_pic_print_info() hw/ppc: Avoid using Monitor in xive_nvt_pic_print_info() hw/ppc: Avoid using Monitor in pnv_xive_pic_print_info() hw/ppc: Avoid using Monitor in pnv_psi_pic_print_info() hw/ppc: Avoid using Monitor in xive2_eas_pic_print_info() hw/ppc: Avoid using Monitor in xive2_end_eas_pic_print_info() hw/ppc: Avoid using Monitor in xive2_end_queue_pic_print_info() hw/ppc: Avoid using Monitor in xive2_end_pic_print_info() hw/ppc: Avoid using Monitor in xive2_nvp_pic_print_info() hw/ppc: Avoid using Monitor in pnv_xive2_pic_print_info() hw/ppc: Avoid using Monitor in
SpaprInterruptControllerClass::print_info()
hw/ppc: Avoid using Monitor in spapr_irq_print_info() hw/ppc: Avoid using Monitor in pnv_chip_power9_pic_print_info_child() hw/ppc: Avoid using Monitor in pic_print_info()
include/hw/pci-host/pnv_phb3.h | 2 +- include/hw/pci-host/pnv_phb4.h | 2 +- include/hw/ppc/pnv_chip.h | 4 +- include/hw/ppc/pnv_psi.h | 2 +- include/hw/ppc/pnv_xive.h | 4 +- include/hw/ppc/spapr_irq.h | 4 +- include/hw/ppc/xics.h | 4 +- include/hw/ppc/xive.h | 4 +- include/hw/ppc/xive2_regs.h | 8 +-- include/hw/ppc/xive_regs.h | 8 +-- hw/intc/pnv_xive.c | 38 ++++++------ hw/intc/pnv_xive2.c | 48 +++++++-------- hw/intc/spapr_xive.c | 41 ++++++------- hw/intc/xics.c | 25 ++++---- hw/intc/xics_spapr.c | 7 +-- hw/intc/xive.c | 108 ++++++++++++++++----------------- hw/intc/xive2.c | 87 +++++++++++++------------- hw/pci-host/pnv_phb3_msi.c | 21 +++---- hw/pci-host/pnv_phb4.c | 17 +++--- hw/ppc/pnv.c | 52 ++++++++-------- hw/ppc/pnv_psi.c | 9 ++- hw/ppc/spapr.c | 11 +++- hw/ppc/spapr_irq.c | 4 +- 23 files changed, 256 insertions(+), 254 deletions(-)
Signature · 1 line
2.41.0
PATCH 1/26 hw/ppc: Avoid using Monitor in pnv_phb3_msi_pic_print_info()
Replace Monitor API by HumanReadableText one.
--- include/hw/pci-host/pnv_phb3.h | 2 +- hw/pci-host/pnv_phb3_msi.c | 21 ++++++++++----------- hw/ppc/pnv.c | 8 +++++++- 3 files changed, 18 insertions(+), 13 deletions(-)
include/hw/pci-host/pnv_phb3.h +1 -1
@@ -40,7 +40,7 @@ void pnv_phb3_msi_update_config(Phb3MsiState *msis, uint32_t base,void pnv_phb3_msi_send (Phb3MsiState *msis,uint64_t addr,uint16_t data,int32_t dev_pe);void pnv_phb3_msi_ffi (Phb3MsiState *msis,uint64_t val); -void pnv_phb3_msi_pic_print_info (Phb3MsiState *msis,Monitor *mon); +void pnv_phb3_msi_pic_print_info (Phb3MsiState *msis,GString *buf);/*
hw/pci-host/pnv_phb3_msi.c +10 -11
@@ -13,7 +13,6 @@#include "hw/pci-host/pnv_phb3.h" #include "hw/ppc/pnv.h" #include "hw/pci/msi.h" -#include "monitor/monitor.h" #include "hw/irq.h" #include "hw/qdev-properties.h" #include "sysemu/reset.h"
@@ -316,13 +315,13 @@ static void pnv_phb3_msi_register_types(void)type_init (pnv_phb3_msi_register_types); -void pnv_phb3_msi_pic_print_info (Phb3MsiState *msi,Monitor *mon) +void pnv_phb3_msi_pic_print_info (Phb3MsiState *msi,GString *buf) {ICSState *ics =ICS (msi);int i; -monitor_printf (mon,"ICS %4x..%4x %p\n" , - ics->offset, ics->offset + ics->nr_irqs -1 , ics); +g_string_append_printf (buf,"ICS %4x..%4x %p\n" , + ics->offset, ics->offset + ics->nr_irqs -1 , ics);for (i =0 ; i < ics->nr_irqs; i++) {uint64_t ive;
@@ -335,12 +334,12 @@ void pnv_phb3_msi_pic_print_info(Phb3MsiState *msi, Monitor *mon)continue ; } -monitor_printf (mon," %4x %c%c server=%04x prio=%02x gen=%d\n" , - ics->offset + i, -GETFIELD (IODA2_IVT_P , ive) ?'P' :'-' , -GETFIELD (IODA2_IVT_Q , ive) ?'Q' :'-' , - (uint32_t )GETFIELD (IODA2_IVT_SERVER , ive) >>2 , - (uint32_t )GETFIELD (IODA2_IVT_PRIORITY , ive), - (uint32_t )GETFIELD (IODA2_IVT_GEN , ive)); +g_string_append_printf (buf," %4x %c%c server=%04x prio=%02x gen=%d\n" , + ics->offset + i, +GETFIELD (IODA2_IVT_P , ive) ?'P' :'-' , +GETFIELD (IODA2_IVT_Q , ive) ?'Q' :'-' , + (uint32_t )GETFIELD (IODA2_IVT_SERVER , ive) >>2 , + (uint32_t )GETFIELD (IODA2_IVT_PRIORITY , ive), + (uint32_t )GETFIELD (IODA2_IVT_GEN , ive)); } }
hw/ppc/pnv.c +7 -1
@@ -38,6 +38,7 @@#include "hw/loader.h" #include "hw/nmi.h" #include "qapi/visitor.h" +#include "qapi/type-helpers.h" #include "monitor/monitor.h" #include "hw/intc/intc.h" #include "hw/ipmi/ipmi.h"
@@ -774,8 +775,13 @@ static void pnv_chip_power8_pic_print_info(PnvChip *chip, Monitor *mon)for (i =0 ; i < chip8->num_phbs; i++) {PnvPHB *phb = chip8->phbs[i];PnvPHB3 *phb3 =PNV_PHB3 (phb->backend); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ; + +pnv_phb3_msi_pic_print_info (&phb3->msis, buf); + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); -pnv_phb3_msi_pic_print_info (&phb3->msis, mon);ics_pic_print_info (&phb3->lsis, mon); } }
Signature · 1 line
2.41.0
Re: [PATCH 01/26] hw/ppc: Avoid using Monitor in pnv_phb3_msi_pic_print_info()
Quoted 3 lines · Philippe Mathieu-Daudé
Replace Monitor API by HumanReadableText one.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Quoted 95 lines
--- include/hw/pci-host/pnv_phb3.h | 2 +- hw/pci-host/pnv_phb3_msi.c | 21 ++++++++++----------- hw/ppc/pnv.c | 8 +++++++- 3 files changed, 18 insertions(+), 13 deletions(-)include/hw/pci-host/pnv_phb3.h +1
-1@@ -40,7 +40,7 @@ void pnv_phb3_msi_update_config(Phb3MsiState *msis, uint32_t base,void pnv_phb3_msi_send (Phb3MsiState *msis,uint64_t addr,uint16_t data,int32_t dev_pe);void pnv_phb3_msi_ffi (Phb3MsiState *msis,uint64_t val); -void pnv_phb3_msi_pic_print_info (Phb3MsiState *msis,Monitor *mon); +void pnv_phb3_msi_pic_print_info (Phb3MsiState *msis,GString *buf);/* hw/pci-host/pnv_phb3_msi.c +10
-11@@ -13,7 +13,6 @@#include "hw/pci-host/pnv_phb3.h" #include "hw/ppc/pnv.h" #include "hw/pci/msi.h" -#include "monitor/monitor.h" #include "hw/irq.h" #include "hw/qdev-properties.h" #include "sysemu/reset.h" @@ -316,13 +315,13 @@ static void pnv_phb3_msi_register_types(void)type_init (pnv_phb3_msi_register_types); -void pnv_phb3_msi_pic_print_info (Phb3MsiState *msi,Monitor *mon) +void pnv_phb3_msi_pic_print_info (Phb3MsiState *msi,GString *buf) {ICSState *ics =ICS (msi);int i; -monitor_printf (mon,"ICS %4x..%4x %p\n" , - ics->offset, ics->offset + ics->nr_irqs -1 , ics); +g_string_append_printf (buf,"ICS %4x..%4x %p\n" , + ics->offset, ics->offset + ics->nr_irqs -1 , ics);for (i =0 ; i < ics->nr_irqs; i++) {uint64_t ive;@@ -335,12 +334,12 @@ void pnv_phb3_msi_pic_print_info(Phb3MsiState *msi, Monitor *mon)continue ; } -monitor_printf (mon," %4x %c%c server=%04x prio=%02x gen=%d\n" , - ics->offset + i, -GETFIELD (IODA2_IVT_P , ive) ?'P' :'-' , -GETFIELD (IODA2_IVT_Q , ive) ?'Q' :'-' , - (uint32_t )GETFIELD (IODA2_IVT_SERVER , ive) >>2 , - (uint32_t )GETFIELD (IODA2_IVT_PRIORITY , ive), - (uint32_t )GETFIELD (IODA2_IVT_GEN , ive)); +g_string_append_printf (buf," %4x %c%c server=%04x prio=%02x gen=%d\n" , + ics->offset + i, +GETFIELD (IODA2_IVT_P , ive) ?'P' :'-' , +GETFIELD (IODA2_IVT_Q , ive) ?'Q' :'-' , + (uint32_t )GETFIELD (IODA2_IVT_SERVER , ive) >>2 , + (uint32_t )GETFIELD (IODA2_IVT_PRIORITY , ive), + (uint32_t )GETFIELD (IODA2_IVT_GEN , ive)); } }hw/ppc/pnv.c +7
-1@@ -38,6 +38,7 @@#include "hw/loader.h" #include "hw/nmi.h" #include "qapi/visitor.h" +#include "qapi/type-helpers.h" #include "monitor/monitor.h" #include "hw/intc/intc.h" #include "hw/ipmi/ipmi.h" @@ -774,8 +775,13 @@ static void pnv_chip_power8_pic_print_info(PnvChip *chip, Monitor *mon)for (i =0 ; i < chip8->num_phbs; i++) {PnvPHB *phb = chip8->phbs[i];PnvPHB3 *phb3 =PNV_PHB3 (phb->backend); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ; + +pnv_phb3_msi_pic_print_info (&phb3->msis, buf); + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); -pnv_phb3_msi_pic_print_info (&phb3->msis, mon);ics_pic_print_info (&phb3->lsis, mon); } }
Re: [PATCH 01/26] hw/ppc: Avoid using Monitor in pnv_phb3_msi_pic_print_info()
Hi Phillipe,
One query below:
Quoted 15 lines · Harsh Prateek Bora
Quoted 3 lines · Philippe Mathieu-Daudé
Replace Monitor API by HumanReadableText one.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Harsh Prateek Bora <[email protected]>Quoted 6 lines
---
include/hw/pci-host/pnv_phb3.h| 2 +- hw/pci-host/pnv_phb3_msi.c | 21 ++++++++++----------- hw/ppc/pnv.c | 8 +++++++-3 files changed, 18 insertions(+), 13 deletions(-)
<snip>
Quoted 17 lines
Quoted 17 lines
hw/ppc/pnv.c +1
-0@@ -38,6 +38,7 @@ #include "hw/loader.h" #include "hw/nmi.h" #include "qapi/visitor.h" +#include "qapi/type-helpers.h" #include "monitor/monitor.h" #include "hw/intc/intc.h" #include "hw/ipmi/ipmi.h"@@ -774,8 +775,13 @@ static void pnv_chip_power8_pic_print_info(PnvChip *chip, Monitor *mon) for (i = 0; i < chip8->num_phbs; i++) { PnvPHB *phb = chip8->phbs[i]; PnvPHB3 *phb3 = PNV_PHB3(phb->backend);
Quoted 8 lines
hw/ppc/pnv.c static void pnv_chip_power8_pic_print_info(PnvChip *chip, Monitor *mon) · line 785
Quoted 8 lines
hw/ppc/pnv.c +6
-1+ g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; + + pnv_phb3_msi_pic_print_info(&phb3->msis, buf); + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); - pnv_phb3_msi_pic_print_info(&phb3->msis, mon); ics_pic_print_info(&phb3->lsis, mon);
How is the memory allocated to info in human_readable_text_from_str being reclaimed here? Isnt it a mem leak ?
Thanks
Harsh
Quoted 3 lines
Quoted 2 lines
hw/ppc/pnv.c +0
-0} }
Re: [PATCH 01/26] hw/ppc: Avoid using Monitor in pnv_phb3_msi_pic_print_info()
Quoted 42 lines · Harsh Prateek Bora
Hi Phillipe,
One query below:
Quoted 15 lines · Harsh Prateek Bora
Quoted 3 lines · Philippe Mathieu-Daudé
Replace Monitor API by HumanReadableText one.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Harsh Prateek Bora <[email protected]>Quoted 6 lines
---
include/hw/pci-host/pnv_phb3.h| 2 +- hw/pci-host/pnv_phb3_msi.c | 21 ++++++++++----------- hw/ppc/pnv.c | 8 +++++++-3 files changed, 18 insertions(+), 13 deletions(-)<snip>
Quoted 19 lines
Quoted 19 lines
hw/ppc/pnv.c +3
-0@@ -38,6 +38,7 @@ #include "hw/loader.h" #include "hw/nmi.h" #include "qapi/visitor.h" +#include "qapi/type-helpers.h" #include "monitor/monitor.h" #include "hw/intc/intc.h" #include "hw/ipmi/ipmi.h"@@ -774,8 +775,13 @@ static void pnv_chip_power8_pic_print_info(PnvChip *chip, Monitor *mon) for (i = 0; i < chip8->num_phbs; i++) { PnvPHB *phb = chip8->phbs[i]; PnvPHB3 *phb3 = PNV_PHB3(phb->backend); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL;
Quoted 9 lines
Quoted 6 lines
hw/ppc/pnv.c static void pnv_chip_power8_pic_print_info(PnvChip *chip, Monitor *mon) · line 785
Quoted 6 lines
hw/ppc/pnv.c +4
-1+ + pnv_phb3_msi_pic_print_info(&phb3->msis, buf); + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); - pnv_phb3_msi_pic_print_info(&phb3->msis, mon); ics_pic_print_info(&phb3->lsis, mon);How is the memory allocated to info in
human_readable_text_from_strbeing reclaimed here? Isnt it a mem leak ?
Ok, I see, g_autoptr takes care of auto cleanup. Please ignore.
Quoted 6 lines
Thanks
HarshQuoted 3 lines
Quoted 2 lines
hw/ppc/pnv.c +0
-0} }
PATCH 2/26 hw/ppc: Avoid using Monitor in icp_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/xics.h | 2 +- hw/intc/xics.c | 8 ++++---- hw/intc/xics_spapr.c | 8 +++++++- hw/ppc/pnv.c | 8 +++++++- 4 files changed, 19 insertions(+), 7 deletions(-)
include/hw/ppc/xics.h +1 -1
@@ -171,7 +171,7 @@ static inline bool ics_irq_free(ICSState *ics, uint32_t srcno) }void ics_set_irq_type (ICSState *ics,int srcno,bool lsi); -void icp_pic_print_info (ICPState *icp,Monitor *mon); +void icp_pic_print_info (ICPState *icp,GString *buf);void ics_pic_print_info (ICSState *ics,Monitor *mon);void ics_resend (ICSState *ics);
hw/intc/xics.c +4 -4
@@ -42,7 +42,7 @@#include "sysemu/reset.h" #include "target/ppc/cpu.h" -void icp_pic_print_info (ICPState *icp,Monitor *mon) +void icp_pic_print_info (ICPState *icp,GString *buf) {int cpu_index;
@@ -63,9 +63,9 @@ void icp_pic_print_info(ICPState *icp, Monitor *mon)icp_synchronize_state (icp); } -monitor_printf (mon,"CPU %d XIRR=%08x (%p) PP=%02x MFRR=%02x\n" , - cpu_index, icp->xirr, icp->xirr_owner, - icp->pending_priority, icp->mfrr); +g_string_append_printf (buf,"CPU %d XIRR=%08x (%p) PP=%02x MFRR=%02x\n" , + cpu_index, icp->xirr, icp->xirr_owner, + icp->pending_priority, icp->mfrr); }void ics_pic_print_info (ICSState *ics,Monitor *mon)
hw/intc/xics_spapr.c +7 -1
@@ -34,6 +34,8 @@#include "hw/ppc/xics_spapr.h" #include "hw/ppc/fdt.h" #include "qapi/visitor.h" +#include "qapi/type-helpers.h" +#include "monitor/monitor.h" /* * Guest interfaces
@@ -399,12 +401,16 @@ static void xics_spapr_print_info(SpaprInterruptController *intc, Monitor *mon) {ICSState *ics =ICS_SPAPR (intc);CPUState *cs; +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ;CPU_FOREACH (cs) {PowerPCCPU *cpu =POWERPC_CPU (cs); -icp_pic_print_info (spapr_cpu_state (cpu)->icp, mon); +icp_pic_print_info (spapr_cpu_state (cpu)->icp, buf); } + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text);ics_pic_print_info (ics, mon); }
hw/ppc/pnv.c +7 -1
@@ -1130,7 +1130,13 @@ static void pnv_chip_power8_intc_destroy(PnvChip *chip, PowerPCCPU *cpu)static void pnv_chip_power8_intc_print_info (PnvChip *chip,PowerPCCPU *cpu,Monitor *mon) { -icp_pic_print_info (ICP (pnv_cpu_state (cpu)->intc), mon); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ; + +icp_pic_print_info (ICP (pnv_cpu_state (cpu)->intc), buf); + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); }/*
Signature · 1 line
2.41.0
PATCH 3/26 hw/ppc: Avoid using Monitor in xive_tctx_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/xive.h | 2 +- hw/intc/spapr_xive.c | 7 ++++++- hw/intc/xive.c | 11 ++++++----- hw/ppc/pnv.c | 16 ++++++++++++++-- 4 files changed, 27 insertions(+), 9 deletions(-)
include/hw/ppc/xive.h +1 -1
@@ -528,7 +528,7 @@ void xive_tctx_tm_write(XivePresenter *xptr, XiveTCTX *tctx, hwaddr offset,uint64_t xive_tctx_tm_read (XivePresenter *xptr,XiveTCTX *tctx,hwaddr offset,unsigned size); -void xive_tctx_pic_print_info (XiveTCTX *tctx,Monitor *mon); +void xive_tctx_pic_print_info (XiveTCTX *tctx,GString *buf);Object *xive_tctx_create (Object *cpu,XivePresenter *xptr,Error **errp);void xive_tctx_reset (XiveTCTX *tctx);void xive_tctx_destroy (XiveTCTX *tctx);
hw/intc/spapr_xive.c +6 -1
@@ -11,6 +11,7 @@#include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/type-helpers.h" #include "qemu/error-report.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h"
@@ -703,12 +704,16 @@ static void spapr_xive_print_info(SpaprInterruptController *intc, Monitor *mon) {SpaprXive *xive =SPAPR_XIVE (intc);CPUState *cs; +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ;CPU_FOREACH (cs) {PowerPCCPU *cpu =POWERPC_CPU (cs); -xive_tctx_pic_print_info (spapr_cpu_state (cpu)->tctx, mon); +xive_tctx_pic_print_info (spapr_cpu_state (cpu)->tctx, buf); } + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text);spapr_xive_pic_print_info (xive, mon); }
hw/intc/xive.c +6 -5
@@ -669,7 +669,7 @@ static const char * const xive_tctx_ring_names[] = { xpc->in_kernel ? xpc->in_kernel (xptr) : false; \ })) -void xive_tctx_pic_print_info (XiveTCTX *tctx,Monitor *mon) +void xive_tctx_pic_print_info (XiveTCTX *tctx,GString *buf) {int cpu_index;int i;
@@ -693,13 +693,14 @@ void xive_tctx_pic_print_info(XiveTCTX *tctx, Monitor *mon) } } -monitor_printf (mon,"CPU[%04x]: QW NSR CPPR IPB LSMFB ACK# INC AGE PIPR" -" W2\n" , cpu_index); +g_string_append_printf (buf,"CPU[%04x]: " +"QW NSR CPPR IPB LSMFB ACK# INC AGE PIPR W2\n" , + cpu_index);for (i =0 ; i <XIVE_TM_RING_COUNT ; i++) {char *s =xive_tctx_ring_print (&tctx->regs[i *XIVE_TM_RING_SIZE ]); -monitor_printf (mon,"CPU[%04x]: %4s %s\n" , cpu_index, - xive_tctx_ring_names[i], s); +g_string_append_printf (buf,"CPU[%04x]: %4s %s\n" , + cpu_index, xive_tctx_ring_names[i], s);g_free (s); } }
hw/ppc/pnv.c +14 -2
@@ -1223,7 +1223,13 @@ static void pnv_chip_power9_intc_destroy(PnvChip *chip, PowerPCCPU *cpu)static void pnv_chip_power9_intc_print_info (PnvChip *chip,PowerPCCPU *cpu,Monitor *mon) { -xive_tctx_pic_print_info (XIVE_TCTX (pnv_cpu_state (cpu)->intc), mon); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ; + +xive_tctx_pic_print_info (XIVE_TCTX (pnv_cpu_state (cpu)->intc), buf); + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); } static void pnv_chip_power10_intc_create(PnvChip *chip, PowerPCCPU *cpu,
@@ -1267,7 +1273,13 @@ static void pnv_chip_power10_intc_destroy(PnvChip *chip, PowerPCCPU *cpu)static void pnv_chip_power10_intc_print_info (PnvChip *chip,PowerPCCPU *cpu,Monitor *mon) { -xive_tctx_pic_print_info (XIVE_TCTX (pnv_cpu_state (cpu)->intc), mon); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ; + +xive_tctx_pic_print_info (XIVE_TCTX (pnv_cpu_state (cpu)->intc), buf); + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); }/*
Signature · 1 line
2.41.0
Re: [PATCH 03/26] hw/ppc: Avoid using Monitor in xive_tctx_pic_print_info()
Hi Phillipe,
Quoted 23 lines · Philippe Mathieu-Daudé
hw/ppc/pnv.c +7
-1@@ -1223,7 +1223,13 @@ static void pnv_chip_power9_intc_destroy(PnvChip *chip, PowerPCCPU *cpu)static void pnv_chip_power9_intc_print_info (PnvChip *chip,PowerPCCPU *cpu,Monitor *mon) { -xive_tctx_pic_print_info (XIVE_TCTX (pnv_cpu_state (cpu)->intc), mon); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ; + +xive_tctx_pic_print_info (XIVE_TCTX (pnv_cpu_state (cpu)->intc), buf); + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); } static void pnv_chip_power10_intc_create(PnvChip *chip, PowerPCCPU *cpu,@@ -1267,7 +1273,13 @@ static void pnv_chip_power10_intc_destroy(PnvChip *chip, PowerPCCPU *cpu)static void pnv_chip_power10_intc_print_info (PnvChip *chip,PowerPCCPU *cpu,Monitor *mon) {
hw/ppc/pnv.c static void pnv_chip_power10_intc_destroy(PnvChip *chip, PowerPCCPU *cpu) · line 1284
Quoted 10 lines
hw/ppc/pnv.c +7
-1-xive_tctx_pic_print_info (XIVE_TCTX (pnv_cpu_state (cpu)->intc), mon); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ; + +xive_tctx_pic_print_info (XIVE_TCTX (pnv_cpu_state (cpu)->intc), buf); + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); }
We have an existing code duplication in above two routines which is getting worse with these multi-lines getting duplicated. Could _power9_ be changed to inline and called from _power10_ as well?
Thanks
Harsh
Re: [PATCH 03/26] hw/ppc: Avoid using Monitor in xive_tctx_pic_print_info()
Hi Harsh,
Quoted 28 lines · Harsh Prateek Bora
Quoted 27 lines · Philippe Mathieu-Daudé
hw/ppc/pnv.c +9
-2@@ -1223,7 +1223,13 @@ static void pnv_chip_power9_intc_destroy(PnvChip *chip, PowerPCCPU *cpu) static void pnv_chip_power9_intc_print_info(PnvChip *chip, PowerPCCPU *cpu, Monitor *mon) { - xive_tctx_pic_print_info(XIVE_TCTX(pnv_cpu_state(cpu)->intc), mon); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL; + + xive_tctx_pic_print_info(XIVE_TCTX(pnv_cpu_state(cpu)->intc), buf); + + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); } static void pnv_chip_power10_intc_create(PnvChip *chip, PowerPCCPU *cpu,@@ -1267,7 +1273,13 @@ static void pnv_chip_power10_intc_destroy(PnvChip *chip, PowerPCCPU *cpu) static void pnv_chip_power10_intc_print_info(PnvChip *chip, PowerPCCPU *cpu, Monitor *mon) { - xive_tctx_pic_print_info(XIVE_TCTX(pnv_cpu_state(cpu)->intc), mon); + g_autoptr(GString) buf = g_string_new(""); + g_autoptr(HumanReadableText) info = NULL;
Quoted 8 lines
hw/ppc/pnv.c static void pnv_chip_power9_intc_destroy(PnvChip *chip, PowerPCCPU *cpu) · line 1233
Quoted 6 lines
hw/ppc/pnv.c +5
-0+ + xive_tctx_pic_print_info(XIVE_TCTX(pnv_cpu_state(cpu)->intc), buf); + + info = human_readable_text_from_str(buf); + monitor_puts(mon, info->human_readable_text); }We have an existing code duplication in above two routines which is getting worse with these multi-lines getting duplicated. Could _power9_ be changed to inline and called from _power10_ as well?
The duplicated lines get removed later. This series is a mere API upgrade, the final diff is smaller (although harder to review, which is why I did it with many trivial patches).
_power9_ / _power10_ simplification could be done but as a separate patch from this series, since different matter IMHO.
Thanks for your reviews!
Phil.
PATCH 4/26 hw/ppc: Avoid using Monitor in ics_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/xics.h | 2 +- hw/intc/xics.c | 17 ++++++++--------- hw/intc/xics_spapr.c | 4 ++-- hw/ppc/pnv.c | 15 ++++++++------- 4 files changed, 19 insertions(+), 19 deletions(-)
include/hw/ppc/xics.h +1 -1
@@ -172,7 +172,7 @@ static inline bool ics_irq_free(ICSState *ics, uint32_t srcno)void ics_set_irq_type (ICSState *ics,int srcno,bool lsi);void icp_pic_print_info (ICPState *icp,GString *buf); -void ics_pic_print_info (ICSState *ics,Monitor *mon); +void ics_pic_print_info (ICSState *ics,GString *buf);void ics_resend (ICSState *ics);void icp_resend (ICPState *ss);
hw/intc/xics.c +8 -9
@@ -35,7 +35,6 @@#include "qemu/module.h" #include "qapi/visitor.h" #include "migration/vmstate.h" -#include "monitor/monitor.h" #include "hw/intc/intc.h" #include "hw/irq.h" #include "sysemu/kvm.h"
@@ -68,12 +67,12 @@ void icp_pic_print_info(ICPState *icp, GString *buf) icp->pending_priority, icp->mfrr); } -void ics_pic_print_info (ICSState *ics,Monitor *mon) +void ics_pic_print_info (ICSState *ics,GString *buf) {uint32_t i; -monitor_printf (mon,"ICS %4x..%4x %p\n" , - ics->offset, ics->offset + ics->nr_irqs -1 , ics); +g_string_append_printf (buf,"ICS %4x..%4x %p\n" , + ics->offset, ics->offset + ics->nr_irqs -1 , ics);if (!ics->irqs) {return ;
@@ -89,11 +88,11 @@ void ics_pic_print_info(ICSState *ics, Monitor *mon)if (!(irq->flags &XICS_FLAGS_IRQ_MASK )) {continue ; } -monitor_printf (mon," %4x %s %02x %02x\n" , - ics->offset + i, - (irq->flags &XICS_FLAGS_IRQ_LSI ) ? -"LSI" :"MSI" , - irq->priority, irq->status); +g_string_append_printf (buf," %4x %s %02x %02x\n" , + ics->offset + i, + (irq->flags &XICS_FLAGS_IRQ_LSI ) ? +"LSI" :"MSI" , + irq->priority, irq->status); } }
hw/intc/xics_spapr.c +2 -2
@@ -409,10 +409,10 @@ static void xics_spapr_print_info(SpaprInterruptController *intc, Monitor *mon)icp_pic_print_info (spapr_cpu_state (cpu)->icp, buf); } +ics_pic_print_info (ics, buf); + info =human_readable_text_from_str (buf);monitor_puts (mon, info->human_readable_text); - -ics_pic_print_info (ics, mon); }static int xics_spapr_post_load (SpaprInterruptController *intc,int version_id)
hw/ppc/pnv.c +8 -7
@@ -770,20 +770,21 @@ static void pnv_chip_power8_pic_print_info(PnvChip *chip, Monitor *mon)Pnv8Chip *chip8 =PNV8_CHIP (chip);int i; -ics_pic_print_info (&chip8->psi.ics, mon); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ; + +ics_pic_print_info (&chip8->psi.ics, buf);for (i =0 ; i < chip8->num_phbs; i++) {PnvPHB *phb = chip8->phbs[i];PnvPHB3 *phb3 =PNV_PHB3 (phb->backend); -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ;pnv_phb3_msi_pic_print_info (&phb3->msis, buf); - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); - -ics_pic_print_info (&phb3->lsis, mon); +ics_pic_print_info (&phb3->lsis, buf); } + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); }static int pnv_chip_power9_pic_print_info_child (Object *child,void *opaque)
Signature · 1 line
2.41.0
PATCH 5/26 hw/ppc: Avoid using Monitor in PnvChipClass::intc_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/pnv_chip.h | 2 +- hw/ppc/pnv.c | 30 ++++++++---------------------- 2 files changed, 9 insertions(+), 23 deletions(-)
include/hw/ppc/pnv_chip.h +1 -1
@@ -151,7 +151,7 @@ struct PnvChipClass {void (*intc_create)(PnvChip *chip,PowerPCCPU *cpu,Error **errp);void (*intc_reset)(PnvChip *chip,PowerPCCPU *cpu);void (*intc_destroy)(PnvChip *chip,PowerPCCPU *cpu); -void (*intc_print_info)(PnvChip *chip,PowerPCCPU *cpu,Monitor *mon); +void (*intc_print_info)(PnvChip *chip,PowerPCCPU *cpu,GString *buf); ISABus *(*isa_create)(PnvChip *chip, Error **errp);void (*dt_populate)(PnvChip *chip,void *fdt);void (*pic_print_info)(PnvChip *chip,Monitor *mon);
hw/ppc/pnv.c +8 -22
@@ -1129,15 +1129,9 @@ static void pnv_chip_power8_intc_destroy(PnvChip *chip, PowerPCCPU *cpu) }static void pnv_chip_power8_intc_print_info (PnvChip *chip,PowerPCCPU *cpu, -Monitor *mon) +GString *buf) { -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ; -icp_pic_print_info (ICP (pnv_cpu_state (cpu)->intc), buf); - - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); }/*
@@ -1222,15 +1216,9 @@ static void pnv_chip_power9_intc_destroy(PnvChip *chip, PowerPCCPU *cpu) }static void pnv_chip_power9_intc_print_info (PnvChip *chip,PowerPCCPU *cpu, -Monitor *mon) +GString *buf) { -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ; -xive_tctx_pic_print_info (XIVE_TCTX (pnv_cpu_state (cpu)->intc), buf); - - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); } static void pnv_chip_power10_intc_create(PnvChip *chip, PowerPCCPU *cpu,
@@ -1272,15 +1260,9 @@ static void pnv_chip_power10_intc_destroy(PnvChip *chip, PowerPCCPU *cpu) }static void pnv_chip_power10_intc_print_info (PnvChip *chip,PowerPCCPU *cpu, -Monitor *mon) +GString *buf) { -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ; -xive_tctx_pic_print_info (XIVE_TCTX (pnv_cpu_state (cpu)->intc), buf); - - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); }/*
@@ -2363,14 +2345,18 @@ static void pnv_pic_print_info(InterruptStatsProvider *obj,PnvMachineState *pnv =PNV_MACHINE (obj);int i;CPUState *cs; +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ;CPU_FOREACH (cs) {PowerPCCPU *cpu =POWERPC_CPU (cs);/* XXX: loop on each chip/core/thread instead of CPU_FOREACH() */ PNV_CHIP_GET_CLASS (pnv->chips[0 ])->intc_print_info (pnv->chips[0 ], cpu, - mon); + buf); } + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text);for (i =0 ; i < pnv->num_chips; i++) {PNV_CHIP_GET_CLASS (pnv->chips[i])->pic_print_info (pnv->chips[i], mon);
Signature · 1 line
2.41.0
PATCH 6/26 hw/ppc: Avoid using Monitor in xive_end_queue_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/xive_regs.h | 2 +- hw/intc/spapr_xive.c | 7 ++++++- hw/intc/xive.c | 17 +++++++++++------ 3 files changed, 18 insertions(+), 8 deletions(-)
include/hw/ppc/xive_regs.h +1 -1
@@ -262,7 +262,7 @@ static inline uint64_t xive_end_qaddr(XiveEND *end) }void xive_end_pic_print_info (XiveEND *end,uint32_t end_idx,Monitor *mon); -void xive_end_queue_pic_print_info (XiveEND *end,uint32_t width,Monitor *mon); +void xive_end_queue_pic_print_info (XiveEND *end,uint32_t width,GString *buf);void xive_end_eas_pic_print_info (XiveEND *end,uint32_t end_idx,Monitor *mon);/* Notification Virtual Target (NVT) */
hw/intc/spapr_xive.c +6 -1
@@ -142,12 +142,17 @@ static void spapr_xive_end_pic_print_info(SpaprXive *xive, XiveEND *end,uint32_t qentries =1 << (qsize +10 );uint32_t nvt =xive_get_field32 (END_W6_NVT_INDEX , end->w6);uint8_t priority =xive_get_field32 (END_W7_F0_PRIORITY , end->w7); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ;monitor_printf (mon,"%3d/%d % 6d/%5d @%" PRIx64" ^%d" ,spapr_xive_nvt_to_target (0 , nvt), priority, qindex, qentries, qaddr_base, qgen); -xive_end_queue_pic_print_info (end,6 , mon); +xive_end_queue_pic_print_info (end,6 , buf); + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); }/*
hw/intc/xive.c +11 -6
@@ -11,6 +11,7 @@#include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h"
@@ -1323,7 +1324,7 @@ static const TypeInfo xive_source_info = {* XiveEND helpers */ -void xive_end_queue_pic_print_info (XiveEND *end,uint32_t width,Monitor *mon) +void xive_end_queue_pic_print_info (XiveEND *end,uint32_t width,GString *buf) {uint64_t qaddr_base =xive_end_qaddr (end);uint32_t qsize =xive_get_field32 (END_W0_QSIZE , end->w0);
@@ -1334,7 +1335,7 @@ void xive_end_queue_pic_print_info(XiveEND *end, uint32_t width, Monitor *mon)/* * print out the [ (qindex - (width - 1)) .. (qindex + 1)] window */ -monitor_printf (mon," [ " ); +g_string_append_printf (buf," [ " ); qindex = (qindex - (width -1 )) & (qentries -1 );for (i =0 ; i < width; i++) {uint64_t qaddr = qaddr_base + (qindex <<2 );
@@ -1346,11 +1347,11 @@ void xive_end_queue_pic_print_info(XiveEND *end, uint32_t width, Monitor *mon) HWADDR_PRIx "\n", qaddr);return ; } -monitor_printf (mon,"%s%08x " , i == width -1 ?"^" :"" , -be32_to_cpu (qdata)); +g_string_append_printf (buf,"%s%08x " , i == width -1 ?"^" :"" , +be32_to_cpu (qdata)); qindex = (qindex +1 ) & (qentries -1 ); } -monitor_printf (mon,"]" ); +g_string_append_c (buf,']' ); }void xive_end_pic_print_info (XiveEND *end,uint32_t end_idx,Monitor *mon)
@@ -1365,6 +1366,8 @@ void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon)uint32_t nvt_idx =xive_get_field32 (END_W6_NVT_INDEX , end->w6);uint8_t priority =xive_get_field32 (END_W7_F0_PRIORITY , end->w7);uint8_t pq; +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ;if (!xive_end_is_valid (end)) {return ;
@@ -1389,8 +1392,10 @@ void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon)if (qaddr_base) {monitor_printf (mon," eq:@%08" PRIx64"% 6d/%5d ^%d" , qaddr_base, qindex, qentries, qgen); -xive_end_queue_pic_print_info (end,6 , mon); +xive_end_queue_pic_print_info (end,6 , buf); } + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text);monitor_printf (mon,"\n" ); }
Signature · 1 line
2.41.0
Re: [PATCH 06/26] hw/ppc: Avoid using Monitor in xive_end_queue_pic_print_info()
hw/intc/xive.c void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon) · line 1399
Quoted 10 lines · Philippe Mathieu-Daudé
hw/intc/xive.c +3
-1@@ -1389,8 +1392,10 @@ void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon)if (qaddr_base) {monitor_printf (mon," eq:@%08" PRIx64"% 6d/%5d ^%d" , qaddr_base, qindex, qentries, qgen); -xive_end_queue_pic_print_info (end,6 , mon); +xive_end_queue_pic_print_info (end,6 , buf); } + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text);monitor_printf (mon,"\n" );
This monitor_printf could also be folded in buf before info assignment ?
Quoted 2 lines
(quoted diff) +0
-0}
PATCH 7/26 hw/ppc: Avoid using Monitor in spapr_xive_end_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- hw/intc/spapr_xive.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
hw/intc/spapr_xive.c +10 -10
@@ -133,7 +133,7 @@ static int spapr_xive_target_to_end(uint32_t target, uint8_t prio,* structure dumping only the information related to the OS EQ. */ static void spapr_xive_end_pic_print_info (SpaprXive *xive,XiveEND *end, -Monitor *mon) +GString *buf) {uint64_t qaddr_base =xive_end_qaddr (end);uint32_t qindex =xive_get_field32 (END_W1_PAGE_OFF , end->w1);
@@ -142,17 +142,12 @@ static void spapr_xive_end_pic_print_info(SpaprXive *xive, XiveEND *end,uint32_t qentries =1 << (qsize +10 );uint32_t nvt =xive_get_field32 (END_W6_NVT_INDEX , end->w6);uint8_t priority =xive_get_field32 (END_W7_F0_PRIORITY , end->w7); -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ; -monitor_printf (mon,"%3d/%d % 6d/%5d @%" PRIx64" ^%d" , -spapr_xive_nvt_to_target (0 , nvt), - priority, qindex, qentries, qaddr_base, qgen); +g_string_append_printf (buf,"%3d/%d % 6d/%5d @%" PRIx64" ^%d" , +spapr_xive_nvt_to_target (0 , nvt), + priority, qindex, qentries, qaddr_base, qgen);xive_end_queue_pic_print_info (end,6 , buf); - - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); }/*
@@ -198,13 +193,18 @@ static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon)if (!xive_eas_is_masked (eas)) {uint32_t end_idx =xive_get_field64 (EAS_END_INDEX , eas->w);XiveEND *end; +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ;assert (end_idx < xive->nr_ends); end = &xive->endt[end_idx];if (xive_end_is_valid (end)) { -spapr_xive_end_pic_print_info (xive, end, mon); +spapr_xive_end_pic_print_info (xive, end, buf); } + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); }monitor_printf (mon,"\n" ); }
Signature · 1 line
2.41.0
Re: [PATCH 07/26] hw/ppc: Avoid using Monitor in spapr_xive_end_pic_print_info()
Quoted 9 lines · Philippe Mathieu-Daudé
hw/intc/spapr_xive.c +2
-0@@ -198,13 +193,18 @@ static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon)if (!xive_eas_is_masked (eas)) {uint32_t end_idx =xive_get_field64 (EAS_END_INDEX , eas->w);XiveEND *end; +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ;assert (end_idx < xive->nr_ends); end = &xive->endt[end_idx];
hw/intc/spapr_xive.c static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon) · line 209
Quoted 10 lines
hw/intc/spapr_xive.c +4
-1if (xive_end_is_valid (end)) { -spapr_xive_end_pic_print_info (xive, end, mon); +spapr_xive_end_pic_print_info (xive, end, buf); } + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); }monitor_printf (mon,"\n" );
Similarly, this monitor_printf could be g_stringified before doing the human_readable logic ?
Thanks
Harsh
Quoted 1 line
(quoted diff) +0
-0}
PATCH 8/26 hw/ppc: Avoid using Monitor in spapr_xive_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- hw/intc/spapr_xive.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-)
hw/intc/spapr_xive.c +12 -16
@@ -157,7 +157,7 @@ static void spapr_xive_end_pic_print_info(SpaprXive *xive, XiveEND *end,#define spapr_xive_in_kernel (xive) \ (kvm_irqchip_in_kernel() && (xive)->fd != -1) -static void spapr_xive_pic_print_info (SpaprXive *xive,Monitor *mon) +static void spapr_xive_pic_print_info (SpaprXive *xive,GString *buf) {XiveSource *xsrc = &xive->source;int i;
@@ -172,7 +172,7 @@ static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon) } } -monitor_printf (mon," LISN PQ EISN CPU/PRIO EQ\n" ); +g_string_append_printf (buf," LISN PQ EISN CPU/PRIO EQ\n" );for (i =0 ; i < xive->nr_irqs; i++) {uint8_t pq =xive_source_esb_get (xsrc, i);
@@ -182,19 +182,17 @@ static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon)continue ; } -monitor_printf (mon," %08x %s %c%c%c %s %08x " , i, -xive_source_irq_is_lsi (xsrc, i) ?"LSI" :"MSI" , - pq &XIVE_ESB_VAL_P ?'P' :'-' , - pq &XIVE_ESB_VAL_Q ?'Q' :'-' , -xive_source_is_asserted (xsrc, i) ?'A' :' ' , -xive_eas_is_masked (eas) ?"M" :" " , - (int )xive_get_field64 (EAS_END_DATA , eas->w)); +g_string_append_printf (buf," %08x %s %c%c%c %s %08x " , i, +xive_source_irq_is_lsi (xsrc, i) ?"LSI" :"MSI" , + pq &XIVE_ESB_VAL_P ?'P' :'-' , + pq &XIVE_ESB_VAL_Q ?'Q' :'-' , +xive_source_is_asserted (xsrc, i) ?'A' :' ' , +xive_eas_is_masked (eas) ?"M" :" " , + (int )xive_get_field64 (EAS_END_DATA , eas->w));if (!xive_eas_is_masked (eas)) {uint32_t end_idx =xive_get_field64 (EAS_END_INDEX , eas->w);XiveEND *end; -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ;assert (end_idx < xive->nr_ends); end = &xive->endt[end_idx];
@@ -203,10 +201,8 @@ static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon)spapr_xive_end_pic_print_info (xive, end, buf); } - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); } -monitor_printf (mon,"\n" ); +g_string_append_c (buf,'\n' ); } }
@@ -717,10 +713,10 @@ static void spapr_xive_print_info(SpaprInterruptController *intc, Monitor *mon)xive_tctx_pic_print_info (spapr_cpu_state (cpu)->tctx, buf); } +spapr_xive_pic_print_info (xive, buf); + info =human_readable_text_from_str (buf);monitor_puts (mon, info->human_readable_text); - -spapr_xive_pic_print_info (xive, mon); } static void spapr_xive_dt(SpaprInterruptController *intc, uint32_t nr_servers,
Signature · 1 line
2.41.0
Re: [PATCH 08/26] hw/ppc: Avoid using Monitor in spapr_xive_pic_print_info()
hw/intc/spapr_xive.c static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon) · line 205
Quoted 9 lines · Philippe Mathieu-Daudé
hw/intc/spapr_xive.c +1
-3@@ -203,10 +201,8 @@ static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon)spapr_xive_end_pic_print_info (xive, end, buf); } - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); } -monitor_printf (mon,"\n" ); +g_string_append_c (buf,'\n' );
Ok, I see caller specific changes are done in separate patches. Ideally one call flow could be squashed into a single patch, which would help avoid addition, followed by removal of common logic like above. However, assuming that would be increasing the patch size, I understand smaller patches are easier to review.
Thanks
Harsh
Quoted 2 lines
(quoted diff) +0
-0} }
PATCH 9/26 hw/ppc: Avoid using Monitor in xive_source_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/xive.h | 2 +- hw/intc/pnv_xive.c | 11 ++++++++--- hw/intc/pnv_xive2.c | 8 +++++++- hw/intc/xive.c | 16 +++++++--------- hw/pci-host/pnv_phb4.c | 20 ++++++++++++++------ hw/ppc/pnv_psi.c | 12 +++++++++--- 6 files changed, 46 insertions(+), 23 deletions(-)
include/hw/ppc/xive.h +1 -1
@@ -314,7 +314,7 @@ static inline bool xive_source_is_asserted(XiveSource *xsrc, uint32_t srcno) }void xive_source_pic_print_info (XiveSource *xsrc,uint32_t offset, -Monitor *mon); +GString *buf);static inline bool xive_source_irq_is_lsi (XiveSource *xsrc,uint32_t srcno) {
hw/intc/pnv_xive.c +8 -3
@@ -11,6 +11,7 @@#include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h"
@@ -1857,10 +1858,14 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon)XiveNVT nvt;int i;uint64_t xive_nvt_per_subpage; +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ; -monitor_printf (mon,"XIVE[%x] #%d Source %08x .. %08x\n" , chip_id, blk, - srcno0, srcno0 + nr_ipis -1 ); -xive_source_pic_print_info (&xive->ipi_source, srcno0, mon); +g_string_append_printf (buf,"XIVE[%x] #%d Source %08x .. %08x\n" , + chip_id, blk, srcno0, srcno0 + nr_ipis -1 ); +xive_source_pic_print_info (&xive->ipi_source, srcno0, buf); + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text);monitor_printf (mon,"XIVE[%x] #%d EAT %08x .. %08x\n" , chip_id, blk, srcno0, srcno0 + nr_ipis -1 );
hw/intc/pnv_xive2.c +7 -1
@@ -10,6 +10,7 @@#include "qemu/osdep.h" #include "qemu/log.h" #include "qapi/error.h" +#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h"
@@ -2116,10 +2117,15 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon)Xive2Nvp nvp;int i;uint64_t xive_nvp_per_subpage; +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ;monitor_printf (mon,"XIVE[%x] Source %08x .. %08x\n" , blk, srcno0, srcno0 + nr_esbs -1 ); -xive_source_pic_print_info (&xive->ipi_source, srcno0, mon); +xive_source_pic_print_info (&xive->ipi_source, srcno0, buf); + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text);monitor_printf (mon,"XIVE[%x] EAT %08x .. %08x\n" , blk, srcno0, srcno0 + nr_esbs -1 );
hw/intc/xive.c +7 -9
@@ -1209,22 +1209,20 @@ void xive_source_set_irq(void *opaque, int srcno, int val) } } -void xive_source_pic_print_info (XiveSource *xsrc,uint32_t offset,Monitor *mon) +void xive_source_pic_print_info (XiveSource *xsrc,uint32_t offset,GString *buf) { -int i; - -for (i =0 ; i < xsrc->nr_irqs; i++) { +for (unsigned i =0 ; i < xsrc->nr_irqs; i++) {uint8_t pq =xive_source_esb_get (xsrc, i);if (pq ==XIVE_ESB_OFF ) {continue ; } -monitor_printf (mon," %08x %s %c%c%c\n" , i + offset, -xive_source_irq_is_lsi (xsrc, i) ?"LSI" :"MSI" , - pq &XIVE_ESB_VAL_P ?'P' :'-' , - pq &XIVE_ESB_VAL_Q ?'Q' :'-' , -xive_source_is_asserted (xsrc, i) ?'A' :' ' ); +g_string_append_printf (buf," %08x %s %c%c%c\n" , i + offset, +xive_source_irq_is_lsi (xsrc, i) ?"LSI" :"MSI" , + pq &XIVE_ESB_VAL_P ?'P' :'-' , + pq &XIVE_ESB_VAL_Q ?'Q' :'-' , +xive_source_is_asserted (xsrc, i) ?'A' :' ' ); } }
hw/pci-host/pnv_phb4.c +14 -6
@@ -10,6 +10,7 @@#include "qemu/log.h" #include "qapi/visitor.h" #include "qapi/error.h" +#include "qapi/type-helpers.h" #include "monitor/monitor.h" #include "target/ppc/cpu.h" #include "hw/pci-host/pnv_phb4_regs.h"
@@ -1807,11 +1808,18 @@ void pnv_phb4_pic_print_info(PnvPHB4 *phb, Monitor *mon) phb->regs[PHB_INT_NOTIFY_ADDR >>3 ] & ~PHB_INT_NOTIFY_ADDR_64K ;uint32_t offset = phb->regs[PHB_INT_NOTIFY_INDEX >>3 ];bool abt = !!(phb->regs[PHB_CTRLR >>3 ] &PHB_CTRLR_IRQ_ABT_MODE ); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ; -monitor_printf (mon,"PHB4[%x:%x] Source %08x .. %08x %s @%" HWADDR_PRIx"\n" , - phb->chip_id, phb->phb_id, - offset, offset + phb->xsrc.nr_irqs -1 , - abt ?"ABT" :"" , - notif_port); -xive_source_pic_print_info (&phb->xsrc,0 , mon); +g_string_append_printf (buf, +"PHB4[%x:%x] Source %08x .. %08x " +"%s @%" HWADDR_PRIx"\n" , + phb->chip_id, phb->phb_id, + offset, offset + phb->xsrc.nr_irqs -1 , + abt ?"ABT" :"" , + notif_port); +xive_source_pic_print_info (&phb->xsrc,0 , buf); + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); }
hw/ppc/pnv_psi.c +9 -3
@@ -25,6 +25,7 @@#include "qemu/module.h" #include "sysemu/reset.h" #include "qapi/error.h" +#include "qapi/type-helpers.h" #include "monitor/monitor.h"
@@ -980,11 +981,16 @@ type_init(pnv_psi_register_types);void pnv_psi_pic_print_info (Pnv9Psi *psi9,Monitor *mon) {PnvPsi *psi =PNV_PSI (psi9); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ;uint32_t offset = (psi->regs[PSIHB_REG (PSIHB9_IVT_OFFSET )] >>PSIHB9_IVT_OFF_SHIFT ); -monitor_printf (mon,"PSIHB Source %08x .. %08x\n" , - offset, offset + psi9->source.nr_irqs -1 ); -xive_source_pic_print_info (&psi9->source, offset, mon); +g_string_append_printf (buf,"PSIHB Source %08x .. %08x\n" , + offset, offset + psi9->source.nr_irqs -1 ); +xive_source_pic_print_info (&psi9->source, offset, buf); + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); }
Signature · 1 line
2.41.0
PATCH 10/26 hw/ppc: Avoid using Monitor in pnv_phb4_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/pci-host/pnv_phb4.h | 2 +- hw/pci-host/pnv_phb4.c | 9 +-------- hw/ppc/pnv.c | 6 +++++- 3 files changed, 7 insertions(+), 10 deletions(-)
include/hw/pci-host/pnv_phb4.h +1 -1
@@ -155,7 +155,7 @@ struct PnvPHB4 { QLIST_HEAD(, PnvPhb4DMASpace) dma_spaces; }; -void pnv_phb4_pic_print_info (PnvPHB4 *phb,Monitor *mon); +void pnv_phb4_pic_print_info (PnvPHB4 *phb,GString *buf);int pnv_phb4_pec_get_phb_id (PnvPhb4PecState *pec,int stack_index);PnvPhb4PecState *pnv_pec_add_phb (PnvChip *chip,PnvPHB *phb,Error **errp);void pnv_phb4_bus_init (DeviceState *dev,PnvPHB4 *phb);
hw/pci-host/pnv_phb4.c +1 -8
@@ -10,8 +10,6 @@#include "qemu/log.h" #include "qapi/visitor.h" #include "qapi/error.h" -#include "qapi/type-helpers.h" -#include "monitor/monitor.h" #include "target/ppc/cpu.h" #include "hw/pci-host/pnv_phb4_regs.h" #include "hw/pci-host/pnv_phb4.h"
@@ -1802,14 +1800,12 @@ static void pnv_phb4_register_types(void)type_init (pnv_phb4_register_types); -void pnv_phb4_pic_print_info (PnvPHB4 *phb,Monitor *mon) +void pnv_phb4_pic_print_info (PnvPHB4 *phb,GString *buf) {uint64_t notif_port = phb->regs[PHB_INT_NOTIFY_ADDR >>3 ] & ~PHB_INT_NOTIFY_ADDR_64K ;uint32_t offset = phb->regs[PHB_INT_NOTIFY_INDEX >>3 ];bool abt = !!(phb->regs[PHB_CTRLR >>3 ] &PHB_CTRLR_IRQ_ABT_MODE ); -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ;g_string_append_printf (buf, "PHB4[%x:%x] Source %08x .. %08x "
@@ -1819,7 +1815,4 @@ void pnv_phb4_pic_print_info(PnvPHB4 *phb, Monitor *mon) abt ?"ABT" :"" , notif_port);xive_source_pic_print_info (&phb->xsrc,0 , buf); - - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); }
hw/ppc/pnv.c +5 -1
@@ -791,12 +791,16 @@ static int pnv_chip_power9_pic_print_info_child(Object *child, void *opaque) {Monitor *mon = opaque;PnvPHB *phb = (PnvPHB *)object_dynamic_cast (child,TYPE_PNV_PHB ); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ;if (!phb) {return 0 ; } -pnv_phb4_pic_print_info (PNV_PHB4 (phb->backend), mon); +pnv_phb4_pic_print_info (PNV_PHB4 (phb->backend), buf); + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text);return 0 ; }
Signature · 1 line
2.41.0
PATCH 11/26 hw/ppc: Avoid using Monitor in xive_eas_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/xive_regs.h | 2 +- hw/intc/pnv_xive.c | 10 +++++----- hw/intc/xive.c | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-)
include/hw/ppc/xive_regs.h +1 -1
@@ -167,7 +167,7 @@ typedef struct XiveEAS {#define xive_eas_is_valid (eas) (be64_to_cpu((eas)->w) & EAS_VALID)#define xive_eas_is_masked (eas) (be64_to_cpu((eas)->w) & EAS_MASKED) -void xive_eas_pic_print_info (XiveEAS *eas,uint32_t lisn,Monitor *mon); +void xive_eas_pic_print_info (XiveEAS *eas,uint32_t lisn,GString *buf);static inline uint64_t xive_get_field64 (uint64_t mask,uint64_t word) {
hw/intc/pnv_xive.c +5 -5
@@ -1864,19 +1864,19 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon)g_string_append_printf (buf,"XIVE[%x] #%d Source %08x .. %08x\n" , chip_id, blk, srcno0, srcno0 + nr_ipis -1 );xive_source_pic_print_info (&xive->ipi_source, srcno0, buf); - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); -monitor_printf (mon,"XIVE[%x] #%d EAT %08x .. %08x\n" , chip_id, blk, - srcno0, srcno0 + nr_ipis -1 ); +g_string_append_printf (buf,"XIVE[%x] #%d EAT %08x .. %08x\n" , + chip_id, blk, srcno0, srcno0 + nr_ipis -1 );for (i =0 ; i < nr_ipis; i++) {if (xive_router_get_eas (xrtr, blk, i, &eas)) {break ; }if (!xive_eas_is_masked (&eas)) { -xive_eas_pic_print_info (&eas, i, mon); +xive_eas_pic_print_info (&eas, i, buf); } } + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text);monitor_printf (mon,"XIVE[%x] #%d ENDT\n" , chip_id, blk); i =0 ;
hw/intc/xive.c +6 -6
@@ -1921,17 +1921,17 @@ static const TypeInfo xive_router_info = { } }; -void xive_eas_pic_print_info (XiveEAS *eas,uint32_t lisn,Monitor *mon) +void xive_eas_pic_print_info (XiveEAS *eas,uint32_t lisn,GString *buf) {if (!xive_eas_is_valid (eas)) {return ; } -monitor_printf (mon," %08x %s end:%02x/%04x data:%08x\n" , - lisn,xive_eas_is_masked (eas) ?"M" :" " , - (uint8_t )xive_get_field64 (EAS_END_BLOCK , eas->w), - (uint32_t )xive_get_field64 (EAS_END_INDEX , eas->w), - (uint32_t )xive_get_field64 (EAS_END_DATA , eas->w)); +g_string_append_printf (buf," %08x %s end:%02x/%04x data:%08x\n" , + lisn,xive_eas_is_masked (eas) ?"M" :" " , + (uint8_t )xive_get_field64 (EAS_END_BLOCK , eas->w), + (uint32_t )xive_get_field64 (EAS_END_INDEX , eas->w), + (uint32_t )xive_get_field64 (EAS_END_DATA , eas->w)); }/*
Signature · 1 line
2.41.0
PATCH 12/26 hw/ppc: Avoid using Monitor in xive_end_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/xive_regs.h | 2 +- hw/intc/pnv_xive.c | 8 ++++---- hw/intc/xive.c | 40 +++++++++++++++++--------------------- 3 files changed, 23 insertions(+), 27 deletions(-)
include/hw/ppc/xive_regs.h +1 -1
@@ -261,7 +261,7 @@ static inline uint64_t xive_end_qaddr(XiveEND *end)be32_to_cpu (end->w3); } -void xive_end_pic_print_info (XiveEND *end,uint32_t end_idx,Monitor *mon); +void xive_end_pic_print_info (XiveEND *end,uint32_t end_idx,GString *buf);void xive_end_queue_pic_print_info (XiveEND *end,uint32_t width,GString *buf);void xive_end_eas_pic_print_info (XiveEND *end,uint32_t end_idx,Monitor *mon);
hw/intc/pnv_xive.c +4 -4
@@ -1875,14 +1875,14 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon)xive_eas_pic_print_info (&eas, i, buf); } } - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); -monitor_printf (mon,"XIVE[%x] #%d ENDT\n" , chip_id, blk); +g_string_append_printf (buf,"XIVE[%x] #%d ENDT\n" , chip_id, blk); i =0 ;while (!xive_router_get_end (xrtr, blk, i, &end)) { -xive_end_pic_print_info (&end, i++, mon); +xive_end_pic_print_info (&end, i++, buf); } + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text);monitor_printf (mon,"XIVE[%x] #%d END Escalation EAT\n" , chip_id, blk); i =0 ;
hw/intc/xive.c +18 -22
@@ -11,7 +11,6 @@#include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" -#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h"
@@ -1352,7 +1351,7 @@ void xive_end_queue_pic_print_info(XiveEND *end, uint32_t width, GString *buf)g_string_append_c (buf,']' ); } -void xive_end_pic_print_info (XiveEND *end,uint32_t end_idx,Monitor *mon) +void xive_end_pic_print_info (XiveEND *end,uint32_t end_idx,GString *buf) {uint64_t qaddr_base =xive_end_qaddr (end);uint32_t qindex =xive_get_field32 (END_W1_PAGE_OFF , end->w1);
@@ -1364,8 +1363,6 @@ void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon)uint32_t nvt_idx =xive_get_field32 (END_W6_NVT_INDEX , end->w6);uint8_t priority =xive_get_field32 (END_W7_F0_PRIORITY , end->w7);uint8_t pq; -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ;if (!xive_end_is_valid (end)) {return ;
@@ -1373,28 +1370,27 @@ void xive_end_pic_print_info(XiveEND *end, uint32_t end_idx, Monitor *mon) pq =xive_get_field32 (END_W1_ESn, end->w1); -monitor_printf (mon," %08x %c%c %c%c%c%c%c%c%c%c prio:%d nvt:%02x/%04x" , - end_idx, - pq &XIVE_ESB_VAL_P ?'P' :'-' , - pq &XIVE_ESB_VAL_Q ?'Q' :'-' , -xive_end_is_valid (end) ?'v' :'-' , -xive_end_is_enqueue (end) ?'q' :'-' , -xive_end_is_notify (end) ?'n' :'-' , -xive_end_is_backlog (end) ?'b' :'-' , -xive_end_is_escalate (end) ?'e' :'-' , -xive_end_is_uncond_escalation (end) ?'u' :'-' , -xive_end_is_silent_escalation (end) ?'s' :'-' , -xive_end_is_firmware (end) ?'f' :'-' , - priority, nvt_blk, nvt_idx); +g_string_append_printf (buf, +" %08x %c%c %c%c%c%c%c%c%c%c prio:%d nvt:%02x/%04x" , + end_idx, + pq &XIVE_ESB_VAL_P ?'P' :'-' , + pq &XIVE_ESB_VAL_Q ?'Q' :'-' , +xive_end_is_valid (end) ?'v' :'-' , +xive_end_is_enqueue (end) ?'q' :'-' , +xive_end_is_notify (end) ?'n' :'-' , +xive_end_is_backlog (end) ?'b' :'-' , +xive_end_is_escalate (end) ?'e' :'-' , +xive_end_is_uncond_escalation (end) ?'u' :'-' , +xive_end_is_silent_escalation (end) ?'s' :'-' , +xive_end_is_firmware (end) ?'f' :'-' , + priority, nvt_blk, nvt_idx);if (qaddr_base) { -monitor_printf (mon," eq:@%08" PRIx64"% 6d/%5d ^%d" , - qaddr_base, qindex, qentries, qgen); +g_string_append_printf (buf," eq:@%08" PRIx64"% 6d/%5d ^%d" , + qaddr_base, qindex, qentries, qgen);xive_end_queue_pic_print_info (end,6 , buf); } - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); -monitor_printf (mon,"\n" ); +g_string_append_c (buf,'\n' ); }static void xive_end_enqueue (XiveEND *end,uint32_t data)
Signature · 1 line
2.41.0
PATCH 13/26 hw/ppc: Avoid using Monitor in xive_end_eas_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/xive_regs.h | 2 +- hw/intc/pnv_xive.c | 9 +++++---- hw/intc/xive.c | 22 ++++++++++------------ 3 files changed, 16 insertions(+), 17 deletions(-)
include/hw/ppc/xive_regs.h +1 -1
@@ -263,7 +263,7 @@ static inline uint64_t xive_end_qaddr(XiveEND *end)void xive_end_pic_print_info (XiveEND *end,uint32_t end_idx,GString *buf);void xive_end_queue_pic_print_info (XiveEND *end,uint32_t width,GString *buf); -void xive_end_eas_pic_print_info (XiveEND *end,uint32_t end_idx,Monitor *mon); +void xive_end_eas_pic_print_info (XiveEND *end,uint32_t end_idx,GString *buf);/* Notification Virtual Target (NVT) */ typedef struct XiveNVT {
hw/intc/pnv_xive.c +5 -4
@@ -1881,14 +1881,15 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon)while (!xive_router_get_end (xrtr, blk, i, &end)) {xive_end_pic_print_info (&end, i++, buf); } - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); -monitor_printf (mon,"XIVE[%x] #%d END Escalation EAT\n" , chip_id, blk); +g_string_append_printf (buf,"XIVE[%x] #%d END Escalation EAT\n" , + chip_id, blk); i =0 ;while (!xive_router_get_end (xrtr, blk, i, &end)) { -xive_end_eas_pic_print_info (&end, i++, mon); +xive_end_eas_pic_print_info (&end, i++, buf); } + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text);monitor_printf (mon,"XIVE[%x] #%d NVTT %08x .. %08x\n" , chip_id, blk,0 ,XIVE_NVT_COUNT -1 );
hw/intc/xive.c +10 -12
@@ -17,7 +17,6 @@#include "sysemu/reset.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" -#include "monitor/monitor.h" #include "hw/irq.h" #include "hw/ppc/xive.h" #include "hw/ppc/xive2.h"
@@ -1419,8 +1418,7 @@ static void xive_end_enqueue(XiveEND *end, uint32_t data) end->w1 =xive_set_field32 (END_W1_PAGE_OFF , end->w1, qindex); } -void xive_end_eas_pic_print_info (XiveEND *end,uint32_t end_idx, -Monitor *mon) +void xive_end_eas_pic_print_info (XiveEND *end,uint32_t end_idx,GString *buf) {XiveEAS *eas = (XiveEAS *) &end->w4;uint8_t pq;
@@ -1431,15 +1429,15 @@ void xive_end_eas_pic_print_info(XiveEND *end, uint32_t end_idx, pq =xive_get_field32 (END_W1_ESe, end->w1); -monitor_printf (mon," %08x %c%c %c%c end:%02x/%04x data:%08x\n" , - end_idx, - pq &XIVE_ESB_VAL_P ?'P' :'-' , - pq &XIVE_ESB_VAL_Q ?'Q' :'-' , -xive_eas_is_valid (eas) ?'V' :' ' , -xive_eas_is_masked (eas) ?'M' :' ' , - (uint8_t )xive_get_field64 (EAS_END_BLOCK , eas->w), - (uint32_t )xive_get_field64 (EAS_END_INDEX , eas->w), - (uint32_t )xive_get_field64 (EAS_END_DATA , eas->w)); +g_string_append_printf (buf," %08x %c%c %c%c end:%02x/%04x data:%08x\n" , + end_idx, + pq &XIVE_ESB_VAL_P ?'P' :'-' , + pq &XIVE_ESB_VAL_Q ?'Q' :'-' , +xive_eas_is_valid (eas) ?'V' :' ' , +xive_eas_is_masked (eas) ?'M' :' ' , + (uint8_t )xive_get_field64 (EAS_END_BLOCK , eas->w), + (uint32_t )xive_get_field64 (EAS_END_INDEX , eas->w), + (uint32_t )xive_get_field64 (EAS_END_DATA , eas->w)); }/*
Signature · 1 line
2.41.0
PATCH 14/26 hw/ppc: Avoid using Monitor in xive_nvt_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- hw/intc/pnv_xive.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
hw/intc/pnv_xive.c +10 -9
@@ -1832,7 +1832,7 @@ static const MemoryRegionOps pnv_xive_pc_ops = { };static void xive_nvt_pic_print_info (XiveNVT *nvt,uint32_t nvt_idx, -Monitor *mon) +GString *buf) {uint8_t eq_blk =xive_get_field32 (NVT_W1_EQ_BLOCK , nvt->w1);uint32_t eq_idx =xive_get_field32 (NVT_W1_EQ_INDEX , nvt->w1);
@@ -1841,9 +1841,9 @@ static void xive_nvt_pic_print_info(XiveNVT *nvt, uint32_t nvt_idx,return ; } -monitor_printf (mon," %08x end:%02x/%04x IPB:%02x\n" , nvt_idx, - eq_blk, eq_idx, -xive_get_field32 (NVT_W4_IPB , nvt->w4)); +g_string_append_printf (buf," %08x end:%02x/%04x IPB:%02x\n" , + nvt_idx, eq_blk, eq_idx, +xive_get_field32 (NVT_W4_IPB , nvt->w4)); }void pnv_xive_pic_print_info (PnvXive *xive,Monitor *mon)
@@ -1888,17 +1888,18 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon)while (!xive_router_get_end (xrtr, blk, i, &end)) {xive_end_eas_pic_print_info (&end, i++, buf); } - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); -monitor_printf (mon,"XIVE[%x] #%d NVTT %08x .. %08x\n" , chip_id, blk, -0 ,XIVE_NVT_COUNT -1 ); +g_string_append_printf (buf,"XIVE[%x] #%d NVTT %08x .. %08x\n" , + chip_id, blk,0 ,XIVE_NVT_COUNT -1 ); xive_nvt_per_subpage =pnv_xive_vst_per_subpage (xive,VST_TSEL_VPDT );for (i =0 ; i <XIVE_NVT_COUNT ; i += xive_nvt_per_subpage) {while (!xive_router_get_nvt (xrtr, blk, i, &nvt)) { -xive_nvt_pic_print_info (&nvt, i++, mon); +xive_nvt_pic_print_info (&nvt, i++, buf); } } + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); }static void pnv_xive_reset (void *dev)
Signature · 1 line
2.41.0
PATCH 15/26 hw/ppc: Avoid using Monitor in pnv_xive_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/pnv_xive.h | 2 +- hw/intc/pnv_xive.c | 9 +-------- hw/ppc/pnv.c | 8 +++++++- 3 files changed, 9 insertions(+), 10 deletions(-)
include/hw/ppc/pnv_xive.h +1 -1
@@ -93,7 +93,7 @@ struct PnvXiveClass {DeviceRealize parent_realize; }; -void pnv_xive_pic_print_info (PnvXive *xive,Monitor *mon); +void pnv_xive_pic_print_info (PnvXive *xive,GString *buf);/* * XIVE2 interrupt controller (POWER10)
hw/intc/pnv_xive.c +1 -8
@@ -11,12 +11,10 @@#include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" -#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h" #include "sysemu/reset.h" -#include "monitor/monitor.h" #include "hw/ppc/fdt.h" #include "hw/ppc/pnv.h" #include "hw/ppc/pnv_chip.h"
@@ -1846,7 +1844,7 @@ static void xive_nvt_pic_print_info(XiveNVT *nvt, uint32_t nvt_idx, xive_get_field32(NVT_W4_IPB, nvt->w4)); } -void pnv_xive_pic_print_info (PnvXive *xive,Monitor *mon) +void pnv_xive_pic_print_info (PnvXive *xive,GString *buf) {XiveRouter *xrtr =XIVE_ROUTER (xive);uint8_t blk =pnv_xive_block_id (xive);
@@ -1858,8 +1856,6 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon)XiveNVT nvt;int i;uint64_t xive_nvt_per_subpage; -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ;g_string_append_printf (buf,"XIVE[%x] #%d Source %08x .. %08x\n" , chip_id, blk, srcno0, srcno0 + nr_ipis -1 );
@@ -1897,9 +1893,6 @@ void pnv_xive_pic_print_info(PnvXive *xive, Monitor *mon)xive_nvt_pic_print_info (&nvt, i++, buf); } } - - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); }static void pnv_xive_reset (void *dev)
hw/ppc/pnv.c +7 -1
@@ -808,8 +808,14 @@ static int pnv_chip_power9_pic_print_info_child(Object *child, void *opaque)static void pnv_chip_power9_pic_print_info (PnvChip *chip,Monitor *mon) {Pnv9Chip *chip9 =PNV9_CHIP (chip); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ; + +pnv_xive_pic_print_info (&chip9->xive, buf); + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); -pnv_xive_pic_print_info (&chip9->xive, mon);pnv_psi_pic_print_info (&chip9->psi, mon); object_child_foreach_recursive(OBJECT(chip),
Signature · 1 line
2.41.0
PATCH 16/26 hw/ppc: Avoid using Monitor in pnv_psi_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/pnv_psi.h | 2 +- hw/ppc/pnv.c | 10 +++++++--- hw/ppc/pnv_psi.c | 9 +-------- 3 files changed, 9 insertions(+), 12 deletions(-)
include/hw/ppc/pnv_psi.h +1 -1
@@ -110,6 +110,6 @@ typedef enum PnvPsiIrq {#define PSIHB9_IRQ_PSU 13#define PSIHB9_NUM_IRQS 14 -void pnv_psi_pic_print_info (Pnv9Psi *psi,Monitor *mon); +void pnv_psi_pic_print_info (Pnv9Psi *psi,GString *buf);#endif /* PPC_PNV_PSI_H */
hw/ppc/pnv.c +7 -3
@@ -812,12 +812,11 @@ static void pnv_chip_power9_pic_print_info(PnvChip *chip, Monitor *mon)g_autoptr (HumanReadableText) info =NULL ;pnv_xive_pic_print_info (&chip9->xive, buf); +pnv_psi_pic_print_info (&chip9->psi, buf); info =human_readable_text_from_str (buf);monitor_puts (mon, info->human_readable_text); -pnv_psi_pic_print_info (&chip9->psi, mon); -object_child_foreach_recursive (OBJECT (chip), pnv_chip_power9_pic_print_info_child, mon); }
@@ -862,9 +861,14 @@ static void pnv_ipmi_bt_init(ISABus *bus, IPMIBmc *bmc, uint32_t irq)static void pnv_chip_power10_pic_print_info (PnvChip *chip,Monitor *mon) {Pnv10Chip *chip10 =PNV10_CHIP (chip); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ;pnv_xive2_pic_print_info (&chip10->xive, mon); -pnv_psi_pic_print_info (&chip10->psi, mon); + +pnv_psi_pic_print_info (&chip10->psi, buf); + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text);object_child_foreach_recursive (OBJECT (chip), pnv_chip_power9_pic_print_info_child, mon);
hw/ppc/pnv_psi.c +1 -8
@@ -25,8 +25,6 @@#include "qemu/module.h" #include "sysemu/reset.h" #include "qapi/error.h" -#include "qapi/type-helpers.h" -#include "monitor/monitor.h" #include "hw/ppc/fdt.h"
@@ -978,11 +976,9 @@ static void pnv_psi_register_types(void)type_init (pnv_psi_register_types); -void pnv_psi_pic_print_info (Pnv9Psi *psi9,Monitor *mon) +void pnv_psi_pic_print_info (Pnv9Psi *psi9,GString *buf) {PnvPsi *psi =PNV_PSI (psi9); -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ;uint32_t offset = (psi->regs[PSIHB_REG (PSIHB9_IVT_OFFSET )] >>PSIHB9_IVT_OFF_SHIFT );
@@ -990,7 +986,4 @@ void pnv_psi_pic_print_info(Pnv9Psi *psi9, Monitor *mon)g_string_append_printf (buf,"PSIHB Source %08x .. %08x\n" , offset, offset + psi9->source.nr_irqs -1 );xive_source_pic_print_info (&psi9->source, offset, buf); - - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); }
Signature · 1 line
2.41.0
PATCH 17/26 hw/ppc: Avoid using Monitor in xive2_eas_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/xive2_regs.h | 2 +- hw/intc/pnv_xive2.c | 16 ++++++++-------- hw/intc/xive2.c | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-)
include/hw/ppc/xive2_regs.h +1 -1
@@ -48,7 +48,7 @@ typedef struct Xive2Eas {#define xive2_eas_is_valid (eas) (be64_to_cpu((eas)->w) & EAS2_VALID)#define xive2_eas_is_masked (eas) (be64_to_cpu((eas)->w) & EAS2_MASKED) -void xive2_eas_pic_print_info (Xive2Eas *eas,uint32_t lisn,Monitor *mon); +void xive2_eas_pic_print_info (Xive2Eas *eas,uint32_t lisn,GString *buf);/* * Event Notifification Descriptor (END)
hw/intc/pnv_xive2.c +8 -8
@@ -2120,24 +2120,24 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon)g_autoptr (GString) buf =g_string_new ("" );g_autoptr (HumanReadableText) info =NULL ; -monitor_printf (mon,"XIVE[%x] Source %08x .. %08x\n" , blk, srcno0, - srcno0 + nr_esbs -1 ); +g_string_append_printf (buf,"XIVE[%x] Source %08x .. %08x\n" , + blk, srcno0, srcno0 + nr_esbs -1 );xive_source_pic_print_info (&xive->ipi_source, srcno0, buf); - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); - -monitor_printf (mon,"XIVE[%x] EAT %08x .. %08x\n" , blk, srcno0, - srcno0 + nr_esbs -1 ); +g_string_append_printf (buf,"XIVE[%x] EAT %08x .. %08x\n" , + blk, srcno0, srcno0 + nr_esbs -1 );for (i =0 ; i < nr_esbs; i++) {if (xive2_router_get_eas (xrtr, blk, i, &eas)) {break ; }if (!xive2_eas_is_masked (&eas)) { -xive2_eas_pic_print_info (&eas, i, mon); +xive2_eas_pic_print_info (&eas, i, buf); } } + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); +monitor_printf (mon,"XIVE[%x] #%d END Escalation EAT\n" , chip_id, blk); i =0 ;while (!xive2_router_get_end (xrtr, blk, i, &end)) {
hw/intc/xive2.c +6 -6
@@ -27,17 +27,17 @@ uint32_t xive2_router_get_config(Xive2Router *xrtr)return xrc->get_config (xrtr); } -void xive2_eas_pic_print_info (Xive2Eas *eas,uint32_t lisn,Monitor *mon) +void xive2_eas_pic_print_info (Xive2Eas *eas,uint32_t lisn,GString *buf) {if (!xive2_eas_is_valid (eas)) {return ; } -monitor_printf (mon," %08x %s end:%02x/%04x data:%08x\n" , - lisn,xive2_eas_is_masked (eas) ?"M" :" " , - (uint8_t )xive_get_field64 (EAS2_END_BLOCK , eas->w), - (uint32_t )xive_get_field64 (EAS2_END_INDEX , eas->w), - (uint32_t )xive_get_field64 (EAS2_END_DATA , eas->w)); +g_string_append_printf (buf," %08x %s end:%02x/%04x data:%08x\n" , + lisn,xive2_eas_is_masked (eas) ?"M" :" " , + (uint8_t )xive_get_field64 (EAS2_END_BLOCK , eas->w), + (uint32_t )xive_get_field64 (EAS2_END_INDEX , eas->w), + (uint32_t )xive_get_field64 (EAS2_END_DATA , eas->w)); } void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width,
Signature · 1 line
2.41.0
PATCH 18/26 hw/ppc: Avoid using Monitor in xive2_end_eas_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/xive2_regs.h | 2 +- hw/intc/pnv_xive2.c | 10 +++++----- hw/intc/xive2.c | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-)
include/hw/ppc/xive2_regs.h +1 -1
@@ -134,7 +134,7 @@ void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, Monitor *mon);void xive2_end_queue_pic_print_info (Xive2End *end,uint32_t width,Monitor *mon);void xive2_end_eas_pic_print_info (Xive2End *end,uint32_t end_idx, -Monitor *mon); +GString *buf);/* * Notification Virtual Processor (NVP)
hw/intc/pnv_xive2.c +5 -5
@@ -2135,14 +2135,14 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon) } } - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); - -monitor_printf (mon,"XIVE[%x] #%d END Escalation EAT\n" , chip_id, blk); +g_string_append_printf (buf,"XIVE[%x] #%d END Escalation EAT\n" , + chip_id, blk); i =0 ;while (!xive2_router_get_end (xrtr, blk, i, &end)) { -xive2_end_eas_pic_print_info (&end, i++, mon); +xive2_end_eas_pic_print_info (&end, i++, buf); } + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text);monitor_printf (mon,"XIVE[%x] #%d ENDT\n" , chip_id, blk); i =0 ;
hw/intc/xive2.c +10 -10
@@ -116,7 +116,7 @@ void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, Monitor *mon) }void xive2_end_eas_pic_print_info (Xive2End *end,uint32_t end_idx, -Monitor *mon) +GString *buf) {Xive2Eas *eas = (Xive2Eas *) &end->w4;uint8_t pq;
@@ -127,15 +127,15 @@ void xive2_end_eas_pic_print_info(Xive2End *end, uint32_t end_idx, pq =xive_get_field32 (END2_W1_ESe, end->w1); -monitor_printf (mon," %08x %c%c %c%c end:%02x/%04x data:%08x\n" , - end_idx, - pq &XIVE_ESB_VAL_P ?'P' :'-' , - pq &XIVE_ESB_VAL_Q ?'Q' :'-' , -xive2_eas_is_valid (eas) ?'v' :' ' , -xive2_eas_is_masked (eas) ?'M' :' ' , - (uint8_t )xive_get_field64 (EAS2_END_BLOCK , eas->w), - (uint32_t )xive_get_field64 (EAS2_END_INDEX , eas->w), - (uint32_t )xive_get_field64 (EAS2_END_DATA , eas->w)); +g_string_append_printf (buf," %08x %c%c %c%c end:%02x/%04x data:%08x\n" , + end_idx, + pq &XIVE_ESB_VAL_P ?'P' :'-' , + pq &XIVE_ESB_VAL_Q ?'Q' :'-' , +xive2_eas_is_valid (eas) ?'v' :' ' , +xive2_eas_is_masked (eas) ?'M' :' ' , + (uint8_t )xive_get_field64 (EAS2_END_BLOCK , eas->w), + (uint32_t )xive_get_field64 (EAS2_END_INDEX , eas->w), + (uint32_t )xive_get_field64 (EAS2_END_DATA , eas->w)); }static void xive2_end_enqueue (Xive2End *end,uint32_t data)
Signature · 1 line
2.41.0
PATCH 19/26 hw/ppc: Avoid using Monitor in xive2_end_queue_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/xive2_regs.h | 2 +- hw/intc/xive2.c | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-)
include/hw/ppc/xive2_regs.h +1 -1
@@ -132,7 +132,7 @@ static inline uint64_t xive2_end_qaddr(Xive2End *end)void xive2_end_pic_print_info (Xive2End *end,uint32_t end_idx,Monitor *mon);void xive2_end_queue_pic_print_info (Xive2End *end,uint32_t width, -Monitor *mon); +GString *buf);void xive2_end_eas_pic_print_info (Xive2End *end,uint32_t end_idx,GString *buf);
hw/intc/xive2.c +12 -7
@@ -11,6 +11,7 @@#include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" +#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h"
@@ -40,8 +41,7 @@ void xive2_eas_pic_print_info(Xive2Eas *eas, uint32_t lisn, GString *buf) (uint32_t) xive_get_field64(EAS2_END_DATA, eas->w)); } -void xive2_end_queue_pic_print_info (Xive2End *end,uint32_t width, -Monitor *mon) +void xive2_end_queue_pic_print_info (Xive2End *end,uint32_t width,GString *buf) {uint64_t qaddr_base =xive2_end_qaddr (end);uint32_t qsize =xive_get_field32 (END2_W3_QSIZE , end->w3);
@@ -52,7 +52,7 @@ void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width,/* * print out the [ (qindex - (width - 1)) .. (qindex + 1)] window */ -monitor_printf (mon," [ " ); +g_string_append_printf (buf," [ " ); qindex = (qindex - (width -1 )) & (qentries -1 );for (i =0 ; i < width; i++) {uint64_t qaddr = qaddr_base + (qindex <<2 );
@@ -64,11 +64,11 @@ void xive2_end_queue_pic_print_info(Xive2End *end, uint32_t width, HWADDR_PRIx "\n", qaddr);return ; } -monitor_printf (mon,"%s%08x " , i == width -1 ?"^" :"" , -be32_to_cpu (qdata)); +g_string_append_printf (buf,"%s%08x " , i == width -1 ?"^" :"" , +be32_to_cpu (qdata)); qindex = (qindex +1 ) & (qentries -1 ); } -monitor_printf (mon,"]" ); +g_string_append_printf (buf,"]" ); }void xive2_end_pic_print_info (Xive2End *end,uint32_t end_idx,Monitor *mon)
@@ -108,9 +108,14 @@ void xive2_end_pic_print_info(Xive2End *end, uint32_t end_idx, Monitor *mon) priority, nvp_blk, nvp_idx);if (qaddr_base) { +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ; +monitor_printf (mon," eq:@%08" PRIx64"% 6d/%5d ^%d" , qaddr_base, qindex, qentries, qgen); -xive2_end_queue_pic_print_info (end,6 , mon); +xive2_end_queue_pic_print_info (end,6 , buf); + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); }monitor_printf (mon,"\n" ); }
Signature · 1 line
2.41.0
PATCH 20/26 hw/ppc: Avoid using Monitor in xive2_end_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/xive2_regs.h | 2 +- hw/intc/pnv_xive2.c | 8 +++---- hw/intc/xive2.c | 48 ++++++++++++++++--------------------- 3 files changed, 26 insertions(+), 32 deletions(-)
include/hw/ppc/xive2_regs.h +1 -1
@@ -130,7 +130,7 @@ static inline uint64_t xive2_end_qaddr(Xive2End *end) (be32_to_cpu (end->w3) &END2_W3_EQ_ADDR_LO ); } -void xive2_end_pic_print_info (Xive2End *end,uint32_t end_idx,Monitor *mon); +void xive2_end_pic_print_info (Xive2End *end,uint32_t end_idx,GString *buf);void xive2_end_queue_pic_print_info (Xive2End *end,uint32_t width,GString *buf); void xive2_end_eas_pic_print_info(Xive2End *end, uint32_t end_idx,
hw/intc/pnv_xive2.c +4 -4
@@ -2141,14 +2141,14 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon)while (!xive2_router_get_end (xrtr, blk, i, &end)) {xive2_end_eas_pic_print_info (&end, i++, buf); } - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); -monitor_printf (mon,"XIVE[%x] #%d ENDT\n" , chip_id, blk); +g_string_append_printf (buf,"XIVE[%x] #%d ENDT\n" , chip_id, blk); i =0 ;while (!xive2_router_get_end (xrtr, blk, i, &end)) { -xive2_end_pic_print_info (&end, i++, mon); +xive2_end_pic_print_info (&end, i++, buf); } + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text);monitor_printf (mon,"XIVE[%x] #%d NVPT %08x .. %08x\n" , chip_id, blk,0 ,XIVE2_NVP_COUNT -1 );
hw/intc/xive2.c +21 -27
74 lines not on this page · raw message
Signature · 1 line
2.41.0
PATCH 21/26 hw/ppc: Avoid using Monitor in xive2_nvp_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- hw/intc/pnv_xive2.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-)
hw/intc/pnv_xive2.c +15 -14
@@ -2028,7 +2028,7 @@ static void pnv_xive2_register_types(void)type_init (pnv_xive2_register_types) static void xive2_nvp_pic_print_info(Xive2Nvp *nvp, uint32_t nvp_idx, -Monitor *mon) +GString *buf) {uint8_t eq_blk =xive_get_field32 (NVP2_W5_VP_END_BLOCK , nvp->w5);uint32_t eq_idx =xive_get_field32 (NVP2_W5_VP_END_INDEX , nvp->w5);
@@ -2037,21 +2037,21 @@ static void xive2_nvp_pic_print_info(Xive2Nvp *nvp, uint32_t nvp_idx,return ; } -monitor_printf (mon," %08x end:%02x/%04x IPB:%02x" , - nvp_idx, eq_blk, eq_idx, -xive_get_field32 (NVP2_W2_IPB , nvp->w2)); +g_string_append_printf (buf," %08x end:%02x/%04x IPB:%02x" , + nvp_idx, eq_blk, eq_idx, +xive_get_field32 (NVP2_W2_IPB , nvp->w2));/* * When the NVP is HW controlled, more fields are updated */ if (xive2_nvp_is_hw (nvp)) { -monitor_printf (mon," CPPR:%02x" , -xive_get_field32 (NVP2_W2_CPPR , nvp->w2)); +g_string_append_printf (buf," CPPR:%02x" , +xive_get_field32 (NVP2_W2_CPPR , nvp->w2));if (xive2_nvp_is_co (nvp)) { -monitor_printf (mon," CO:%04x" , -xive_get_field32 (NVP2_W1_CO_THRID , nvp->w1)); +g_string_append_printf (buf," CO:%04x" , +xive_get_field32 (NVP2_W1_CO_THRID , nvp->w1)); } } -monitor_printf (mon,"\n" ); +g_string_append_c (buf,'\n' ); }/*
@@ -2147,15 +2147,16 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon)while (!xive2_router_get_end (xrtr, blk, i, &end)) {xive2_end_pic_print_info (&end, i++, buf); } - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); -monitor_printf (mon,"XIVE[%x] #%d NVPT %08x .. %08x\n" , chip_id, blk, -0 ,XIVE2_NVP_COUNT -1 ); +g_string_append_printf (buf,"XIVE[%x] #%d NVPT %08x .. %08x\n" , + chip_id, blk,0 ,XIVE2_NVP_COUNT -1 ); xive_nvp_per_subpage =pnv_xive2_vst_per_subpage (xive,VST_NVP );for (i =0 ; i <XIVE2_NVP_COUNT ; i += xive_nvp_per_subpage) {while (!xive2_router_get_nvp (xrtr, blk, i, &nvp)) { -xive2_nvp_pic_print_info (&nvp, i++, mon); +xive2_nvp_pic_print_info (&nvp, i++, buf); } } + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); }
Signature · 1 line
2.41.0
PATCH 22/26 hw/ppc: Avoid using Monitor in pnv_xive2_pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/pnv_xive.h | 2 +- hw/intc/pnv_xive2.c | 9 +-------- hw/ppc/pnv.c | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-)
include/hw/ppc/pnv_xive.h +1 -1
@@ -163,6 +163,6 @@ typedef struct PnvXive2Class { DeviceRealize parent_realize; } PnvXive2Class; -void pnv_xive2_pic_print_info (PnvXive2 *xive,Monitor *mon); +void pnv_xive2_pic_print_info (PnvXive2 *xive,GString *buf);#endif /* PPC_PNV_XIVE_H */
hw/intc/pnv_xive2.c +1 -8
@@ -10,11 +10,9 @@#include "qemu/osdep.h" #include "qemu/log.h" #include "qapi/error.h" -#include "qapi/type-helpers.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/dma.h" -#include "monitor/monitor.h" #include "hw/ppc/fdt.h" #include "hw/ppc/pnv.h" #include "hw/ppc/pnv_chip.h"
@@ -2105,7 +2103,7 @@ static uint64_t pnv_xive2_vst_per_subpage(PnvXive2 *xive, uint32_t type)return (1ull << page_shift) / info->size; } -void pnv_xive2_pic_print_info (PnvXive2 *xive,Monitor *mon) +void pnv_xive2_pic_print_info (PnvXive2 *xive,GString *buf) {Xive2Router *xrtr =XIVE2_ROUTER (xive);uint8_t blk =pnv_xive2_block_id (xive);
@@ -2117,8 +2115,6 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon)Xive2Nvp nvp;int i;uint64_t xive_nvp_per_subpage; -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ;g_string_append_printf (buf,"XIVE[%x] Source %08x .. %08x\n" , blk, srcno0, srcno0 + nr_esbs -1 );
@@ -2156,7 +2152,4 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor *mon)xive2_nvp_pic_print_info (&nvp, i++, buf); } } - - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); }
hw/ppc/pnv.c +1 -1
@@ -864,7 +864,7 @@ static void pnv_chip_power10_pic_print_info(PnvChip *chip, Monitor *mon)g_autoptr (GString) buf =g_string_new ("" );g_autoptr (HumanReadableText) info =NULL ; -pnv_xive2_pic_print_info (&chip10->xive, mon); +pnv_xive2_pic_print_info (&chip10->xive, buf);pnv_psi_pic_print_info (&chip10->psi, buf); info =human_readable_text_from_str (buf);
Signature · 1 line
2.41.0
PATCH 23/26 hw/ppc: Avoid using Monitor in SpaprInterruptControllerClass::print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/spapr_irq.h | 2 +- hw/intc/spapr_xive.c | 9 +-------- hw/intc/xics_spapr.c | 9 +-------- hw/ppc/spapr_irq.c | 8 +++++++- 4 files changed, 10 insertions(+), 18 deletions(-)
include/hw/ppc/spapr_irq.h +1 -1
@@ -73,7 +73,7 @@ struct SpaprInterruptControllerClass {/* These methods should only be called on the active intc */ void (*set_irq)(SpaprInterruptController *intc,int irq,int val); -void (*print_info)(SpaprInterruptController *intc,Monitor *mon); +void (*print_info)(SpaprInterruptController *intc,GString *buf);void (*dt)(SpaprInterruptController *intc,uint32_t nr_servers,void *fdt,uint32_t phandle);int (*post_load)(SpaprInterruptController *intc,int version_id);
hw/intc/spapr_xive.c +1 -8
@@ -11,13 +11,11 @@#include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" -#include "qapi/type-helpers.h" #include "qemu/error-report.h" #include "target/ppc/cpu.h" #include "sysemu/cpus.h" #include "sysemu/reset.h" #include "migration/vmstate.h" -#include "monitor/monitor.h" #include "hw/ppc/fdt.h" #include "hw/ppc/spapr.h" #include "hw/ppc/spapr_cpu_core.h"
@@ -701,12 +699,10 @@ static void spapr_xive_set_irq(SpaprInterruptController *intc, int irq, int val) } } -static void spapr_xive_print_info (SpaprInterruptController *intc,Monitor *mon) +static void spapr_xive_print_info (SpaprInterruptController *intc,GString *buf) {SpaprXive *xive =SPAPR_XIVE (intc);CPUState *cs; -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ;CPU_FOREACH (cs) {PowerPCCPU *cpu =POWERPC_CPU (cs);
@@ -714,9 +710,6 @@ static void spapr_xive_print_info(SpaprInterruptController *intc, Monitor *mon)xive_tctx_pic_print_info (spapr_cpu_state (cpu)->tctx, buf); }spapr_xive_pic_print_info (xive, buf); - - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); } static void spapr_xive_dt(SpaprInterruptController *intc, uint32_t nr_servers,
hw/intc/xics_spapr.c +1 -8
@@ -34,8 +34,6 @@#include "hw/ppc/xics_spapr.h" #include "hw/ppc/fdt.h" #include "qapi/visitor.h" -#include "qapi/type-helpers.h" -#include "monitor/monitor.h" /* * Guest interfaces
@@ -397,12 +395,10 @@ static void xics_spapr_set_irq(SpaprInterruptController *intc, int irq, int val)ics_set_irq (ics, srcno, val); } -static void xics_spapr_print_info (SpaprInterruptController *intc,Monitor *mon) +static void xics_spapr_print_info (SpaprInterruptController *intc,GString *buf) {ICSState *ics =ICS_SPAPR (intc);CPUState *cs; -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ;CPU_FOREACH (cs) {PowerPCCPU *cpu =POWERPC_CPU (cs);
@@ -410,9 +406,6 @@ static void xics_spapr_print_info(SpaprInterruptController *intc, Monitor *mon)icp_pic_print_info (spapr_cpu_state (cpu)->icp, buf); }ics_pic_print_info (ics, buf); - - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); }static int xics_spapr_post_load (SpaprInterruptController *intc,int version_id)
hw/ppc/spapr_irq.c +7 -1
@@ -11,6 +11,7 @@#include "qemu/log.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "qapi/type-helpers.h" #include "hw/irq.h" #include "hw/ppc/spapr.h" #include "hw/ppc/spapr_cpu_core.h"
@@ -18,6 +19,7 @@#include "hw/ppc/xics.h" #include "hw/ppc/xics_spapr.h" #include "hw/qdev-properties.h" +#include "monitor/monitor.h" #include "cpu-models.h" #include "sysemu/kvm.h"
@@ -269,8 +271,12 @@ void spapr_irq_print_info(SpaprMachineState *spapr, Monitor *mon) {SpaprInterruptControllerClass *sicc =SPAPR_INTC_GET_CLASS (spapr->active_intc); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ; - sicc->print_info (spapr->active_intc, mon); + sicc->print_info (spapr->active_intc, buf); + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); } void spapr_irq_dt(SpaprMachineState *spapr, uint32_t nr_servers,
Signature · 1 line
2.41.0
PATCH 24/26 hw/ppc: Avoid using Monitor in spapr_irq_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/spapr_irq.h | 2 +- hw/ppc/spapr.c | 11 ++++++++--- hw/ppc/spapr_irq.c | 8 +------- 3 files changed, 10 insertions(+), 11 deletions(-)
include/hw/ppc/spapr_irq.h +1 -1
@@ -85,7 +85,7 @@ int spapr_irq_cpu_intc_create(struct SpaprMachineState *spapr, PowerPCCPU *cpu, Error **errp);void spapr_irq_cpu_intc_reset (struct SpaprMachineState *spapr,PowerPCCPU *cpu);void spapr_irq_cpu_intc_destroy (struct SpaprMachineState *spapr,PowerPCCPU *cpu); -void spapr_irq_print_info (struct SpaprMachineState *spapr,Monitor *mon); +void spapr_irq_print_info (struct SpaprMachineState *spapr,GString *buf);void spapr_irq_dt (struct SpaprMachineState *spapr,uint32_t nr_servers,void *fdt,uint32_t phandle);
hw/ppc/spapr.c +8 -3
@@ -31,6 +31,7 @@#include "qapi/error.h" #include "qapi/qapi-events-machine.h" #include "qapi/qapi-events-qdev.h" +#include "qapi/type-helpers.h" #include "qapi/visitor.h" #include "sysemu/sysemu.h" #include "sysemu/hostmem.h"
@@ -4530,10 +4531,14 @@ static void spapr_pic_print_info(InterruptStatsProvider *obj, Monitor *mon) {SpaprMachineState *spapr =SPAPR_MACHINE (obj); +g_autoptr (GString) buf =g_string_new ("" ); +g_autoptr (HumanReadableText) info =NULL ; -spapr_irq_print_info (spapr, mon); -monitor_printf (mon,"irqchip: %s\n" , -kvm_irqchip_in_kernel () ?"in-kernel" :"emulated" ); +spapr_irq_print_info (spapr, buf); +g_string_append_printf (buf,"irqchip: %s\n" , +kvm_irqchip_in_kernel () ?"in-kernel" :"emulated" ); + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); }/*
hw/ppc/spapr_irq.c +1 -7
@@ -11,7 +11,6 @@#include "qemu/log.h" #include "qemu/error-report.h" #include "qapi/error.h" -#include "qapi/type-helpers.h" #include "hw/irq.h" #include "hw/ppc/spapr.h" #include "hw/ppc/spapr_cpu_core.h"
@@ -19,7 +18,6 @@#include "hw/ppc/xics.h" #include "hw/ppc/xics_spapr.h" #include "hw/qdev-properties.h" -#include "monitor/monitor.h" #include "cpu-models.h" #include "sysemu/kvm.h"
@@ -267,16 +265,12 @@ static void spapr_set_irq(void *opaque, int irq, int level) sicc->set_irq (spapr->active_intc, irq, level); } -void spapr_irq_print_info (SpaprMachineState *spapr,Monitor *mon) +void spapr_irq_print_info (SpaprMachineState *spapr,GString *buf) {SpaprInterruptControllerClass *sicc =SPAPR_INTC_GET_CLASS (spapr->active_intc); -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ; sicc->print_info (spapr->active_intc, buf); - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); } void spapr_irq_dt(SpaprMachineState *spapr, uint32_t nr_servers,
Signature · 1 line
2.41.0
PATCH 25/26 hw/ppc: Avoid using Monitor in pnv_chip_power9_pic_print_info_child()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- hw/ppc/pnv.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)
hw/ppc/pnv.c +6 -12
@@ -789,18 +789,14 @@ static void pnv_chip_power8_pic_print_info(PnvChip *chip, Monitor *mon)static int pnv_chip_power9_pic_print_info_child (Object *child,void *opaque) { -Monitor *mon = opaque; +GString *buf = opaque;PnvPHB *phb = (PnvPHB *)object_dynamic_cast (child,TYPE_PNV_PHB ); -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ;if (!phb) {return 0 ; }pnv_phb4_pic_print_info (PNV_PHB4 (phb->backend), buf); - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text);return 0 ; }
@@ -813,12 +809,11 @@ static void pnv_chip_power9_pic_print_info(PnvChip *chip, Monitor *mon)pnv_xive_pic_print_info (&chip9->xive, buf);pnv_psi_pic_print_info (&chip9->psi, buf); +object_child_foreach_recursive (OBJECT (chip), + pnv_chip_power9_pic_print_info_child, buf); info =human_readable_text_from_str (buf);monitor_puts (mon, info->human_readable_text); - -object_child_foreach_recursive (OBJECT (chip), - pnv_chip_power9_pic_print_info_child, mon); } static uint64_t pnv_chip_power8_xscom_core_base(PnvChip *chip,
@@ -865,13 +860,12 @@ static void pnv_chip_power10_pic_print_info(PnvChip *chip, Monitor *mon)g_autoptr (HumanReadableText) info =NULL ;pnv_xive2_pic_print_info (&chip10->xive, buf); -pnv_psi_pic_print_info (&chip10->psi, buf); +object_child_foreach_recursive (OBJECT (chip), + pnv_chip_power9_pic_print_info_child, buf); + info =human_readable_text_from_str (buf);monitor_puts (mon, info->human_readable_text); - -object_child_foreach_recursive (OBJECT (chip), - pnv_chip_power9_pic_print_info_child, mon); }/* Always give the first 1GB to chip 0 else we won't boot */
Signature · 1 line
2.41.0
PATCH 26/26 hw/ppc: Avoid using Monitor in pic_print_info()
In reply to Philippe Mathieu-DaudéReplace Monitor API by HumanReadableText one.
--- include/hw/ppc/pnv_chip.h | 2 +- hw/ppc/pnv.c | 29 +++++++---------------------- 2 files changed, 8 insertions(+), 23 deletions(-)
include/hw/ppc/pnv_chip.h +1 -1
@@ -154,7 +154,7 @@ struct PnvChipClass {void (*intc_print_info)(PnvChip *chip,PowerPCCPU *cpu,GString *buf); ISABus *(*isa_create)(PnvChip *chip, Error **errp);void (*dt_populate)(PnvChip *chip,void *fdt); -void (*pic_print_info)(PnvChip *chip,Monitor *mon); +void (*pic_print_info)(PnvChip *chip,GString *buf);uint64_t (*xscom_core_base)(PnvChip *chip,uint32_t core_id);uint32_t (*xscom_pcba)(PnvChip *chip,uint64_t addr); };
hw/ppc/pnv.c +7 -22
@@ -765,14 +765,11 @@ static ISABus *pnv_isa_create(PnvChip *chip, Error **errp)return PNV_CHIP_GET_CLASS (chip)->isa_create (chip, errp); } -static void pnv_chip_power8_pic_print_info (PnvChip *chip,Monitor *mon) +static void pnv_chip_power8_pic_print_info (PnvChip *chip,GString *buf) {Pnv8Chip *chip8 =PNV8_CHIP (chip);int i; -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ; -ics_pic_print_info (&chip8->psi.ics, buf);for (i =0 ; i < chip8->num_phbs; i++) {
@@ -782,9 +779,6 @@ static void pnv_chip_power8_pic_print_info(PnvChip *chip, Monitor *mon)pnv_phb3_msi_pic_print_info (&phb3->msis, buf);ics_pic_print_info (&phb3->lsis, buf); } - - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); }static int pnv_chip_power9_pic_print_info_child (Object *child,void *opaque)
@@ -801,19 +795,14 @@ static int pnv_chip_power9_pic_print_info_child(Object *child, void *opaque)return 0 ; } -static void pnv_chip_power9_pic_print_info (PnvChip *chip,Monitor *mon) +static void pnv_chip_power9_pic_print_info (PnvChip *chip,GString *buf) {Pnv9Chip *chip9 =PNV9_CHIP (chip); -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ;pnv_xive_pic_print_info (&chip9->xive, buf);pnv_psi_pic_print_info (&chip9->psi, buf);object_child_foreach_recursive (OBJECT (chip), pnv_chip_power9_pic_print_info_child, buf); - - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); } static uint64_t pnv_chip_power8_xscom_core_base(PnvChip *chip,
@@ -853,19 +842,14 @@ static void pnv_ipmi_bt_init(ISABus *bus, IPMIBmc *bmc, uint32_t irq)isa_realize_and_unref (dev, bus, &error_fatal); } -static void pnv_chip_power10_pic_print_info (PnvChip *chip,Monitor *mon) +static void pnv_chip_power10_pic_print_info (PnvChip *chip,GString *buf) {Pnv10Chip *chip10 =PNV10_CHIP (chip); -g_autoptr (GString) buf =g_string_new ("" ); -g_autoptr (HumanReadableText) info =NULL ;pnv_xive2_pic_print_info (&chip10->xive, buf);pnv_psi_pic_print_info (&chip10->psi, buf);object_child_foreach_recursive (OBJECT (chip), pnv_chip_power9_pic_print_info_child, buf); - - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text); }/* Always give the first 1GB to chip 0 else we won't boot */
@@ -2363,12 +2347,13 @@ static void pnv_pic_print_info(InterruptStatsProvider *obj,PNV_CHIP_GET_CLASS (pnv->chips[0 ])->intc_print_info (pnv->chips[0 ], cpu, buf); } - info =human_readable_text_from_str (buf); -monitor_puts (mon, info->human_readable_text);for (i =0 ; i < pnv->num_chips; i++) { -PNV_CHIP_GET_CLASS (pnv->chips[i])->pic_print_info (pnv->chips[i], mon); +PNV_CHIP_GET_CLASS (pnv->chips[i])->pic_print_info (pnv->chips[i], buf); } + + info =human_readable_text_from_str (buf); +monitor_puts (mon, info->human_readable_text); } static int pnv_match_nvt(XiveFabric *xfb, uint8_t format,
Signature · 1 line
2.41.0
Quoted 9 lines · Philippe Mathieu-Daudé
Hi,
This series remove uses of Monitor in hw/ppc/, replacing by the more generic HumanReadableText. Care is taken to keep the commit bisectables by updating functions one by one, also easing review.
For rationale see previous series from Daniel:
https://lore.kernel.org/qemu-devel/[email protected]/
Or more specifically commit f2de406f29 ("docs/devel: document expectations for QAPI data modelling for QMP").
Quoted 4 lines
Regards,
Phil.
Quoted 9 lines · Philippe Mathieu-Daudé
Hi,
This series remove uses of Monitor in hw/ppc/, replacing by the more generic HumanReadableText. Care is taken to keep the commit bisectables by updating functions one by one, also easing review.
For rationale see previous series from Daniel:
https://lore.kernel.org/qemu-devel/[email protected]/
This looks OK to me but I think there are patches in the ppc queue that will conflict. I would wait for Nick to send a PR first and then rebase.
Thanks,
C.
Quoted 59 lines
Regards,
Phil.
Philippe Mathieu-Daudé (26):
hw/ppc: Avoid using Monitor inpnv_phb3_msi_pic_print_info()hw/ppc: Avoid using Monitor inicp_pic_print_info()hw/ppc: Avoid using Monitor inxive_tctx_pic_print_info()hw/ppc: Avoid using Monitor inics_pic_print_info()hw/ppc: Avoid using Monitor inPnvChipClass::intc_print_info()hw/ppc: Avoid using Monitor inxive_end_queue_pic_print_info()hw/ppc: Avoid using Monitor inspapr_xive_end_pic_print_info()hw/ppc: Avoid using Monitor inspapr_xive_pic_print_info()hw/ppc: Avoid using Monitor inxive_source_pic_print_info()hw/ppc: Avoid using Monitor inpnv_phb4_pic_print_info()hw/ppc: Avoid using Monitor inxive_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive_end_pic_print_info()hw/ppc: Avoid using Monitor inxive_end_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive_nvt_pic_print_info()hw/ppc: Avoid using Monitor inpnv_xive_pic_print_info()hw/ppc: Avoid using Monitor inpnv_psi_pic_print_info()hw/ppc: Avoid using Monitor inxive2_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_queue_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_pic_print_info()hw/ppc: Avoid using Monitor inxive2_nvp_pic_print_info()hw/ppc: Avoid using Monitor inpnv_xive2_pic_print_info()hw/ppc: Avoid using Monitor in
SpaprInterruptControllerClass::print_info()
hw/ppc: Avoid using Monitor inspapr_irq_print_info()hw/ppc: Avoid using Monitor inpnv_chip_power9_pic_print_info_child()hw/ppc: Avoid using Monitor inpic_print_info()include/hw/pci-host/pnv_phb3.h | 2 +- include/hw/pci-host/pnv_phb4.h | 2 +- include/hw/ppc/pnv_chip.h | 4 +- include/hw/ppc/pnv_psi.h | 2 +- include/hw/ppc/pnv_xive.h | 4 +- include/hw/ppc/spapr_irq.h | 4 +- include/hw/ppc/xics.h | 4 +- include/hw/ppc/xive.h | 4 +- include/hw/ppc/xive2_regs.h | 8 +-- include/hw/ppc/xive_regs.h | 8 +-- hw/intc/pnv_xive.c | 38 ++++++------ hw/intc/pnv_xive2.c | 48 +++++++-------- hw/intc/spapr_xive.c | 41 ++++++------- hw/intc/xics.c | 25 ++++---- hw/intc/xics_spapr.c | 7 +-- hw/intc/xive.c | 108 ++++++++++++++++----------------- hw/intc/xive2.c | 87 +++++++++++++------------- hw/pci-host/pnv_phb3_msi.c | 21 +++---- hw/pci-host/pnv_phb4.c | 17 +++--- hw/ppc/pnv.c | 52 ++++++++-------- hw/ppc/pnv_psi.c | 9 ++- hw/ppc/spapr.c | 11 +++- hw/ppc/spapr_irq.c | 4 +- 23 files changed, 256 insertions(+), 254 deletions(-)
Quoted 6 lines · Philippe Mathieu-Daudé
Hi,
This series remove uses of Monitor in hw/ppc/, replacing by the more generic HumanReadableText. Care is taken to keep the commit bisectables by updating functions one by one, also easing review.
Did you do any testing ? POWER[8-10] CPUs on pseries and powernv machines should be checked. A bit tedious I agree but not that long.
Thanks,
C.
Quoted 62 lines
For rationale see previous series from Daniel:
https://lore.kernel.org/qemu-devel/[email protected]/Regards,
Phil.
Philippe Mathieu-Daudé (26):
hw/ppc: Avoid using Monitor inpnv_phb3_msi_pic_print_info()hw/ppc: Avoid using Monitor inicp_pic_print_info()hw/ppc: Avoid using Monitor inxive_tctx_pic_print_info()hw/ppc: Avoid using Monitor inics_pic_print_info()hw/ppc: Avoid using Monitor inPnvChipClass::intc_print_info()hw/ppc: Avoid using Monitor inxive_end_queue_pic_print_info()hw/ppc: Avoid using Monitor inspapr_xive_end_pic_print_info()hw/ppc: Avoid using Monitor inspapr_xive_pic_print_info()hw/ppc: Avoid using Monitor inxive_source_pic_print_info()hw/ppc: Avoid using Monitor inpnv_phb4_pic_print_info()hw/ppc: Avoid using Monitor inxive_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive_end_pic_print_info()hw/ppc: Avoid using Monitor inxive_end_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive_nvt_pic_print_info()hw/ppc: Avoid using Monitor inpnv_xive_pic_print_info()hw/ppc: Avoid using Monitor inpnv_psi_pic_print_info()hw/ppc: Avoid using Monitor inxive2_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_queue_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_pic_print_info()hw/ppc: Avoid using Monitor inxive2_nvp_pic_print_info()hw/ppc: Avoid using Monitor inpnv_xive2_pic_print_info()hw/ppc: Avoid using Monitor in
SpaprInterruptControllerClass::print_info()
hw/ppc: Avoid using Monitor inspapr_irq_print_info()hw/ppc: Avoid using Monitor inpnv_chip_power9_pic_print_info_child()hw/ppc: Avoid using Monitor inpic_print_info()include/hw/pci-host/pnv_phb3.h | 2 +- include/hw/pci-host/pnv_phb4.h | 2 +- include/hw/ppc/pnv_chip.h | 4 +- include/hw/ppc/pnv_psi.h | 2 +- include/hw/ppc/pnv_xive.h | 4 +- include/hw/ppc/spapr_irq.h | 4 +- include/hw/ppc/xics.h | 4 +- include/hw/ppc/xive.h | 4 +- include/hw/ppc/xive2_regs.h | 8 +-- include/hw/ppc/xive_regs.h | 8 +-- hw/intc/pnv_xive.c | 38 ++++++------ hw/intc/pnv_xive2.c | 48 +++++++-------- hw/intc/spapr_xive.c | 41 ++++++------- hw/intc/xics.c | 25 ++++---- hw/intc/xics_spapr.c | 7 +-- hw/intc/xive.c | 108 ++++++++++++++++----------------- hw/intc/xive2.c | 87 +++++++++++++------------- hw/pci-host/pnv_phb3_msi.c | 21 +++---- hw/pci-host/pnv_phb4.c | 17 +++--- hw/ppc/pnv.c | 52 ++++++++-------- hw/ppc/pnv_psi.c | 9 ++- hw/ppc/spapr.c | 11 +++- hw/ppc/spapr_irq.c | 4 +- 23 files changed, 256 insertions(+), 254 deletions(-)
Quoted 10 lines · Cédric Le Goater
Quoted 6 lines · Philippe Mathieu-Daudé
Hi,
This series remove uses of Monitor in hw/ppc/, replacing by the more generic HumanReadableText. Care is taken to keep the commit bisectables by updating functions one by one, also easing review.
Did you do any testing ? POWER[8-10] CPUs on pseries and powernv machines should be checked. A bit tedious I agree but not that long.
I ran these smoke tests comparing monitor output with baseline:
$ ./qemu-system-ppc64 -M powernv8 -S -monitor stdio
QEMU 9.0.50 monitor - type 'help' for more information
(qemu) info pic
CPU 0 XIRR=00000000 (0x0) PP=ff MFRR=ff
ICS 1000..1005 0x14c03d9c0
1000 LSI ff 00
1001 LSI ff 00
1002 LSI ff 00
1003 LSI ff 00
1004 LSI ff 00
1005 LSI ff 00
ICS 0.. 7ff 0x14c0e93e8
ICS 0.. 7 0x14c0e9328
0 LSI ff 00
1 LSI ff 00
2 LSI ff 00
3 LSI ff 00
4 LSI ff 00
5 LSI ff 00
6 LSI ff 00
7 LSI ff 00
ICS 0.. 7ff 0x14c16ffe8
ICS 0.. 7 0x14c16ff28
0 LSI ff 00
1 LSI ff 00
2 LSI ff 00
3 LSI ff 00
4 LSI ff 00
5 LSI ff 00
6 LSI ff 00
7 LSI ff 00
ICS 0.. 7ff 0x14c2177e8
ICS 0.. 7 0x14c217728
0 LSI ff 00
1 LSI ff 00
2 LSI ff 00
3 LSI ff 00
4 LSI ff 00
5 LSI ff 00
6 LSI ff 00
7 LSI ff 00
Interrupt controller information not available for power8_v2.0-powerpc64-cpu.
(qemu) q$ ./qemu-system-ppc64 -M pseries -cpu power10 -S -monitor stdio QEMU 9.0.50 monitor - type 'help' for more information qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-cfpc=workaround qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-sbbc=workaround qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-ibs=workaround qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-ccf-assist=on (qemu) info pic CPU 0 XIRR=00000000 (0x0) PP=ff MFRR=ff ICS 1000..1fff 0x600003b05b00 1000 MSI ff 00 1001 MSI ff 00 1100 MSI ff 00 1101 MSI ff 00 1102 MSI ff 00 1103 MSI ff 00 1200 LSI ff 00 1201 LSI ff 00 1202 LSI ff 00 1203 LSI ff 00 irqchip: emulated Interrupt controller information not available for power10_v2.0-powerpc64-cpu. (qemu) q
Quoted 48 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Cédric Le Goater
Quoted 6 lines · Philippe Mathieu-Daudé
Hi,
This series remove uses of Monitor in hw/ppc/, replacing by the more generic HumanReadableText. Care is taken to keep the commit bisectables by updating functions one by one, also easing review.
Did you do any testing ? POWER[8-10] CPUs on pseries and powernv machines should be checked. A bit tedious I agree but not that long.
I ran these smoke tests comparing monitor output with baseline:
$ ./qemu-system-ppc64 -M powernv8 -S -monitor stdio QEMU 9.0.50 monitor - type 'help' for more information (qemu) info pic CPU 0 XIRR=00000000 (0x0) PP=ff MFRR=ff ICS 1000..1005 0x14c03d9c0 1000 LSI ff 00 1001 LSI ff 00 1002 LSI ff 00 1003 LSI ff 00 1004 LSI ff 00 1005 LSI ff 00 ICS 0.. 7ff 0x14c0e93e8 ICS 0.. 7 0x14c0e9328 0 LSI ff 00 1 LSI ff 00 2 LSI ff 00 3 LSI ff 00 4 LSI ff 00 5 LSI ff 00 6 LSI ff 00 7 LSI ff 00 ICS 0.. 7ff 0x14c16ffe8 ICS 0.. 7 0x14c16ff28 0 LSI ff 00 1 LSI ff 00 2 LSI ff 00 3 LSI ff 00 4 LSI ff 00 5 LSI ff 00 6 LSI ff 00 7 LSI ff 00 ICS 0.. 7ff 0x14c2177e8 ICS 0.. 7 0x14c217728 0 LSI ff 00
Quoted 8 lines
1 LSI ff 00 2 LSI ff 00 3 LSI ff 00 4 LSI ff 00 5 LSI ff 00 6 LSI ff 00 7 LSI ff 00 Interrupt controller information not available for power8_v2.0-powerpc64-cpu.
This is only checking the older interrupt controller. Please try powernv10.
Quoted 16 lines
(qemu) q
$ ./qemu-system-ppc64 -M pseries -cpu power10 -S -monitor stdio QEMU 9.0.50 monitor - type 'help' for more information qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-cfpc=workaround qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-sbbc=workaround qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-ibs=workaround qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-ccf-assist=on (qemu) info pic CPU 0 XIRR=00000000 (0x0) PP=ff MFRR=ff ICS 1000..1fff 0x600003b05b00 1000 MSI ff 00 1001 MSI ff 00 1100 MSI ff 00 1101 MSI ff 00 1102 MSI ff 00
Quoted 8 lines
1103 MSI ff 00 1200 LSI ff 00 1201 LSI ff 00 1202 LSI ff 00 1203 LSI ff 00 irqchip: emulated Interrupt controller information not available for power10_v2.0-powerpc64-cpu. (qemu) q
This is only checking the old interrupt controller. Please try :
qemu-system-ppc64 -M pseries,ic-mode=xive -cpu power10 -S -monitor stdio
and we should be fine.
Thanks,
C.
Quoted 86 lines · Cédric Le Goater
Quoted 48 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Cédric Le Goater
Quoted 6 lines · Philippe Mathieu-Daudé
Hi,
This series remove uses of Monitor in hw/ppc/, replacing by the more generic HumanReadableText. Care is taken to keep the commit bisectables by updating functions one by one, also easing review.
Did you do any testing ? POWER[8-10] CPUs on pseries and powernv machines should be checked. A bit tedious I agree but not that long.
I ran these smoke tests comparing monitor output with baseline:
$ ./qemu-system-ppc64 -M powernv8 -S -monitor stdio QEMU 9.0.50 monitor - type 'help' for more information (qemu) info pic CPU 0 XIRR=00000000 (0x0) PP=ff MFRR=ff ICS 1000..1005 0x14c03d9c0 1000 LSI ff 00 1001 LSI ff 00 1002 LSI ff 00 1003 LSI ff 00 1004 LSI ff 00 1005 LSI ff 00 ICS 0.. 7ff 0x14c0e93e8 ICS 0.. 7 0x14c0e9328 0 LSI ff 00 1 LSI ff 00 2 LSI ff 00 3 LSI ff 00 4 LSI ff 00 5 LSI ff 00 6 LSI ff 00 7 LSI ff 00 ICS 0.. 7ff 0x14c16ffe8 ICS 0.. 7 0x14c16ff28 0 LSI ff 00 1 LSI ff 00 2 LSI ff 00 3 LSI ff 00 4 LSI ff 00 5 LSI ff 00 6 LSI ff 00 7 LSI ff 00 ICS 0.. 7ff 0x14c2177e8 ICS 0.. 7 0x14c217728 0 LSI ff 00Quoted 8 lines
1 LSI ff 00 2 LSI ff 00 3 LSI ff 00 4 LSI ff 00 5 LSI ff 00 6 LSI ff 00 7 LSI ff 00 Interrupt controller information not available for power8_v2.0-powerpc64-cpu.This is only checking the older interrupt controller. Please try powernv10.
Quoted 16 lines
(qemu) q
$ ./qemu-system-ppc64 -M pseries -cpu power10 -S -monitor stdio QEMU 9.0.50 monitor - type 'help' for more information qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-cfpc=workaround qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-sbbc=workaround qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-ibs=workaround qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-ccf-assist=on (qemu) info pic CPU 0 XIRR=00000000 (0x0) PP=ff MFRR=ff ICS 1000..1fff 0x600003b05b00 1000 MSI ff 00 1001 MSI ff 00 1100 MSI ff 00 1101 MSI ff 00 1102 MSI ff 00Quoted 8 lines
1103 MSI ff 00 1200 LSI ff 00 1201 LSI ff 00 1202 LSI ff 00 1203 LSI ff 00 irqchip: emulated Interrupt controller information not available for power10_v2.0-powerpc64-cpu. (qemu) q
Quoted 5 lines
This is only checking the old interrupt controller. Please try :
qemu-system-ppc64 -M pseries,ic-mode=xive -cpu power10 -S -monitor stdio
and we should be fine.
No change in output:
$ ./qemu-system-ppc64 -M pseries,ic-mode=xive -cpu power10 -S -monitor stdio QEMU 9.0.50 monitor - type 'help' for more information qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-cfpc=workaround qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-sbbc=workaround qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-ibs=workaround qemu-system-ppc64: warning: TCG doesn't support requested feature, cap-ccf-assist=on (qemu) info pic CPU[0000]: QW NSR CPPR IPB LSMFB ACK# INC AGE PIPR W2 CPU[0000]: USER 00 00 00 00 00 00 00 00 00000000 CPU[0000]: OS 00 00 00 ff ff 00 ff ff 80000400 CPU[0000]: POOL 00 00 00 00 00 00 00 00 00000000 CPU[0000]: PHYS 00 00 00 00 00 00 00 ff 00000000 LISN PQ EISN CPU/PRIO EQ 00000000 MSI -Q M 00000000 00001000 MSI -Q M 00000000 00001001 MSI -Q M 00000000 00001100 MSI -Q M 00000000 00001101 MSI -Q M 00000000 00001102 MSI -Q M 00000000 00001103 MSI -Q M 00000000 00001200 LSI -Q M 00000000 00001201 LSI -Q M 00000000 00001202 LSI -Q M 00000000 00001203 LSI -Q M 00000000 irqchip: emulated Interrupt controller information not available for power10_v2.0-powerpc64-cpu. (qemu)
Quoted 59 lines · Philippe Mathieu-Daudé
Hi,
This series remove uses of Monitor in hw/ppc/, replacing by the more generic HumanReadableText. Care is taken to keep the commit bisectables by updating functions one by one, also easing review.
For rationale see previous series from Daniel:
https://lore.kernel.org/qemu-devel/[email protected]/Regards,
Phil.
Philippe Mathieu-Daudé (26):
hw/ppc: Avoid using Monitor inpnv_phb3_msi_pic_print_info()hw/ppc: Avoid using Monitor inicp_pic_print_info()hw/ppc: Avoid using Monitor inxive_tctx_pic_print_info()hw/ppc: Avoid using Monitor inics_pic_print_info()hw/ppc: Avoid using Monitor inPnvChipClass::intc_print_info()hw/ppc: Avoid using Monitor inxive_end_queue_pic_print_info()hw/ppc: Avoid using Monitor inspapr_xive_end_pic_print_info()hw/ppc: Avoid using Monitor inspapr_xive_pic_print_info()hw/ppc: Avoid using Monitor inxive_source_pic_print_info()hw/ppc: Avoid using Monitor inpnv_phb4_pic_print_info()hw/ppc: Avoid using Monitor inxive_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive_end_pic_print_info()hw/ppc: Avoid using Monitor inxive_end_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive_nvt_pic_print_info()hw/ppc: Avoid using Monitor inpnv_xive_pic_print_info()hw/ppc: Avoid using Monitor inpnv_psi_pic_print_info()hw/ppc: Avoid using Monitor inxive2_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_queue_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_pic_print_info()hw/ppc: Avoid using Monitor inxive2_nvp_pic_print_info()hw/ppc: Avoid using Monitor inpnv_xive2_pic_print_info()hw/ppc: Avoid using Monitor in
SpaprInterruptControllerClass::print_info()
hw/ppc: Avoid using Monitor inspapr_irq_print_info()hw/ppc: Avoid using Monitor inpnv_chip_power9_pic_print_info_child()hw/ppc: Avoid using Monitor inpic_print_info()include/hw/pci-host/pnv_phb3.h | 2 +- include/hw/pci-host/pnv_phb4.h | 2 +- include/hw/ppc/pnv_chip.h | 4 +- include/hw/ppc/pnv_psi.h | 2 +- include/hw/ppc/pnv_xive.h | 4 +- include/hw/ppc/spapr_irq.h | 4 +- include/hw/ppc/xics.h | 4 +- include/hw/ppc/xive.h | 4 +- include/hw/ppc/xive2_regs.h | 8 +-- include/hw/ppc/xive_regs.h | 8 +-- hw/intc/pnv_xive.c | 38 ++++++------ hw/intc/pnv_xive2.c | 48 +++++++-------- hw/intc/spapr_xive.c | 41 ++++++------- hw/intc/xics.c | 25 ++++---- hw/intc/xics_spapr.c | 7 +-- hw/intc/xive.c | 108 ++++++++++++++++-----------------
Quoted 11 lines
hw/intc/xive2.c | 87 +++++++++++++------------- hw/pci-host/pnv_phb3_msi.c | 21 +++---- hw/pci-host/pnv_phb4.c | 17 +++--- hw/ppc/pnv.c | 52 ++++++++-------- hw/ppc/pnv_psi.c | 9 ++- hw/ppc/spapr.c | 11 +++- hw/ppc/spapr_irq.c | 4 +- 23 files changed, 256 insertions(+), 254 deletions(-)Signature · 1 line
2.41.0
For the series:
Quoted 59 lines · Philippe Mathieu-Daudé
Hi,
This series remove uses of Monitor in hw/ppc/, replacing by the more generic HumanReadableText. Care is taken to keep the commit bisectables by updating functions one by one, also easing review.
For rationale see previous series from Daniel:
https://lore.kernel.org/qemu-devel/[email protected]/Regards,
Phil.
Philippe Mathieu-Daudé (26):
hw/ppc: Avoid using Monitor inpnv_phb3_msi_pic_print_info()hw/ppc: Avoid using Monitor inicp_pic_print_info()hw/ppc: Avoid using Monitor inxive_tctx_pic_print_info()hw/ppc: Avoid using Monitor inics_pic_print_info()hw/ppc: Avoid using Monitor inPnvChipClass::intc_print_info()hw/ppc: Avoid using Monitor inxive_end_queue_pic_print_info()hw/ppc: Avoid using Monitor inspapr_xive_end_pic_print_info()hw/ppc: Avoid using Monitor inspapr_xive_pic_print_info()hw/ppc: Avoid using Monitor inxive_source_pic_print_info()hw/ppc: Avoid using Monitor inpnv_phb4_pic_print_info()hw/ppc: Avoid using Monitor inxive_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive_end_pic_print_info()hw/ppc: Avoid using Monitor inxive_end_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive_nvt_pic_print_info()hw/ppc: Avoid using Monitor inpnv_xive_pic_print_info()hw/ppc: Avoid using Monitor inpnv_psi_pic_print_info()hw/ppc: Avoid using Monitor inxive2_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_queue_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_pic_print_info()hw/ppc: Avoid using Monitor inxive2_nvp_pic_print_info()hw/ppc: Avoid using Monitor inpnv_xive2_pic_print_info()hw/ppc: Avoid using Monitor in
SpaprInterruptControllerClass::print_info()
hw/ppc: Avoid using Monitor inspapr_irq_print_info()hw/ppc: Avoid using Monitor inpnv_chip_power9_pic_print_info_child()hw/ppc: Avoid using Monitor inpic_print_info()include/hw/pci-host/pnv_phb3.h | 2 +- include/hw/pci-host/pnv_phb4.h | 2 +- include/hw/ppc/pnv_chip.h | 4 +- include/hw/ppc/pnv_psi.h | 2 +- include/hw/ppc/pnv_xive.h | 4 +- include/hw/ppc/spapr_irq.h | 4 +- include/hw/ppc/xics.h | 4 +- include/hw/ppc/xive.h | 4 +- include/hw/ppc/xive2_regs.h | 8 +-- include/hw/ppc/xive_regs.h | 8 +-- hw/intc/pnv_xive.c | 38 ++++++------ hw/intc/pnv_xive2.c | 48 +++++++-------- hw/intc/spapr_xive.c | 41 ++++++------- hw/intc/xics.c | 25 ++++---- hw/intc/xics_spapr.c | 7 +-- hw/intc/xive.c | 108 ++++++++++++++++-----------------
Quoted 9 lines
hw/intc/xive2.c | 87 +++++++++++++------------- hw/pci-host/pnv_phb3_msi.c | 21 +++---- hw/pci-host/pnv_phb4.c | 17 +++--- hw/ppc/pnv.c | 52 ++++++++-------- hw/ppc/pnv_psi.c | 9 ++- hw/ppc/spapr.c | 11 +++- hw/ppc/spapr_irq.c | 4 +- 23 files changed, 256 insertions(+), 254 deletions(-)
Thanks,
C.
Quoted 29 lines · Cédric Le Goater
Quoted 20 lines
Philippe Mathieu-Daudé (26):
hw/ppc: Avoid using Monitor inpnv_phb3_msi_pic_print_info()hw/ppc: Avoid using Monitor inicp_pic_print_info()hw/ppc: Avoid using Monitor inxive_tctx_pic_print_info()hw/ppc: Avoid using Monitor inics_pic_print_info()hw/ppc: Avoid using Monitor inPnvChipClass::intc_print_info()hw/ppc: Avoid using Monitor inxive_end_queue_pic_print_info()hw/ppc: Avoid using Monitor inspapr_xive_end_pic_print_info()hw/ppc: Avoid using Monitor inspapr_xive_pic_print_info()hw/ppc: Avoid using Monitor inxive_source_pic_print_info()hw/ppc: Avoid using Monitor inpnv_phb4_pic_print_info()hw/ppc: Avoid using Monitor inxive_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive_end_pic_print_info()hw/ppc: Avoid using Monitor inxive_end_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive_nvt_pic_print_info()hw/ppc: Avoid using Monitor inpnv_xive_pic_print_info()hw/ppc: Avoid using Monitor inpnv_psi_pic_print_info()hw/ppc: Avoid using Monitor inxive2_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_queue_pic_print_info()Quoted 8 lines
hw/ppc: Avoid using Monitor in
xive2_end_pic_print_info()hw/ppc: Avoid using Monitor inxive2_nvp_pic_print_info()hw/ppc: Avoid using Monitor inpnv_xive2_pic_print_info()hw/ppc: Avoid using Monitor inSpaprInterruptControllerClass::print_info()
hw/ppc: Avoid using Monitor inspapr_irq_print_info()hw/ppc: Avoid using Monitor inpnv_chip_power9_pic_print_info_child()hw/ppc: Avoid using Monitor inpic_print_info()
Quoted 1 line
Reviewed-by Cédric Le Goater <[email protected]>
Thanks! As you suggested I'll wait for Nick to post the PPC pull request before respining this series (and the series depending on it).
Regards,
Phil.
Quoted 4 lines
Thanks! As you suggested I'll wait for Nick to post the PPC pull request before respining this series (and the series depending on it).
I think this patch is the only conflicting one :
https://lore.kernel.org/qemu-devel/[email protected]/
Adding it to your series would surely help.
Thanks,
C.
Quoted 7 lines · Philippe Mathieu-Daudé
Hi,
This series remove uses of Monitor in hw/ppc/, replacing by the more generic HumanReadableText. Care is taken to keep the commit bisectables by updating functions one by one, also easing review.
Quoted 7 lines
For rationale see previous series from Daniel:
https://lore.kernel.org/qemu-devel/[email protected]/Regards,
Phil.
For the series:
Quoted 54 lines
Philippe Mathieu-Daudé (26):
hw/ppc: Avoid using Monitor inpnv_phb3_msi_pic_print_info()hw/ppc: Avoid using Monitor inicp_pic_print_info()hw/ppc: Avoid using Monitor inxive_tctx_pic_print_info()hw/ppc: Avoid using Monitor inics_pic_print_info()hw/ppc: Avoid using Monitor inPnvChipClass::intc_print_info()hw/ppc: Avoid using Monitor inxive_end_queue_pic_print_info()hw/ppc: Avoid using Monitor inspapr_xive_end_pic_print_info()hw/ppc: Avoid using Monitor inspapr_xive_pic_print_info()hw/ppc: Avoid using Monitor inxive_source_pic_print_info()hw/ppc: Avoid using Monitor inpnv_phb4_pic_print_info()hw/ppc: Avoid using Monitor inxive_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive_end_pic_print_info()hw/ppc: Avoid using Monitor inxive_end_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive_nvt_pic_print_info()hw/ppc: Avoid using Monitor inpnv_xive_pic_print_info()hw/ppc: Avoid using Monitor inpnv_psi_pic_print_info()hw/ppc: Avoid using Monitor inxive2_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_queue_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_pic_print_info()hw/ppc: Avoid using Monitor inxive2_nvp_pic_print_info()hw/ppc: Avoid using Monitor inpnv_xive2_pic_print_info()hw/ppc: Avoid using Monitor in
SpaprInterruptControllerClass::print_info()
hw/ppc: Avoid using Monitor inspapr_irq_print_info()hw/ppc: Avoid using Monitor inpnv_chip_power9_pic_print_info_child()hw/ppc: Avoid using Monitor inpic_print_info()include/hw/pci-host/pnv_phb3.h | 2 +- include/hw/pci-host/pnv_phb4.h | 2 +- include/hw/ppc/pnv_chip.h | 4 +- include/hw/ppc/pnv_psi.h | 2 +- include/hw/ppc/pnv_xive.h | 4 +- include/hw/ppc/spapr_irq.h | 4 +- include/hw/ppc/xics.h | 4 +- include/hw/ppc/xive.h | 4 +- include/hw/ppc/xive2_regs.h | 8 +-- include/hw/ppc/xive_regs.h | 8 +-- hw/intc/pnv_xive.c | 38 ++++++------ hw/intc/pnv_xive2.c | 48 +++++++-------- hw/intc/spapr_xive.c | 41 ++++++------- hw/intc/xics.c | 25 ++++---- hw/intc/xics_spapr.c | 7 +-- hw/intc/xive.c | 108 ++++++++++++++++----------------- hw/intc/xive2.c | 87 +++++++++++++------------- hw/pci-host/pnv_phb3_msi.c | 21 +++---- hw/pci-host/pnv_phb4.c | 17 +++--- hw/ppc/pnv.c | 52 ++++++++-------- hw/ppc/pnv_psi.c | 9 ++- hw/ppc/spapr.c | 11 +++- hw/ppc/spapr_irq.c | 4 +- 23 files changed, 256 insertions(+), 254 deletions(-)
Quoted 20 lines · Philippe Mathieu-Daudé
Philippe Mathieu-Daudé (26):
hw/ppc: Avoid using Monitor inpnv_phb3_msi_pic_print_info()hw/ppc: Avoid using Monitor inicp_pic_print_info()hw/ppc: Avoid using Monitor inxive_tctx_pic_print_info()hw/ppc: Avoid using Monitor inics_pic_print_info()hw/ppc: Avoid using Monitor inPnvChipClass::intc_print_info()hw/ppc: Avoid using Monitor inxive_end_queue_pic_print_info()hw/ppc: Avoid using Monitor inspapr_xive_end_pic_print_info()hw/ppc: Avoid using Monitor inspapr_xive_pic_print_info()hw/ppc: Avoid using Monitor inxive_source_pic_print_info()hw/ppc: Avoid using Monitor inpnv_phb4_pic_print_info()hw/ppc: Avoid using Monitor inxive_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive_end_pic_print_info()hw/ppc: Avoid using Monitor inxive_end_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive_nvt_pic_print_info()hw/ppc: Avoid using Monitor inpnv_xive_pic_print_info()hw/ppc: Avoid using Monitor inpnv_psi_pic_print_info()hw/ppc: Avoid using Monitor inxive2_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_eas_pic_print_info()hw/ppc: Avoid using Monitor inxive2_end_queue_pic_print_info()
Quoted 8 lines
hw/ppc: Avoid using Monitor in
xive2_end_pic_print_info()hw/ppc: Avoid using Monitor inxive2_nvp_pic_print_info()hw/ppc: Avoid using Monitor inpnv_xive2_pic_print_info()hw/ppc: Avoid using Monitor in
SpaprInterruptControllerClass::print_info()
hw/ppc: Avoid using Monitor inspapr_irq_print_info()hw/ppc: Avoid using Monitor inpnv_chip_power9_pic_print_info_child()hw/ppc: Avoid using Monitor inpic_print_info()
Series queued.