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=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,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 57B51C433FF for ; Thu, 1 Aug 2019 13:06:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 2D1BC214DA for ; Thu, 1 Aug 2019 13:06:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TqCkqKyZ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="h+pttSxX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D1BC214DA 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+infradead-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=bombadil.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=eTW/ssGf/qK/orawOOH4I2xh7Xv9vyTsisRY+5wF3GI=; b=TqCkqKyZ7/Mo7i JsC2xwnvXEZBzQNTls0n8eCU+vLorF0ZzLE5+LXlm5MWHqV6SfWAR7+vfg+FqJzyl3brZCXoWfD6X s63Y682DBz8mGmO2ppSWbakcKmvf4hW4paBIWXsZ52cG/fD9Z1alwOlzOVWGXblSB3nzWGDer7EJ9 Cs88MoaH5NIH/cB8Jagr47d3TASDZb4e869wDeQ08+DuC2AuB21mNMaABmoCtfk9dAd+05SIG+KTa 8QEJHMQQwVxy+ocAu1VwLjK7AXfvC66HhnTn3MQxRpaMdN33FJpbWGuxNs8do/DfGR22mItsFb3t1 G9WL2kqqtq1yTtADQssQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1htAmh-0006SU-Ju; Thu, 01 Aug 2019 13:06:19 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1htAmf-0006S9-BV for linux-arm-kernel@lists.infradead.org; Thu, 01 Aug 2019 13:06:18 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CA5CF20838; Thu, 1 Aug 2019 13:06:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564664776; bh=/wmQAkHpGftYRIL/DgFGvaSTH4GFrVy/ROApPnsBvns=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=h+pttSxXr2fM9kp7qF5kSXPqlKadMq4gO4w4y3QWZuDhAyhtlMCcnuxU+bVwhY3QY i92Dfiezpj1C6nQBjI3ITTU5zTUILCksjOJUiQoQU1XpxrhvMGuSh5u2bd1/RTHmd7 33MD2m7/1+hwmjxmRWUjrMloYzLSsAPx9mV9wSaY= Date: Thu, 1 Aug 2019 14:06:12 +0100 From: Will Deacon To: Julien Thierry Subject: Re: [PATCH v4 6/9] arm64: perf: Do not call irq_work_run in NMI context Message-ID: <20190801130611.n2xij2242ihxa5pr@willie-the-truck> References: <1563351432-55652-1-git-send-email-julien.thierry@arm.com> <1563351432-55652-7-git-send-email-julien.thierry@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1563351432-55652-7-git-send-email-julien.thierry@arm.com> User-Agent: NeoMutt/20170113 (1.7.2) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190801_060617_419245_9662781B X-CRM114-Status: GOOD ( 17.07 ) 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, peterz@infradead.org, Catalin Marinas , will.deacon@arm.com, acme@kernel.org, alexander.shishkin@linux.intel.com, mingo@redhat.com, namhyung@kernel.org, sthotton@marvell.com, jolsa@redhat.com, linux-arm-kernel@lists.infradead.org, liwei391@huawei.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Archived-At: List-Archive: On Wed, Jul 17, 2019 at 09:17:09AM +0100, Julien Thierry wrote: > Function irq_work_run is not NMI safe and should not be called from NMI > context. > > When PMU interrupt is an NMI do not call irq_work_run. Instead rely on the > IRQ work IPI to run the irq_work queue once NMI/IRQ contexts have been > exited. > > Signed-off-by: Julien Thierry > Cc: Will Deacon > Cc: Mark Rutland > Cc: Peter Zijlstra > Cc: Ingo Molnar > Cc: Arnaldo Carvalho de Melo > Cc: Alexander Shishkin > Cc: Jiri Olsa > Cc: Namhyung Kim > Cc: Catalin Marinas > --- > arch/arm64/kernel/perf_event.c | 14 +++++--------- > 1 file changed, 5 insertions(+), 9 deletions(-) > > diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c > index 0e2cf5d..9c959ad 100644 > --- a/arch/arm64/kernel/perf_event.c > +++ b/arch/arm64/kernel/perf_event.c > @@ -776,20 +776,16 @@ static irqreturn_t armv8pmu_handle_irq(struct arm_pmu *cpu_pmu) > if (!armpmu_event_set_period(event)) > continue; > > + /* > + * Perf event overflow will queue the processing of the event as > + * an irq_work which will be taken care of in the handling of > + * IPI_IRQ_WORK. > + */ > if (perf_event_overflow(event, &data, regs)) > cpu_pmu->disable(event); > } > armv8pmu_start(cpu_pmu); > > - /* > - * Handle the pending perf events. > - * > - * Note: this call *must* be run with interrupts disabled. For > - * platforms that can have the PMU interrupts raised as an NMI, this > - * will not work. > - */ > - irq_work_run(); What about the case where NMIs are not being used (e.g. GICv2)? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel