Skip to content

Commit 6bf66eb

Browse files
legoatermpe
authored andcommitted
powerpc/xive: Simplify the dump of XIVE interrupts under xmon
Move the xmon routine under XIVE subsystem and rework the loop on the interrupts taking into account the xive_irq_domain to filter out IPIs. Signed-off-by: Cédric Le Goater <[email protected]> Reviewed-by: Greg Kurz <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a74ce59 commit 6bf66eb

File tree

3 files changed

+17
-26
lines changed

3 files changed

+17
-26
lines changed

arch/powerpc/include/asm/xive.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ void xive_flush_interrupt(void);
102102
/* xmon hook */
103103
void xmon_xive_do_dump(int cpu);
104104
int xmon_xive_get_irq_config(u32 hw_irq, struct irq_data *d);
105+
void xmon_xive_get_irq_all(void);
105106

106107
/* APIs used by KVM */
107108
u32 xive_native_default_eq_shift(void);

arch/powerpc/sysdev/xive/common.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,20 @@ int xmon_xive_get_irq_config(u32 hw_irq, struct irq_data *d)
289289
return 0;
290290
}
291291

292+
void xmon_xive_get_irq_all(void)
293+
{
294+
unsigned int i;
295+
struct irq_desc *desc;
296+
297+
for_each_irq_desc(i, desc) {
298+
struct irq_data *d = irq_desc_get_irq_data(desc);
299+
unsigned int hwirq = (unsigned int)irqd_to_hwirq(d);
300+
301+
if (d->domain == xive_irq_domain)
302+
xmon_xive_get_irq_config(hwirq, d);
303+
}
304+
}
305+
292306
#endif /* CONFIG_XMON */
293307

294308
static unsigned int xive_get_irq(void)

arch/powerpc/xmon/xmon.c

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2727,30 +2727,6 @@ static void dump_all_xives(void)
27272727
dump_one_xive(cpu);
27282728
}
27292729

2730-
static void dump_one_xive_irq(u32 num, struct irq_data *d)
2731-
{
2732-
xmon_xive_get_irq_config(num, d);
2733-
}
2734-
2735-
static void dump_all_xive_irq(void)
2736-
{
2737-
unsigned int i;
2738-
struct irq_desc *desc;
2739-
2740-
for_each_irq_desc(i, desc) {
2741-
struct irq_data *d = irq_desc_get_irq_data(desc);
2742-
unsigned int hwirq;
2743-
2744-
if (!d)
2745-
continue;
2746-
2747-
hwirq = (unsigned int)irqd_to_hwirq(d);
2748-
/* IPIs are special (HW number 0) */
2749-
if (hwirq)
2750-
dump_one_xive_irq(hwirq, d);
2751-
}
2752-
}
2753-
27542730
static void dump_xives(void)
27552731
{
27562732
unsigned long num;
@@ -2767,9 +2743,9 @@ static void dump_xives(void)
27672743
return;
27682744
} else if (c == 'i') {
27692745
if (scanhex(&num))
2770-
dump_one_xive_irq(num, NULL);
2746+
xmon_xive_get_irq_config(num, NULL);
27712747
else
2772-
dump_all_xive_irq();
2748+
xmon_xive_get_irq_all();
27732749
return;
27742750
}
27752751

0 commit comments

Comments
 (0)