aboutsummaryrefslogtreecommitdiff
path: root/hw/intc/xive.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2024-06-19 10:54:31 -0700
committerRichard Henderson <richard.henderson@linaro.org>2024-06-19 10:54:31 -0700
commit80748eb4fbc70f0a3ae423f2c01cb5a4584d803f (patch)
treee71beaeef6c2dbcb179b039c6a0c541d41c438f6 /hw/intc/xive.c
parent223696363bb117241ad9c2facbff0c474afa4104 (diff)
parentfc0870c180872d0f40e63507cc6bf8565ffd8d98 (diff)
Merge tag 'misc-20240619' of https://github.com/philmd/qemu into staging
Misc patches queue . Remove deprecated pc-i440fx-2.0 -> 2.3 machines (Phil) . Always use little endian audio format in virtio-snd (Phil) . Avoid using Monitor in INTERRUPT_STATS_PROVIDER::print_info (Phil) . Introduce x-query-interrupt-controllers QMP command (Phil) . Introduce pnv_chip_foreach_cpu() to remove one CPU_FOREACH use (Cédric) . Constify few uses of IOMMUTLBEvent (Phil) . Wire loongson_ipi device to loongson3_virt/TCG (Jiaxun) . Fix inclusion of tracing headers on s390x/TCG (Phil) . Add few shortcuts missing to readline (Manos) . Update ui/display entries in MAINTAINERS (Gerd) . Use qemu_add_mouse_change_notifier on Cocoa (Akihiko) . Fix Standard VGA screen blanking and cleanups (Gerd) . Fix USB/MTP reported "free space" value (Fabio) . Cast size_memop() returned value (Roman) # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmZyuKYACgkQ4+MsLN6t # wN5guxAAvwJWbxQA8B4+gfiYaMK0AnM4leuCZ+8Sf+LhK32k2UkFA4NnKBkxGmO+ # 45NOEEEEv1Tukvtq1STHkYEdERJbHndpSFk2XmaYY09Ofo54vv2dXy6MD6GJriuA # Pr9Mivzs490RSPXmxhsa8GU5IE6CO3LamgpSeH8XxPTvCbRIiB8LcKsme6utBAZv # 9dHnEX5sXEEY2ZvArQd+eueyJfRyN4+1PpQkE9uH/wLIBqHAkHgSvFVaLo+PtA7T # xfcFvrawRTWIU+P1lojmCMb+mOj+YS7yigpkkYQC4SFm0PEv5J5nyhr/mhhiVuSS # tK8DNNi44F7/Z2CzEwbwk1PEnfKWtCgG2rEiR5uT6E8nmvxaOr2LfswBjLSwVDPS # mBOnjTMLqTBPKq8E8x2di1h2cJ9PZ90zZtWzYD8Eqoq+eqz/x+8z/qP4vifzO+NB # 7lj4IQZzLn+iktDGpjfh2RNoV9F9i9BwFGJqO2i0MzVftezJuGfe9olVOP2ErpnR # jqB7gzgc6g4tYiOK9WchuIeB/S9dU/5qqQxWwINWX0j4cHF6Qq71LyejCTfpqpf8 # jjF65XdGHcyVm9NAnr18MTzwdu3YYWf4w2OGIHg7iGLC0hv3U+EzEEMpv2E6pelM # iXgtqkRQm9qJaSrjfv0MUp9irjq01aIaHceFmP20QtkMP256E6c= # =Ed8Z # -----END PGP SIGNATURE----- # gpg: Signature made Wed 19 Jun 2024 03:53:26 AM PDT # gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full] * tag 'misc-20240619' of https://github.com/philmd/qemu: (74 commits) exec: Make the MemOp enum cast explicit ui+display: rename is_buffer_shared() -> surface_is_allocated() ui+display: rename is_placeholder() -> surface_is_placeholder() stdvga: fix screen blanking ui/cocoa: Use qemu_add_mouse_change_notifier MAINTAINERS: drop spice+ui maintainership MAINTAINERS: drop virtio-gpu maintainership util/readline: Add C-u shortcut util/readline: Add C-n, C-p shortcuts util/readline: Fix lints for readline_handle_byte target/s390x: Use s390_skeys_get|set() helper hw/s390x: Introduce s390_skeys_get|set() helpers hw/mips/loongson3_virt: Wire up loongson_ipi device hw/intc/loongson_ipi: Replace ipi_getcpu with cpu_by_arch_id hw/intc/loongson_ipi: Provide per core MMIO address spaces hw/intc: Remove loongarch_ipi.c hw/usb/dev-mtp: Correctly report free space hw/usb: Remove unused 'host.h' header hw/i386/iommu: Constify IOMMUTLBEvent in vtd_page_walk_hook prototype memory: Constify IOMMUTLBEvent in memory_region_notify_iommu() ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'hw/intc/xive.c')
-rw-r--r--hw/intc/xive.c108
1 files changed, 53 insertions, 55 deletions
diff --git a/hw/intc/xive.c b/hw/intc/xive.c
index 057b308ae9..70f11f993b 100644
--- a/hw/intc/xive.c
+++ b/hw/intc/xive.c
@@ -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"
@@ -669,7 +668,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 +692,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);
}
}
@@ -1207,22 +1207,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' : ' ');
}
}
@@ -1322,7 +1320,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);
@@ -1333,7 +1331,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);
@@ -1345,14 +1343,14 @@ 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)
+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);
@@ -1371,26 +1369,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);
- xive_end_queue_pic_print_info(end, 6, mon);
+ 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);
}
- monitor_printf(mon, "\n");
+ g_string_append_c(buf, '\n');
}
static void xive_end_enqueue(XiveEND *end, uint32_t data)
@@ -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));
}
/*
@@ -1917,17 +1915,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));
}
/*