From patchwork Tue Nov 8 06:08:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 692150 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tCf692Rm0z9vFN for ; Tue, 8 Nov 2016 17:09:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cvjZcqGT"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tCf691NVXzDvgS for ; Tue, 8 Nov 2016 17:09:37 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cvjZcqGT"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3tCf4f6XCjzDvTG for ; Tue, 8 Nov 2016 17:08:18 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cvjZcqGT"; dkim-atps=neutral Received: by mail-pf0-x244.google.com with SMTP id 144so9841374pfv.0 for ; Mon, 07 Nov 2016 22:08:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=PUFuHLcP3ZdNoCCAq3noAnYn5b1Ucy1707dEDWz9MYg=; b=cvjZcqGTZTCQzO/lo0CXfcTN2UtgH0teW4dagf/q1ml33bgX6+ZbWr8kmIPBc82EKd 79WetwPtTHxOvviBAj/nV6ptnsmaYx77mH8Fesj6vXyniYezvXLNtAnMvoGb41pHVTPC K17wvuKMslO+qAtSSNl9YIFq0OBLOVzaBB8x7s8hpPHN173oEg/R/rF5tsw4Y3LC1rT7 /PwT3xy0TnLp36B0u0jXc0wmFY5xvOazasQtpXCoIz7Lxr7W1SyPmXbs9x6CF/MFH3y3 OjJDtS2d7Mvkm8IjJJOK1BJIjONn/i6WnTXz0x11JGdTbLXNVLv1ni4uxOiP/Z1E3H5j V0ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PUFuHLcP3ZdNoCCAq3noAnYn5b1Ucy1707dEDWz9MYg=; b=FLkumRZWMdWxLQ3ZvVVpGjW5hr9Sns99kYQ8CsPVtaw0VOHxWdPJqrYZXA+gpGr38f GkJ8OjTOEY2nxPTyiJNHAeU4I9aCvJPqzAqtjixo2hOF8zNN8M34fMiUT5IH+4k/M52l H9O1viqU+/hgu9qK6HJDgzTJLIZkEx7LBekFvuiz9fBC6W1ElOC5YcWoFEMoZ9ygotM3 rH4w/jRLhB2BYe1PbNPH6dcElRxe7HYTerk2Ti8YC0gec8bzl1rCa50/OkNTjuzQEsWY BMsWemLcIR1zYLhhRrAmYKjyNwP+XU62eK7VCYXvzR/EztF1J3gj0UeyvJn3PuGtAu2X 3VTg== X-Gm-Message-State: ABUngveExDja62EHuJgUYJdbJkk3b0YESKS9DjR+Wk1Uf3d2NT4Pf9mKignmrot2bJ612w== X-Received: by 10.98.67.138 with SMTP id l10mr20897548pfi.101.1478585297210; Mon, 07 Nov 2016 22:08:17 -0800 (PST) Received: from roar.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id qy2sm45012682pab.27.2016.11.07.22.08.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 22:08:16 -0800 (PST) From: Nicholas Piggin To: Michael Ellerman Subject: [PATCH] powerpc/pseries: add definitions for new H_SIGNAL_SYS_RESET hcall Date: Tue, 8 Nov 2016 17:08:06 +1100 Message-Id: <20161108060806.16168-1-npiggin@gmail.com> X-Mailer: git-send-email 2.10.2 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, Nicholas Piggin Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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, /* generate a system reset NMI on */ /* the threads indicated by target */ int64 target); /* thread target selection */ /* -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: - If the NMI handlers are not registered, terminate the partition. - 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 --- I'll get the NMI stuff resubmitted soon, but just wanted to send out this hcall addition now, for reference. Thanks, Nick arch/powerpc/include/asm/hvcall.h | 8 +++++++- arch/powerpc/include/asm/plpar_wrappers.h | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h index 708edeb..d52ef28 100644 --- a/arch/powerpc/include/asm/hvcall.h +++ b/arch/powerpc/include/asm/hvcall.h @@ -275,7 +275,8 @@ #define H_COP 0x304 #define H_GET_MPP_X 0x314 #define H_SET_MODE 0x31C -#define MAX_HCALL_OPCODE H_SET_MODE +#define H_SIGNAL_SYS_RESET 0x380 +#define MAX_HCALL_OPCODE H_SIGNAL_SYS_RESET /* H_VIOCTL functions */ #define H_GET_VIOA_DUMP_SIZE 0x01 @@ -306,6 +307,11 @@ #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_ALLBUTSELF -2 +/* >= 0 values are CPU number */ + #ifndef __ASSEMBLY__ /** diff --git a/arch/powerpc/include/asm/plpar_wrappers.h b/arch/powerpc/include/asm/plpar_wrappers.h index 1b39424..9642ae8 100644 --- a/arch/powerpc/include/asm/plpar_wrappers.h +++ b/arch/powerpc/include/asm/plpar_wrappers.h @@ -340,4 +340,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 */