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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1A118EB64D9 for ; Tue, 4 Jul 2023 15:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2nz8COLgVd/I6wNNwL+arrBw2igdiJTUGSObuwfHWYI=; b=IcCya9YGoSxJPd 5yFiBBfUxx9p1d7ztkLM25c2E+08mDK/uoSEENDFL4AqB8frP4u2RjgFqvcfDf1i2Jo/+SEHjE8N7 WECP9Ob2NEhpbqwx8MdWDRKQ2r2baA7wYDV5VO73a4ft3QJEsVz6a7x1qzucyfpsICAUQGLOZjMLC H58sqbawwEDkTE5H6k2h63I32rXbKRxitZ/I9s9/uDvK6+pNWtp+bNb4AcRUwWzPsZ+coyRfcBLWR a0eIFX2yr8zwAQC7BXHJnYlNlIAQrtoW/9ifGraIPNBZJc3uGZbczye/CwPpfntVMOido1plj1rsc VvedY7sQlvjMA7vkPahQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qGhzs-00Dfo9-11; Tue, 04 Jul 2023 15:31:20 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qGhzp-00DfnN-2f for linux-arm-kernel@lists.infradead.org; Tue, 04 Jul 2023 15:31:19 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0056E61283; Tue, 4 Jul 2023 15:31:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68882C433C8; Tue, 4 Jul 2023 15:31:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688484676; bh=gQG0YqGI0Xfsz6O+bbFroZSKnVbb8Krn+2+51tLo/NE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=h3xvmSsevsF3AfZlVBIDp2WtIJMLJdOW9zNcDVLGjNrFbPIvlXBJjWNp3TtwnaGjD fFOM/pJeIj8W81NwJyZFUcGpahhfNJbPsbqffUO/n3X/mpgidSxi2thpQsC9laBV2F XOwFtH/pWF+KDGg2eQW+dbLDUu/a+reJ3TnTx202r1r+PhqdZEv5y+hfi9PDrfX23l 8TBaFRxX6ku6j6UjM4+vAErc0zJdsv5EcP8/4d+pH/AbdLGVr5RO/2N1GIqE9FXV9N F6sbKWzFLayHWtsXyJoYnF9I62F2ro0LggRXClc7DXRl2aNR1Z203m8n0NsRBZXiWg Jxo0G5M5Buu4w== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qGhzm-00ATCv-4P; Tue, 04 Jul 2023 16:31:14 +0100 Date: Tue, 04 Jul 2023 16:31:13 +0100 Message-ID: <86r0pnwv5q.wl-maz@kernel.org> From: Marc Zyngier To: Lorenzo Pieralisi Cc: linux-arm-kernel@lists.infradead.org, Hanks Chen , Cheng-Yuh.Wu@mediatek.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] irqchip/gic-v3: Workaround for GIC-700 erratum 2941627 In-Reply-To: References: <20230704123436.127449-1-lpieralisi@kernel.org> <86ttujwxb1.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: lpieralisi@kernel.org, linux-arm-kernel@lists.infradead.org, hanks.chen@mediatek.com, Cheng-Yuh.Wu@mediatek.com, linux-kernel@vger.kernel.org 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-20230704_083117_940422_324AEE23 X-CRM114-Status: GOOD ( 26.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 On Tue, 04 Jul 2023 16:27:45 +0100, Lorenzo Pieralisi wrote: > > On Tue, Jul 04, 2023 at 03:44:50PM +0100, Marc Zyngier wrote: > > [...] > > > > + return !((gic_irq_in_rdist(d)) || gic_irq(d) >= 8192 || > > > + cpumask_equal(irq_data_get_effective_affinity_mask(d), > > > + cpumask_of(smp_processor_id()))); > > > > I dislike this statement for multiple reasons: > > > > - it is written as a negation, making it harder than strictly > > necessary to parse as it is the opposite of the comment above > > > > - gic_irq_in_rdist() and gic_irq(d) >= 8192 are two ways of checking > > the interrupt range -- maybe we should just do that > > > > - cpumask_equal() is *slow* if you have more that 64 CPUs, something > > that is increasingly common -- a better option would be to check > > whether the current CPU is in the mask or not, which would be enough > > as we only have a single affinity bit set > > > > - smp_processor_id() can check for preemption, which is pointless > > here, as we're doing things under the irq_desc raw spinlock. > > > > I would expect something like: > > > > enum gic_intid_range range = get_intid_range(d); > > > > return (range == SGI_RANGE || range == ESPI_RANGE) && > > !cpumask_test_cpu(raw_smp_processor_id(), > > irq_data_get_effective_affinity_mask(d)); > > > > s/SGI/SPI - just noticed, for the records. Indeed. As you can tell, I didn't really test the damn thing... Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel