powerpc/xmon: Check for HV mode when dumping XIVE info from OPAL
authorCédric Le Goater <clg@kaod.org>
Wed, 14 Aug 2019 15:47:52 +0000 (17:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Oct 2019 16:59:09 +0000 (18:59 +0200)
commit26c32f58d8ebe44aab1115c7e4ba3c07fe752794
treec3df45ac27c88a8009806801175973bb5b7c0a32
parentfa702b72cbf97ba42c7a599f28a09e6b9cd529ce
powerpc/xmon: Check for HV mode when dumping XIVE info from OPAL

[ Upstream commit c3e0dbd7f780a58c4695f1cd8fc8afde80376737 ]

Currently, the xmon 'dx' command calls OPAL to dump the XIVE state in
the OPAL logs and also outputs some of the fields of the internal XIVE
structures in Linux. The OPAL calls can only be done on baremetal
(PowerNV) and they crash a pseries machine. Fix by checking the
hypervisor feature of the CPU.

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-2-clg@kaod.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/xmon/xmon.c