From patchwork Mon Aug 7 08:02:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 798506 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 ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xQqnV5W2cz9sNc for ; Mon, 7 Aug 2017 18:04:46 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KHRCzLch"; 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 3xQqnV4MRgzDqnm for ; Mon, 7 Aug 2017 18:04:46 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KHRCzLch"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (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 3xQqlm2c9czDqkF for ; Mon, 7 Aug 2017 18:03:15 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KHRCzLch"; dkim-atps=neutral Received: by mail-pf0-x243.google.com with SMTP id c65so8329568pfl.0 for ; Mon, 07 Aug 2017 01:03:15 -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; bh=oZKogYBV2Wkp3WoYqQtZGSnFhe0PJcK2x4YZOU2YtCc=; b=KHRCzLchy6u+oj3jghiLBVlWGw44vusrIkzuj0DdPXdyzRVLNS5e2jiSYc94kvpwmh eL2So+AYw9lN7XqAjlmiLPkV8+kOx0V3Q7E3vx+06W4nAhipYAYJvoKRH6brSjB6OYdD 7GX9/XMfj4jfKz7TSp1hnLnQ3KkJNcbmUAms1EyYaFjAlhWFVzQJUzk5VCOcR8H+F44j iRRs5+2BCPa1phFr3Vi4/Wk+e5SXmpaobTnwDEILTXJbnwlqfHB8HFi33cV+v0miZXxw cZwXK9UFhzrQxR8dMrpVsEj9bfVyy6SGKM6ICZGEyybJih61ITFSnqe6qHEHKNygoEqy w9Tg== 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; bh=oZKogYBV2Wkp3WoYqQtZGSnFhe0PJcK2x4YZOU2YtCc=; b=J3yl/4EqYGxMIYML4sU1gxAheHI3i/ROg8LhRQMQPawPCdAK48C1uT2/hg8LftFJxn PZoG4u8E24E3zHCd8t9nAyjd6nmlEqpbxD/SUin5YCfemJgIXsN4e2vjOBO38nh70Ju5 8H6qwAueC6cQnMpXySedh6S1i+FXTYRBG2dwB/6E3Gdc49KKZMjsGwO8yEYll+tGeONF 07PmbouzDBTelPmwzWj6V5u2tkoDAndZ/XD94Db/4m88oHztemFLY436YsbLm7xP1Mro hIlXcnSE3jPEQ2puw04REpx/EAn2MyKUC1rSqsBXeiqFYrIkVHudxTNff3snG0Fb+D5+ 3ZIg== X-Gm-Message-State: AIVw112hb8qHOnPoR545ekmpN6g7CMQg8ldfswFW+EpKU3uqXEIBOlAI leSf0uSr2yDu2PQd X-Received: by 10.99.45.194 with SMTP id t185mr10567200pgt.388.1502092993287; Mon, 07 Aug 2017 01:03:13 -0700 (PDT) Received: from roar.au.ibm.com (203-219-56-202.tpgi.com.au. [203.219.56.202]) by smtp.gmail.com with ESMTPSA id b9sm14415592pfl.13.2017.08.07.01.03.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Aug 2017 01:03:12 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH] powerpc/64e: Fix perf hardlockup detector build Date: Mon, 7 Aug 2017 18:02:57 +1000 Message-Id: <20170807080257.13708-1-npiggin@gmail.com> X-Mailer: git-send-email 2.13.3 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: Nicholas Piggin Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This fixes a couple more bits of fallout when enabling the hardlockup detector for 64e. It restores the required hw_nmi_get_sample_period() function for the perf watchdog, and restores disabling of the watchdog there. It also removes API definitions that are only defined for 64s. Fixes: 2104180a53 ("powerpc/64s: implement arch-specific hardlockup watchdog") Signed-off-by: Nicholas Piggin --- This patch should go on top of the previous: http://patchwork.ozlabs.org/patch/796202/ arch/powerpc/include/asm/nmi.h | 3 +-- arch/powerpc/kernel/setup_64.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/nmi.h b/arch/powerpc/include/asm/nmi.h index 6f8e79cd35d8..3760150a0ff0 100644 --- a/arch/powerpc/include/asm/nmi.h +++ b/arch/powerpc/include/asm/nmi.h @@ -1,9 +1,8 @@ #ifndef _ASM_NMI_H #define _ASM_NMI_H -#ifdef CONFIG_HARDLOCKUP_DETECTOR +#ifdef CONFIG_PPC_WATCHDOG extern void arch_touch_nmi_watchdog(void); - extern void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self); #define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index af23d4b576ec..5db2ddd8c31d 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -751,3 +751,24 @@ unsigned long memory_block_size_bytes(void) struct ppc_pci_io ppc_pci_io; EXPORT_SYMBOL(ppc_pci_io); #endif + +#ifdef CONFIG_HARDLOCKUP_DETECTOR_PERF +u64 hw_nmi_get_sample_period(int watchdog_thresh) +{ + return ppc_proc_freq * watchdog_thresh; +} + +/* + * The perf based hardlockup detector breaks PMU event based branches and is + * likely to get false positives in KVM guests, so disable it by default. + * Book3S has a soft-nmi version based on the decrementer interrupt so it does + * not suffer from these problems. + */ +static int __init disable_hardlockup_detector(void) +{ + hardlockup_detector_disable(); + + return 0; +} +early_initcall(disable_hardlockup_detector); +#endif