Skip to content

Commit 5896163

Browse files
legoatermpe
authored andcommitted
powerpc/xmon: Improve output of XIVE interrupts
When looping on the list of interrupts, add the current value of the PQ bits with a load on the ESB page. This has the side effect of faulting the ESB page of all interrupts. Signed-off-by: Cédric Le Goater <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ec5b705 commit 5896163

File tree

3 files changed

+31
-16
lines changed

3 files changed

+31
-16
lines changed

arch/powerpc/include/asm/xive.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ extern void xive_flush_interrupt(void);
9999

100100
/* xmon hook */
101101
extern void xmon_xive_do_dump(int cpu);
102-
extern int xmon_xive_get_irq_config(u32 irq, u32 *target, u8 *prio,
103-
u32 *sw_irq);
102+
extern int xmon_xive_get_irq_config(u32 hw_irq, struct irq_data *d);
104103

105104
/* APIs used by KVM */
106105
extern u32 xive_native_default_eq_shift(void);

arch/powerpc/sysdev/xive/common.c

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,33 @@ notrace void xmon_xive_do_dump(int cpu)
258258
#endif
259259
}
260260

261-
int xmon_xive_get_irq_config(u32 irq, u32 *target, u8 *prio,
262-
u32 *sw_irq)
261+
int xmon_xive_get_irq_config(u32 hw_irq, struct irq_data *d)
263262
{
264-
return xive_ops->get_irq_config(irq, target, prio, sw_irq);
263+
int rc;
264+
u32 target;
265+
u8 prio;
266+
u32 lirq;
267+
268+
rc = xive_ops->get_irq_config(hw_irq, &target, &prio, &lirq);
269+
if (rc) {
270+
xmon_printf("IRQ 0x%08x : no config rc=%d\n", hw_irq, rc);
271+
return rc;
272+
}
273+
274+
xmon_printf("IRQ 0x%08x : target=0x%x prio=%02x lirq=0x%x ",
275+
hw_irq, target, prio, lirq);
276+
277+
if (d) {
278+
struct xive_irq_data *xd = irq_data_get_irq_handler_data(d);
279+
u64 val = xive_esb_read(xd, XIVE_ESB_GET);
280+
281+
xmon_printf("PQ=%c%c",
282+
val & XIVE_ESB_VAL_P ? 'P' : '-',
283+
val & XIVE_ESB_VAL_Q ? 'Q' : '-');
284+
}
285+
286+
xmon_printf("\n");
287+
return 0;
265288
}
266289

267290
#endif /* CONFIG_XMON */

arch/powerpc/xmon/xmon.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2572,16 +2572,9 @@ static void dump_all_xives(void)
25722572
dump_one_xive(cpu);
25732573
}
25742574

2575-
static void dump_one_xive_irq(u32 num)
2575+
static void dump_one_xive_irq(u32 num, struct irq_data *d)
25762576
{
2577-
int rc;
2578-
u32 target;
2579-
u8 prio;
2580-
u32 lirq;
2581-
2582-
rc = xmon_xive_get_irq_config(num, &target, &prio, &lirq);
2583-
xmon_printf("IRQ 0x%08x : target=0x%x prio=%d lirq=0x%x (rc=%d)\n",
2584-
num, target, prio, lirq, rc);
2577+
xmon_xive_get_irq_config(num, d);
25852578
}
25862579

25872580
static void dump_all_xive_irq(void)
@@ -2599,7 +2592,7 @@ static void dump_all_xive_irq(void)
25992592
hwirq = (unsigned int)irqd_to_hwirq(d);
26002593
/* IPIs are special (HW number 0) */
26012594
if (hwirq)
2602-
dump_one_xive_irq(hwirq);
2595+
dump_one_xive_irq(hwirq, d);
26032596
}
26042597
}
26052598

@@ -2619,7 +2612,7 @@ static void dump_xives(void)
26192612
return;
26202613
} else if (c == 'i') {
26212614
if (scanhex(&num))
2622-
dump_one_xive_irq(num);
2615+
dump_one_xive_irq(num, NULL);
26232616
else
26242617
dump_all_xive_irq();
26252618
return;

0 commit comments

Comments
 (0)