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=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 F18DFC433DB for ; Tue, 26 Jan 2021 14:20:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 929D922D04 for ; Tue, 26 Jan 2021 14:20:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 929D922D04 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Rb13ZWnwwKn6zT7rJv3cas4zFwoKMJUEC5A45pWw/B4=; b=ZseIDPCN1KRUdrYSEfWGz9OyH TZ+cOZtkwxRsR03pWqCfZ4qGOI88MnPcx97MjhayWGns2HRkoz+zPbPvonk4qqisB3qdww94Kf/Dn wvzfbNCaHWoE6FVCr3EoKflMPP9AkP23Nf+kKX6tIkAw2RB8cMzyf+qOx4zc2B/ZMiU3pOrkzoj2+ nn8fpl4mKh6lLvfkiRSre7o8Y6+X/OgUF5BGdo26CAwI0y9hWL+4uhdZpzJeWu6LSn7FO/uMh1L+N kAVZSVIez6KEHBnCWuw86baxSzpJL3LiXjH7tSuy8/Lgj5J2nq4cLVJsJbcTDLhV/o0/l8qno0oCG ptEEGHiTA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4PAs-00022U-6h; Tue, 26 Jan 2021 14:18:30 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4PAn-00021K-0h for linux-arm-kernel@lists.infradead.org; Tue, 26 Jan 2021 14:18:25 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 35068206CA; Tue, 26 Jan 2021 14:18:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611670703; bh=HqfHwhbZBK5xiHvXp5C9+ogNeGqfuvAe3Vf7RYfRot8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X5cLsJBZ2/6AfrJIf8RnsX0mjtHPfEGjh9g/zcq5EMbGYon1u/Cop336pOf0l5fll gUTG3sIYoaSmkqEGL6ruXkskSbEsEde8d71U4L0EVVmFHgxxP00Cx/VBbhUrcAYWwZ wYGiQGIRIT+98vCPNRYL0Jqil4rMrhDq99E9qRz2JMb/mICEr3ceyyt6S+eHM0Zg0j fW4sysPt6efCBz4ml2INunDaxVTD52L3cF2msMk8JOE9b7YvrRiyf0eGnsFNL6OHeV S0jLb/Fot4F2tGd87XBhjf8ufo3jdklrZ8Yk2N8ibmJaLkoYFQ1DGWdf3122IHTB62 /WjXO0/HYTbbw== Date: Tue, 26 Jan 2021 14:18:19 +0000 From: Will Deacon To: Sumit Garg Subject: Re: [PATCH v5] arm64: Enable perf events based hard lockup detector Message-ID: <20210126141818.GC29956@willie-the-truck> References: <1610712101-14929-1-git-send-email-sumit.garg@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1610712101-14929-1-git-send-email-sumit.garg@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210126_091825_205750_6ADCB2BD X-CRM114-Status: GOOD ( 20.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, daniel.thompson@linaro.org, linux-kernel@vger.kernel.org, lecopzer.chen@mediatek.com, catalin.marinas@arm.com, dianders@chromium.org, swboyd@chromium.org, alexandru.elisei@arm.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Sumit, On Fri, Jan 15, 2021 at 05:31:41PM +0530, Sumit Garg wrote: > With the recent feature added to enable perf events to use pseudo NMIs > as interrupts on platforms which support GICv3 or later, its now been > possible to enable hard lockup detector (or NMI watchdog) on arm64 > platforms. So enable corresponding support. > > One thing to note here is that normally lockup detector is initialized > just after the early initcalls but PMU on arm64 comes up much later as > device_initcall(). So we need to re-initialize lockup detection once > PMU has been initialized. > > Signed-off-by: Sumit Garg > --- [...] > diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c > index 3605f77a..bafb7c8 100644 > --- a/arch/arm64/kernel/perf_event.c > +++ b/arch/arm64/kernel/perf_event.c > @@ -23,6 +23,8 @@ > #include > #include > #include > +#include > +#include > > /* ARMv8 Cortex-A53 specific event types. */ > #define ARMV8_A53_PERFCTR_PREF_LINEFILL 0xC2 > @@ -1246,12 +1248,30 @@ static struct platform_driver armv8_pmu_driver = { > .probe = armv8_pmu_device_probe, > }; > > +static int __init lockup_detector_init_fn(void *data) > +{ > + lockup_detector_init(); > + return 0; > +} > + > static int __init armv8_pmu_driver_init(void) > { > + int ret; > + > if (acpi_disabled) > - return platform_driver_register(&armv8_pmu_driver); > + ret = platform_driver_register(&armv8_pmu_driver); > else > - return arm_pmu_acpi_probe(armv8_pmuv3_init); > + ret = arm_pmu_acpi_probe(armv8_pmuv3_init); > + > + /* > + * Try to re-initialize lockup detector after PMU init in > + * case PMU events are triggered via NMIs. > + */ > + if (ret == 0 && arm_pmu_irq_is_nmi()) > + smp_call_on_cpu(raw_smp_processor_id(), lockup_detector_init_fn, > + NULL, false); > + > + return ret; What's wrong with the alternative approach outlined by Mark: https://lore.kernel.org/r/20210113130235.GB19011@C02TD0UTHF1T.local ? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel