Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3210363imm; Mon, 13 Aug 2018 07:50:36 -0700 (PDT) X-Google-Smtp-Source: AA+uWPytMBMXOfIVg7YjVu+areA1oWILFQ+khclV/0vQAhZ8pKaCalHB/n4s1WxA7cw3d3PZ38Dl X-Received: by 2002:a17:902:123:: with SMTP id 32-v6mr16650656plb.181.1534171836490; Mon, 13 Aug 2018 07:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534171836; cv=none; d=google.com; s=arc-20160816; b=sXmO4R8E2p+H1qyL21WCcUNkq19LhWnUiD8sFwlAGcqSa29M3SR4QI5osKYQbc+1ui RfaJMWJiJLKfaW+OcGsiHe0vxFREGjs7dzyPN1UQhRQLdInmwvaYdGFZgJZMf05VaD/8 DpoySrPFrl6AWyojgpfgNPszxYEin13GXtmWJ0aqPD9jH/ZoA5Te5U4+VjGTLbVta3vN +J+uWBL6+v1cWFLx8N4cOrkw8bYInSZF0KsObxZ3g8uPg11kkcTwn9ml5t+teGGDyBBu 8vik/QQ0KIMXe+wk7vnXE5V9Hw6uylE6bkmt7ua9Ao2DxTYkSAo5bamm3g5OdzpCw6lx 8jFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=BzYcaepcJDjDzLjPIGadmJpFRlS1OL+HfrX8qC97jnM=; b=YH0P7fQO/5Ub/iH1Xl0J1U0bs4U+04qHsr3i/3JJAPByG5mQQJtLDYKCYkPjKB3Rgw qbxa9ojlsiNuY/ngoMjXXqLNrSLxLsh+T6tSw252mbStDDOidnX2VDdy/Mg9A1qBkclS hoyZyWJ0iWnyeahOnHPI/ss4SfsP+FNj2b63NOlx1BYJmuaSS2Ggnyw6JgtNDT19vfOm b2Tyx52ppwmZi9kdHhI5huChSFxRYYK6GaHTe2o1FNEx8j2nRjpQXHUC7QFQWOOZF61R Tk3Iwr9Wm/yVBKztiOehEe/j/gF6811Yz5OzhxjS3l5cM01eqwqI/WqKaqvVgpzT8ed/ w5zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 144-v6si18960250pfw.95.2018.08.13.07.50.20; Mon, 13 Aug 2018 07:50:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729999AbeHMQnt (ORCPT + 99 others); Mon, 13 Aug 2018 12:43:49 -0400 Received: from relay2.sgi.com ([192.48.180.65]:41316 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729981AbeHMQnt (ORCPT ); Mon, 13 Aug 2018 12:43:49 -0400 X-Greylist: delayed 526 seconds by postgrey-1.27 at vger.kernel.org; Mon, 13 Aug 2018 12:43:48 EDT Received: from stormcage.americas.sgi.com (stormcage.americas.sgi.com [128.162.236.70]) by relay2.corp.sgi.com (Postfix) with ESMTP id 0D802304043; Mon, 13 Aug 2018 06:52:36 -0700 (PDT) Received: by stormcage.americas.sgi.com (Postfix, from userid 200151) id BE2B1200FAD19; Mon, 13 Aug 2018 08:54:40 -0500 (CDT) From: Andrew Banman To: mingo@redhat.com, tglx@linutronix.de Cc: Andrew Banman , "H. Peter Anvin" , Colin Ian King , Dimitri Sivanich , x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] x86/platform/uv/BAU: gracefully disable BAU during panic Date: Mon, 13 Aug 2018 08:54:37 -0500 Message-Id: <1534168477-311448-1-git-send-email-abanman@hpe.com> X-Mailer: git-send-email 1.8.2.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When we panic while the BAU is active, outstanding broadcasts may go un-acknowledged by the kernel. These broadcasts cause timeouts in the UV ASIC that tie up BAU resources, which may cause a fatal error that brings down the system, thereby crashing the kdump kexec. Add uv_bau_crash_shutdown() to bring BAU to quiescence ahead of the crash shutdown routine saved in smp machine_ops. Assign uv_bau_crash_shutdown to machine_ops during init. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Colin Ian King Cc: Dimitri Sivanich Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Mike Travis Signed-off-by: Andrew Banman --- arch/x86/platform/uv/tlb_uv.c | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c index e26dfad..dae6b3c 100644 --- a/arch/x86/platform/uv/tlb_uv.c +++ b/arch/x86/platform/uv/tlb_uv.c @@ -22,8 +22,13 @@ #include #include #include +#include static struct bau_operations ops __ro_after_init; +#ifdef CONFIG_KEXEC_CORE +static void (*crash_shutdown)(struct pt_regs *regs) __ro_after_init; +static bool crash_in_progress; +#endif /* timeouts in nanoseconds (indexed by UVH_AGING_PRESCALE_SEL urgency7 30:28) */ static const int timeout_base_ns[] = { @@ -2195,6 +2200,44 @@ static int __init init_per_cpu(int nuvhubs, int base_part_pnode) .wait_completion = uv4_wait_completion, }; +#ifdef CONFIG_KEXEC_CORE +/* + * Bring BAU to quiesence by abandoning current broadcasts and freeing up + * resources needed by firmware-initiated BAU broadcasts. + */ +void uv_bau_crash_shutdown(struct pt_regs *regs) +{ + int pnode = 0; + int uvhub = 0; + + if (crash_in_progress) + return; + crash_in_progress = true; + + /* + * Don't bother turning off BAU in the per-cpu structs. We free up + * enough INTD resources to accommodate any new broadcasts that + * may (however unlikley) start up before we complete the panic, + * without tying up FW-initiated General Broadcasts that must not + * time out. + */ + + for_each_possible_blade(uvhub) { + if (!uv_blade_nr_possible_cpus(uvhub)) + continue; + pnode = uv_blade_to_pnode(uvhub); + /* Set STATUS registers to idle to free source cpus */ + write_gmmr(pnode, UVH_LB_BAU_SB_ACTIVATION_STATUS_0, 0x0); + write_gmmr(pnode, UVH_LB_BAU_SB_ACTIVATION_STATUS_1, 0x0); + write_gmmr(pnode, UVH_LB_BAU_SB_ACTIVATION_STATUS_2, 0x0); + /* Clear TIMEOUT and PENDING bits to free up BAU resources */ + ops.write_g_sw_ack(pnode, ops.read_g_sw_ack(pnode) & 0xFFFF); + } + + crash_shutdown(regs); +} +#endif + /* * Initialization of BAU-related structures */ @@ -2267,6 +2310,12 @@ static int __init uv_bau_init(void) } } +#ifdef CONFIG_KEXEC_CORE + crash_shutdown = machine_ops.crash_shutdown; + machine_ops.crash_shutdown = uv_bau_crash_shutdown; + crash_in_progress = false; +#endif + return 0; err_bau_disable: -- 1.8.2.1