powerpc/pseries: Set UNISOLATE on dlpar_cpu_remove() failure
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Fri, 16 Apr 2021 21:02:16 +0000 (18:02 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 20 Apr 2021 04:22:23 +0000 (14:22 +1000)
commit29c9a2699e71a7866a98ebdf6ea38135d31b4e1f
treeefbf5635451e169ccedae997f94a22946d2624e1
parent0e3b3ff83ce24a7a01e467ca42e3e33e87195c0d
powerpc/pseries: Set UNISOLATE on dlpar_cpu_remove() failure

The RTAS set-indicator call, when attempting to UNISOLATE a DRC that is
already UNISOLATED or CONFIGURED, returns RTAS_OK and does nothing else
for both QEMU and phyp. This gives us an opportunity to use this
behavior to signal the hypervisor layer when an error during device
removal happens, allowing it to do a proper error handling, while not
breaking QEMU/phyp implementations that don't have this support.

This patch introduces this idea by unisolating all CPU DRCs that failed
to be removed by dlpar_cpu_remove_by_index(), when handling the
PSERIES_HP_ELOG_ID_DRC_INDEX event. This is being done for this event
only because its the only CPU removal event QEMU uses, and there's no
need at this moment to add this mechanism for phyp only code.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210416210216.380291-3-danielhb413@gmail.com
arch/powerpc/platforms/pseries/hotplug-cpu.c