powerpc/xive: Fix xmon command "dxi"
authorCédric Le Goater <clg@kaod.org>
Wed, 31 Mar 2021 14:45:12 +0000 (16:45 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 14 Apr 2021 13:04:15 +0000 (23:04 +1000)
commit33e4bc5946432a4ac173fd08e8e30a13ab94d06d
treebf5799075c7845d7d3ae6512280a3ea7016aeb1e
parent6bf66eb8f404050030805c65cf39a810892f5f8e
powerpc/xive: Fix xmon command "dxi"

When under xmon, the "dxi" command dumps the state of the XIVE
interrupts. If an interrupt number is specified, only the state of
the associated XIVE interrupt is dumped. This form of the command
lacks an irq_data parameter which is nevertheless used by
xmon_xive_get_irq_config(), leading to an xmon crash.

Fix that by doing a lookup in the system IRQ mapping to query the IRQ
descriptor data. Invalid interrupt numbers, or not belonging to the
XIVE IRQ domain, OPAL event interrupt number for instance, should be
caught by the previous query done at the firmware level.

Fixes: 97ef27507793 ("powerpc/xive: Fix xmon support on the PowerNV platform")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Tested-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210331144514.892250-8-clg@kaod.org
arch/powerpc/sysdev/xive/common.c