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=-12.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 08986C433DF for ; Fri, 31 Jul 2020 11:29:07 +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 C6538208E4 for ; Fri, 31 Jul 2020 11:29:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tHxiS43n"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="qiwftiur" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6538208E4 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=TDcTBgNXlRiTLdkzoxqwRUAg8OL1FccHq3eYQjQrERI=; b=tHxiS43nlh0vQERiLpbWLJwb/ zM2/AFcXMJEX0ziQJM1LJqpgxYdth9RCdps+pm7Jo4d5JoHEhG2iVeWo0k5SIan/AgseQJ9LQSOFm pAlV4A2lc1mQ9xPyZ/+stMXvSC6+K2zNVTntZUaCmA4qZeLDJNuwC7LctZ4hlO5fkzDRtRuUgiBTk 14D4gs0FS7O9mV6+OvfemEyXWnRvaPK/JZd8nKI57924z8qAIbmzwpICYWsDpvzb8pNtxukuq1jrZ 0BHXbpCRuzbftaei27keNig+zCZpRvQljc+n5tyCosFFQI4FF7/G2XAc8lXi/SGwAZV3KBOvpBA8w 57gsq3l3Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1TCP-0005uu-EH; Fri, 31 Jul 2020 11:27:41 +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 1k1TCM-0005u8-7V for linux-arm-kernel@lists.infradead.org; Fri, 31 Jul 2020 11:27:39 +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 4E435208E4; Fri, 31 Jul 2020 11:27:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596194857; bh=hvoBtB4p+m34vRWlhfI0+65sCvBD61ZM/ZgBJ1fZ/Ew=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qiwftiurYb205xG5MlpUGmVuFQZlpki5R8+ofaLnfIfHGqocSabbHrctnRzRmkWBt lB7R+UX0NtAnvQxPSzQ3Q/6G1D/Ae7KOUX4H8QAF6bIoulHm+BZ/x0RdYTUfQFPKNI u2tJTXFCR5sVvO2REULOHfzKOnXh/02qDQmpwCPk= 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 1k1TCJ-00GVz8-NI; Fri, 31 Jul 2020 12:27:35 +0100 MIME-Version: 1.0 Date: Fri, 31 Jul 2020 12:27:35 +0100 From: Marc Zyngier To: Valentin Schneider Subject: Re: [PATCH v2 2/2] irqchip/gic-v2, v3: Prevent SW resends entirely In-Reply-To: <10da73b8a8937b08b0993513d6c20e98@kernel.org> References: <20200730170321.31228-1-valentin.schneider@arm.com> <20200730170321.31228-3-valentin.schneider@arm.com> <10da73b8a8937b08b0993513d6c20e98@kernel.org> User-Agent: Roundcube Webmail/1.4.5 Message-ID: <8dfeb7782d7ffaa1f107a8e4aca10840@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: valentin.schneider@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tglx@linutronix.de, jason@lakedaemon.net, Lorenzo.Pieralisi@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200731_072739_105961_D4CCF748 X-CRM114-Status: GOOD ( 27.12 ) 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: Thomas Gleixner , Lorenzo Pieralisi , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jason Cooper 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-07-31 09:08, Marc Zyngier wrote: > Hi Valentin, > > On 2020-07-31 01:08, Valentin Schneider wrote: >> Hi Marc, >> >> On 30/07/20 19:10, Marc Zyngier wrote: >> [...] >>>> diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c >>>> index e2b4cae88bce..a91ce1e73bd2 100644 >>>> --- a/drivers/irqchip/irq-gic.c >>>> +++ b/drivers/irqchip/irq-gic.c >>>> @@ -983,6 +983,7 @@ static int gic_irq_domain_map(struct irq_domain >>>> *d, unsigned int irq, >>>> irq_hw_number_t hw) >>>> { >>>> struct gic_chip_data *gic = d->host_data; >>>> + struct irq_data *irqd = irq_desc_get_irq_data(irq_to_desc(irq)); >>>> >>>> if (hw < 32) { >>>> irq_set_percpu_devid(irq); >>>> @@ -992,8 +993,11 @@ static int gic_irq_domain_map(struct irq_domain >>>> *d, unsigned int irq, >>>> irq_domain_set_info(d, irq, hw, &gic->chip, >>>> d->host_data, >>>> handle_fasteoi_irq, NULL, NULL); >>>> irq_set_probe(irq); >>>> - irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(irq))); >>>> + irqd_set_single_target(irqd); >>>> } >>>> + >>>> + /* Prevents SW retriggers which mess up the ACK/EOI ordering */ >>>> + irqd_set_handle_enforce_irqctx(irqd); >>>> return 0; >>>> } >>> >>> I'm OK with this in principle, but this requires additional changes >>> in the rest of the GIC universe. The ITS driver needs to provide its >>> own >>> retrigger function for LPIs (queuing an INT command), and any of the >>> SPI generating widgets that can be stacked on top of a GIC >>> (GICv3-MBI, >>> GICv2m, and all the other Annapurna/Marvell/NVDIA wonders need to >>> gain >>> directly or indirectly a call to irq_chip_retrigger_hierarchy(). >>> >> >> Eep, yes indeed... I didn't see that can was full of worms, though >> even if >> it only really matters for eoimode=0 I think it might still be worth >> it >> (if only to respect the spec). > > Well, given that we are using EOImode=0 for all guests at the moment, > there is some value it getting it right! ;-) > >> >>> We can probably avoid changing the MSI widgets by teaching the MSI >>> code about the HW retrigger, but a number of other non-MSI drivers >>> will need some help... >>> >>> I'll have a look tomorrow. >>> >> >> For LPIs AFAICT we could directly reuse its_irq_set_irqchip_state() - >> I see >> the VPE side of things already has a HW retrigger callback. > > Yes, that's the idea (in general, if you implement the PENDING side of > irq_set_irqchip_state(), retrigger comes for free). > >> For gicv2m, I *think* we'd want irq_chip_retrigger_hierarchy() on both >> MSI >> domains (which IIUC you suggest might be doable by adding the >> retrigger as >> a default MSI chip op). > > Yes, that was my idea. > >> I'm not very familiar with the rest of the fauna, so I'll have to do >> some >> reading tomorrow as well; it's probably high time for me to actually >> read >> up on LPIs & ITS while I'm at it... > > Look for anything that performs an interrupt allocation by calling > into the parent with a 3 cell (DT case) fwspec. There is a bunch > of them. For what it is worth, I have just pushed out a branch[1] containing some of this rework as well as your patches. The only tricky part is the GICv4.1 doorbell retriggering, which just can't be re-injected. It shouldn't matter though. Same for vSGIs, they never fire on the host. Thanks, M. [1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/log/?h=irq/gic-retrigger -- 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