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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 2D9B9C433E0 for ; Mon, 29 Jun 2020 09:39:31 +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 EFC4723403 for ; Mon, 29 Jun 2020 09:39:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="usphKtrH"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="fQhAJAY2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFC4723403 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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lG162vPARV9lcjoFzwvGEvQ1P1DISrbvAbUUAztPjR4=; b=usphKtrH4NuJko9jBPCQIU2Ni sWhn1Ajh+eXNOjSZ6H4xud/941kCoqKsdhaTHNlXilYW5lPWGBHXVNDf1XdWHI+b5UkOTlOnwXWvJ UGdpa3ajb63vXPkwiL8yA+SonUMrqj8TZBq5kTBr2ZSMmMINh97LsuJY2tSKpl4mB6dbo7UzZmLAe /hTa5S8wfsT4rnTL7y+So93FGUJ/05FVEXDmPdiNE/TjCc7lircMSjk5dJwEVdoadvdd1Sh/VQ1Q1 VRTYfw06Hz4IQbLq2rxctt5vazLjm/6MHqrd1zAeuzJFIEUjT56B3S6wCCGUc1COebq3ZOgiuasOC QtreSomhg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpqEW-0008Pf-Fr; Mon, 29 Jun 2020 09:37:48 +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 1jpqES-0008Oj-Fm for linux-arm-kernel@lists.infradead.org; Mon, 29 Jun 2020 09:37:45 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (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 F2CCC23341; Mon, 29 Jun 2020 09:37:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593423463; bh=aUlW1jN73vdOSZpkpkucX5DY39QfgpzaB4OVxaLyNwg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fQhAJAY2GQWzjXCHbIzBM0WcizWlyLgsusUesRD5/mJLqWfstu9qc2Z4O5NWMc3AI xWohK04BBHDh0YjLNX+w47tv7DpEXNO4+hLXXkD3QEmjwCPtmLCKy0Dqu1JhGBVGtA Uayx7idGwLNExpoi3uR2z6+tmpozhbSFMRLNUGhk= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jpqEP-007I8r-Eo; Mon, 29 Jun 2020 10:37:41 +0100 MIME-Version: 1.0 Date: Mon, 29 Jun 2020 10:37:41 +0100 From: Marc Zyngier To: Valentin Schneider Subject: Re: [PATCH v2 04/17] ARM: Allow IPIs to be handled as normal interrupts In-Reply-To: References: <20200624195811.435857-1-maz@kernel.org> <20200624195811.435857-5-maz@kernel.org> User-Agent: Roundcube Webmail/1.4.5 Message-ID: X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: valentin.schneider@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, will@kernel.org, catalin.marinas@arm.com, linux@arm.linux.org.uk, tglx@linutronix.de, jason@lakedaemon.net, sumit.garg@linaro.org, f.fainelli@gmail.com, gregory.clement@bootlin.com, andrew@lunn.ch, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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: Sumit Garg , Florian Fainelli , Russell King , Jason Cooper , kernel-team@android.com, Andrew Lunn , Catalin Marinas , Gregory Clement , linux-kernel@vger.kernel.org, Thomas Gleixner , Will Deacon , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-06-25 19:25, Valentin Schneider wrote: > On 24/06/20 20:57, Marc Zyngier wrote: >> @@ -696,9 +696,76 @@ void handle_IPI(int ipinr, struct pt_regs *regs) >> >> if ((unsigned)ipinr < NR_IPI) >> trace_ipi_exit_rcuidle(ipi_types[ipinr]); >> +} >> + >> +/* Legacy version, should go away once all irqchips have been >> converted */ >> +void handle_IPI(int ipinr, struct pt_regs *regs) >> +{ >> + struct pt_regs *old_regs = set_irq_regs(regs); >> + >> + irq_enter(); >> + do_handle_IPI(ipinr); >> + irq_exit(); >> + >> set_irq_regs(old_regs); >> } >> >> +static irqreturn_t ipi_handler(int irq, void *data) >> +{ >> + do_handle_IPI(irq - ipi_irq_base); >> + return IRQ_HANDLED; >> +} >> + >> +static void ipi_send(const struct cpumask *target, unsigned int ipi) >> +{ >> + __ipi_send_mask(ipi_desc[ipi], target); >> +} >> + >> +static void ipi_setup(int cpu) >> +{ >> + if (ipi_irq_base) { >> + int i; >> + >> + for (i = 0; i < nr_ipi; i++) >> + enable_percpu_irq(ipi_irq_base + i, 0); >> + } >> +} >> + >> +static void ipi_teardown(int cpu) >> +{ >> + if (ipi_irq_base) { >> + int i; >> + >> + for (i = 0; i < nr_ipi; i++) >> + disable_percpu_irq(ipi_irq_base + i); >> + } >> +} >> + >> +void __init set_smp_ipi_range(int ipi_base, int n) >> +{ >> + int i; >> + >> + WARN_ON(n < MAX_IPI); >> + nr_ipi = min(n, MAX_IPI); > > > I got confused by that backtrace thing and NR_IPI vs MAX_IPI. > I think I got it now : we don't want to call trace_ipi_raise() for > IPI_CPU_BACKTRACE *but* we still need to alloc the desc and route it > through the generic IPI layers. Indeed, and I didn't want to have a bizarre "+ 1" hanging about. > The only difference I can tell is that now we will get some trace > events > for it via the handler entry/exit tracepoints - that shouldn't cause > any > issue. I hope so. I don't see how you can avoid all tracepoints anyway (if that was the intention). Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel