Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4071357imm; Mon, 20 Aug 2018 09:18:19 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxcHj3EWsXpFFBzemBFcydBVbXXTEZyWBJ9sxCCD64FvNHKH8fyF4AfvrFL9jkR9/bk0pZw X-Received: by 2002:a62:4b48:: with SMTP id y69-v6mr48852104pfa.93.1534781899574; Mon, 20 Aug 2018 09:18:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534781899; cv=none; d=google.com; s=arc-20160816; b=tTwMTVEFc+42BvqVPIOhW/xQuAijb0RszNg50PDkiBYFUohC5ABMJp9ftQUpFw31nB WPBXuQ+EuydD22CZlQkDlFAcf7PCbsUTxj/gQluVdbt0k0Q63ZFW6kpqAMyQVQDIp9HE pQ06/o4ryrCnquTXVd2aIbU6PvKJ3sve6lwOV+9rI51PyRxDGq2oWuUQNEFTW58L/M/V fv/GY0FL02jnLdSMKwcxtauETjafCDoLwAd1e5y1S7inBlycHOzbePXw54KxZsOwwWjp 5/i7nGCcAlD+N0Cf2ypN2M6SlU3WIfJD7gqmlVQlrs/8pKGDy2hfUFScG4r03S0SYT9N OD3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=Q3pANL/NZO6RjNTpDzNs6THj7mEiTaEX5aGiBPN0e4w=; b=INsTUKADM8f1aeWr7fChZ/eg/aKIp+ZIDZK5iiGVwTaMM9cQnvOAuuYEoxgILEGSD8 m0BXnOMzy6WsdCv1gjv/G4P/3kOtTPVGgSH0xPz6Ow0fcCkKFaLX6usvwXjhmmaPPm3t X4BCPC4kolHUYdG9HMRoTCNOlJyyE/aVoYc0N55tqYMxWFNIlFSY1H6R0MADxxpeB3fF 6m4lIavcUkgZAr+N2+eKOIJZdI+I58CIqP8UbwTb3IK5xY5P22Cv+dgOvamkF0OdxMjd K0Y0JEHBoT9/x8GPQjWYZBfkHoUKEOoqHzcKYyflRR+KHv2Wz38g0ELgh/86gkmQE8k6 j1NA== 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 r13-v6si10571683pfi.147.2018.08.20.09.18.04; Mon, 20 Aug 2018 09:18:19 -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 S1727406AbeHTT3X (ORCPT + 99 others); Mon, 20 Aug 2018 15:29:23 -0400 Received: from terminus.zytor.com ([198.137.202.136]:58953 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726106AbeHTT3X (ORCPT ); Mon, 20 Aug 2018 15:29:23 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w7KGD0QM2126367 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 20 Aug 2018 09:13:00 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w7KGCxws2126364; Mon, 20 Aug 2018 09:12:59 -0700 Date: Mon, 20 Aug 2018 09:12:59 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Andrew Banman Message-ID: Cc: colin.king@canonical.com, hpa@zytor.com, mike.travis@hpe.com, sivanich@hpe.com, linux-kernel@vger.kernel.org, mingo@kernel.org, abanman@hpe.com, tglx@linutronix.de Reply-To: colin.king@canonical.com, abanman@hpe.com, tglx@linutronix.de, sivanich@hpe.com, mingo@kernel.org, linux-kernel@vger.kernel.org, mike.travis@hpe.com, hpa@zytor.com In-Reply-To: <1534168477-311448-1-git-send-email-abanman@hpe.com> References: <1534168477-311448-1-git-send-email-abanman@hpe.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/platform/uv/BAU: Gracefully disable BAU during panic Git-Commit-ID: 99f3965878759d36baac944df004b4dafcc272b4 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 99f3965878759d36baac944df004b4dafcc272b4 Gitweb: https://git.kernel.org/tip/99f3965878759d36baac944df004b4dafcc272b4 Author: Andrew Banman AuthorDate: Mon, 13 Aug 2018 08:54:37 -0500 Committer: Thomas Gleixner CommitDate: Mon, 20 Aug 2018 18:04:43 +0200 x86/platform/uv/BAU: Gracefully disable BAU during panic When a panic happens 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. Signed-off-by: Andrew Banman Signed-off-by: Thomas Gleixner Acked-by: Mike Travis Cc: "H. Peter Anvin" Cc: Colin Ian King Cc: Dimitri Sivanich Link: https://lkml.kernel.org/r/1534168477-311448-1-git-send-email-abanman@hpe.com --- 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 a4130b84d1ff..4c1e1197b82d 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[] = { @@ -2196,6 +2201,44 @@ static const struct bau_operations uv4_bau_ops __initconst = { .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 */ @@ -2268,6 +2311,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: