Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27862373rwd; Tue, 4 Jul 2023 08:54:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlEv20G8DI97YBa6UjHeyZTR0kge8IAGncKG7q3kX+w8OujDLybBqgHVdnCa31THT2N1y0ef X-Received: by 2002:a17:902:d486:b0:1b2:fa8:d9c9 with SMTP id c6-20020a170902d48600b001b20fa8d9c9mr17421275plg.49.1688486056608; Tue, 04 Jul 2023 08:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688486056; cv=none; d=google.com; s=arc-20160816; b=G99Lm/+cEd5P9qzHgAPbsr1mVEP9lKFeFBPh1E6+9v0EZ52LHFRutecr9wLXhexfZB 5V1Q3ckFJrq0aPahsUFsj3qACaMNhL3Ze7MJ1zbAf/buo/XPdUzaiq6j0WvRQRwJASdT D1CjJtZWrr12yCkndipRVzzB/TsNw25OYNsgA6yzS7Jo9ClXrzOwqxtF5rvozYAialzw qUUeEZgIJ/8yDrrEu4TfQs5yGcgint5JfVOwofL/isNkeRCnA0OVVbDlO7R7nS38Rxxp huBO3CQVGR8duJ3xTASF6GNsiy2mnRuoy52PuiuF4m9I8So0paFV5ZYcjP+IuN+350NY 1DMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=1Q8s/aiEr9vXHV6H3zfPOiyJ1Q0w4fXEkLo63j1Dj6g=; fh=yZUu7xgbZLnxFKA0TXfA2ZUcbBQhgLn3jvXdCAqvcZg=; b=jZmNtIOSoMKKXlRaqBasMIU8WSnJFK0Dvg2I0YmAaqfcj6m/0Y04kvg5dUr+3R50Ew AB0Z3dTVYUEiJ7Glm6nw5HJKmYaICk3Bk+U/NSOB5+OKqcvaStG/kfP7Q5ebUe+feIqP Hfp37mJSFYwNpSeC6ebZCak9dI2y93gTvDH0mbWbvU9e2dm1qkeFjnCPtNkWoh+zDBn9 WDg+wGSX/xdtvgw0zm92iWsrHbXqQYeZLVpwqVoo8Opzg9RDECUNWACelyjYtziS6zAk w/NONKgrS92xVXtJEIax8hhzXqAdZhtxa11Q25oF/pqJEdlT64EI+rlqsDzAd9mieAdY w8ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h3xvmSse; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ik27-20020a170902ab1b00b001b89462881fsi4992467plb.561.2023.07.04.08.54.04; Tue, 04 Jul 2023 08:54:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h3xvmSse; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231580AbjGDPbT (ORCPT + 99 others); Tue, 4 Jul 2023 11:31:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229971AbjGDPbS (ORCPT ); Tue, 4 Jul 2023 11:31:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 630A91AA for ; Tue, 4 Jul 2023 08:31:17 -0700 (PDT) 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 0058D61291 for ; 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") Content-Type: text/plain; charset=US-ASCII 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-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.