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:56:48 +0000 (18:56 +0200)
commit25c501f0f9d92e7435076d1a1ad8273b8c383182
tree26153fc76c7a92a86047936980684dabfa3058f6
parent2cca24b2cb9a2a791e4a45e133545123e0a81bfc
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