powerpc/xive: Fix dump of XIVE interrupt under pseries

The xmon 'dxi' command calls OPAL to query the XIVE configuration of a
interrupt. This can only be done on baremetal (PowerNV) and it will
crash a pseries machine.

Introduce a new XIVE get_irq_config() operation which implements a
different query depending on the platform, PowerNV or pseries, and
modify xmon to use a top level wrapper.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190814154754.23682-3-clg@kaod.org
This commit is contained in:
Cédric Le Goater
2019-08-14 17:47:53 +02:00
committed by Michael Ellerman
parent c3e0dbd7f7
commit b4868ff55d
6 changed files with 83 additions and 6 deletions

View File

@@ -2574,14 +2574,14 @@ static void dump_all_xives(void)
static void dump_one_xive_irq(u32 num)
{
s64 rc;
__be64 vp;
int rc;
u32 target;
u8 prio;
__be32 lirq;
u32 lirq;
rc = opal_xive_get_irq_config(num, &vp, &prio, &lirq);
xmon_printf("IRQ 0x%x config: vp=0x%llx prio=%d lirq=0x%x (rc=%lld)\n",
num, be64_to_cpu(vp), prio, be32_to_cpu(lirq), rc);
rc = xmon_xive_get_irq_config(num, &target, &prio, &lirq);
xmon_printf("IRQ 0x%08x : target=0x%x prio=%d lirq=0x%x (rc=%d)\n",
num, target, prio, lirq, rc);
}
static void dump_xives(void)