From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A119C38A2A for ; Fri, 8 May 2020 04:57:37 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EF5B420731 for ; Fri, 8 May 2020 04:57:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dxqMyw0I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF5B420731 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 49JJ3d1wfKzDr3R for ; Fri, 8 May 2020 14:57:33 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::643; helo=mail-pl1-x643.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=dxqMyw0I; dkim-atps=neutral Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 49JHYH3kLgzDqxd for ; Fri, 8 May 2020 14:34:43 +1000 (AEST) Received: by mail-pl1-x643.google.com with SMTP id z6so174875plk.10 for ; Thu, 07 May 2020 21:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BavkCXXBPLsHz7DK2WchGGo+futkgbG2beHrx+B+SBY=; b=dxqMyw0ISwjTWucpQDIvKuOx0BkGHb20hr70yWLg7JJtCadJF20Le5oJTbqh39XHrb oh2eRlo6auvzVDKZYwlV+XcZUbmvcsJFPhPSonvQKBH//N1KyFtA3/988ud2X/w74jy3 Y+AILv26q1OjT0T94Y/73d3bXEsejjWpAqLm2GxcSOgkvTdPq5ytmdKuNx9Vk9Rw9S+a d+GmTzgzjc/wthB8MdXXzvCW9PYxqXD+R5jcp9n64/ISH+m1bM+o7YEavj0PkK4DSbsB F2a3IDjfLcLoQodFlNs08ojixRrygsmsJHx+GQlSU0ya/KuBCH0/BTMCDVthesp2Jc+3 MPTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BavkCXXBPLsHz7DK2WchGGo+futkgbG2beHrx+B+SBY=; b=TqbDL636EktanLZFU29zT2mH1oXticINdJkuulpfF/ju3R7ztS6s22wYcHdVFzlMCu mkuKNntRCx3pEdsJfGGUARLTLC5P0oH3Dhly2NcIm2NYFboAmsOZGYmoVOBdlk0VVN1d 62rEld4XQH8lr+19F7l1fFzqgKBo0lqZaZS0hax0JGVqMJfX5XHHAPpQbCHMH5mWIi8S fqmHxmGMX0feY0/PL5kqDoXwGvzXoHAp7ETwt9zEdYnKrWAaFGpM9k/zAhgpF1dOqIGn jlAuWdJqGdLfhRxjZd4n+4XtsGd1PIJwXCGog/XMciy4Z+okW3pV5zwdtU6M6V/RdumE GdwA== X-Gm-Message-State: AGi0PuaqdVyxoxwFeOYyihDzMxFGFhP2xDFiB6kxWSwt4TPCJ8QVjqAi b/qMWU9qdwGe+j7TnzOcI1kcLIdZ X-Google-Smtp-Source: APiQypIqF3bMlkktX4s/5D0WjLl1b4iL1Ep1TJjhWAzNmrr/8WaTEuvHJeX/QQffI/pWiKlA/p/vrQ== X-Received: by 2002:a17:90a:7482:: with SMTP id p2mr3718582pjk.151.1588912480818; Thu, 07 May 2020 21:34:40 -0700 (PDT) Received: from bobo.ozlabs.ibm.com (61-68-214-199.tpgi.com.au. [61.68.214.199]) by smtp.gmail.com with ESMTPSA id i9sm358813pfk.199.2020.05.07.21.34.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 21:34:40 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH v4 10/16] powerpc/pseries: machine check use rtas_call_unlocked with args on stack Date: Fri, 8 May 2020 14:34:02 +1000 Message-Id: <20200508043408.886394-11-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200508043408.886394-1-npiggin@gmail.com> References: <20200508043408.886394-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" With the previous patch, machine checks can use rtas_call_unlocked which avoids the rtas spinlock which would deadlock if a machine check hits while making an rtas call. This also avoids the complex rtas error logging which has more rtas calls and includes kmalloc (which can return memory beyond RMA, which would also crash). Signed-off-by: Nicholas Piggin --- arch/powerpc/platforms/pseries/ras.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c index b2adba59f0ff..ce1665e58d9b 100644 --- a/arch/powerpc/platforms/pseries/ras.c +++ b/arch/powerpc/platforms/pseries/ras.c @@ -468,7 +468,15 @@ static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs) */ static void fwnmi_release_errinfo(void) { - int ret = rtas_call(ibm_nmi_interlock_token, 0, 1, NULL); + struct rtas_args rtas_args; + int ret; + + /* + * On pseries, the machine check stack is limited to under 4GB, so + * args can be on-stack. + */ + rtas_call_unlocked(&rtas_args, ibm_nmi_interlock_token, 0, 1, NULL); + ret = be32_to_cpu(rtas_args.rets[0]); if (ret != 0) printk(KERN_ERR "FWNMI: nmi-interlock failed: %d\n", ret); } -- 2.23.0