summaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/pseries/smp.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2016-12-19 21:30:10 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2017-04-28 14:02:25 +0300
commit102c05e8dc4f75a573437e2ce50b2559f3db8d5e (patch)
tree96421119c1df2171afdf40d38a1c6e27eb6836b4 /arch/powerpc/platforms/pseries/smp.c
parentc64af6458e2e2ddf86aff559837d3925fbf9cbb5 (diff)
downloadlinux-102c05e8dc4f75a573437e2ce50b2559f3db8d5e.tar.xz
powerpc/pseries: Implement NMI IPI with H_SIGNAL_SYS_RESET
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/pseries/smp.c')
-rw-r--r--arch/powerpc/platforms/pseries/smp.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 0925ac396b10..52ca6b311d44 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -189,6 +189,27 @@ static void smp_pseries_cause_ipi(int cpu)
icp_ops->cause_ipi(cpu);
}
+static int pseries_cause_nmi_ipi(int cpu)
+{
+ int hwcpu;
+
+ if (cpu == NMI_IPI_ALL_OTHERS) {
+ hwcpu = H_SIGNAL_SYS_RESET_ALL_OTHERS;
+ } else {
+ if (cpu < 0) {
+ WARN_ONCE(true, "incorrect cpu parameter %d", cpu);
+ return 0;
+ }
+
+ hwcpu = get_hard_smp_processor_id(cpu);
+ }
+
+ if (plapr_signal_sys_reset(hwcpu) == H_SUCCESS)
+ return 1;
+
+ return 0;
+}
+
static __init void pSeries_smp_probe(void)
{
xics_smp_probe();
@@ -202,7 +223,7 @@ static __init void pSeries_smp_probe(void)
static struct smp_ops_t pseries_smp_ops = {
.message_pass = NULL, /* Use smp_muxed_ipi_message_pass */
.cause_ipi = NULL, /* Filled at runtime by pSeries_smp_probe() */
- .cause_nmi_ipi = NULL,
+ .cause_nmi_ipi = pseries_cause_nmi_ipi,
.probe = pSeries_smp_probe,
.kick_cpu = smp_pSeries_kick_cpu,
.setup_cpu = smp_setup_cpu,