]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
powerpc/pseries: add definitions for new H_SIGNAL_SYS_RESET hcall
authorNicholas Piggin <npiggin@gmail.com>
Tue, 8 Nov 2016 06:08:06 +0000 (17:08 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 30 Nov 2016 12:19:59 +0000 (23:19 +1100)
This has not made its way to a PAPR release yet, but we have an hcall
number assigned.

  H_SIGNAL_SYS_RESET = 0x380

  Syntax:
    hcall(uint64 H_SIGNAL_SYS_RESET, int64 target);

  Generate a system reset NMI on the threads indicated by target.

  Values for target:
    -1 = target all online threads including the caller
    -2 = target all online threads except for the caller
    All other negative values: reserved
    Positive values: The thread to be targeted, obtained from the value
    of the "ibm,ppc-interrupt-server#s" property of the CPU in the OF
    device tree.

  Semantics:
  - Invalid target: return H_Parameter.
  - Otherwise: Generate a system reset NMI on target thread(s),
    return H_Success.

This will be used by crash/debug code to get stuck CPUs into a known
state.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/hvcall.h
arch/powerpc/include/asm/plpar_wrappers.h

index 8d5f8352afd70d8674ec05562e636f96ab46bc40..77ff1ba99d1f660991baad2a5f33c55a939aed4e 100644 (file)
 #define H_GET_MPP_X            0x314
 #define H_SET_MODE             0x31C
 #define H_CLEAR_HPT            0x358
-#define MAX_HCALL_OPCODE       H_CLEAR_HPT
+#define H_SIGNAL_SYS_RESET     0x380
+#define MAX_HCALL_OPCODE       H_SIGNAL_SYS_RESET
 
 /* H_VIOCTL functions */
 #define H_GET_VIOA_DUMP_SIZE   0x01
 #define H_SET_MODE_RESOURCE_ADDR_TRANS_MODE    3
 #define H_SET_MODE_RESOURCE_LE                 4
 
+/* Values for argument to H_SIGNAL_SYS_RESET */
+#define H_SIGNAL_SYS_RESET_ALL                 -1
+#define H_SIGNAL_SYS_RESET_ALL_OTHERS          -2
+/* >= 0 values are CPU number */
+
 #ifndef __ASSEMBLY__
 
 /**
index 034a588b122c53ebf5bcb67b93f5cb1440f660c7..0bcc75e295e317fbcb64e495e62e9b010c8f804c 100644 (file)
@@ -308,4 +308,9 @@ static inline long plapr_set_watchpoint0(unsigned long dawr0, unsigned long dawr
        return plpar_set_mode(0, H_SET_MODE_RESOURCE_SET_DAWR, dawr0, dawrx0);
 }
 
+static inline long plapr_signal_sys_reset(long cpu)
+{
+       return plpar_hcall_norets(H_SIGNAL_SYS_RESET, cpu);
+}
+
 #endif /* _ASM_POWERPC_PLPAR_WRAPPERS_H */