From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 512BB606A31C for ; Tue, 17 Nov 2026 20:26:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=1iWZ/+LG; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=C4JfPfSl DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=kkDShut3nNXZJqqKxEoTK2XjC9cIbBY9KkzckUmhS3Q=; b=1iWZ/+LGVKi+7eabTtnYHR9LDy bdbBXHJin1ee/CKa+q3HjyfNcYy+Ip66Yh2qdJwLVYG3VTWDGYqm/FIPLnIT+wcLuEJSKJLLXCLFR B9qU/UBMPmGyqpTcoS7Rhg0mjvmrEkZbcJnrbDzJiGoXov0qpCS+uBbD0ZrnHV3ZYprLMD2Be65YD G9LkgnbnsEd2BZ7AGbVXEWfFCneKWsy8tjAfccUeN1ZJ/E3KEb9HWcMkqH69YhaSkaELhxKOTQ3HP nyWdQDy6qwh8umavWiYG0wILRtGsEe1h0fNF/28M1NF8hBc4B6m7a2y5jL9pwOuJLAyjP6e22Ooee r8Tis15A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xTPkz-000000070fM-1N7k; Tue, 17 Nov 2026 20:26:21 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xTPkx-000000070f6-3aHw for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2026 20:26:19 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id CFFF3601E4; Tue, 17 Nov 2026 20:26:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 830A01F000C4; Tue, 17 Nov 2026 20:26:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794947178; bh=kkDShut3nNXZJqqKxEoTK2XjC9cIbBY9KkzckUmhS3Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=C4JfPfSlKwZaO3ZlYi+QNfM7ghBEG3zRN644nsBwef1ZWkLmaWvauWXDAUIH+r+eg 4+NIOC0mMsNDv0nZISaEDvhRyuMPpamaoGeVH23g+FebQa+NTejqEa6FSR97hNS7e4 9day41uhm46/NL5eoXbgTDzbkgwLDfEaNhwozyrz6Tpf+40jB8huSvbSMQZGwf10SN MPFmZdG+E7ffZRsM7Yk/l16s7NBx8bxVSca2sJEV/kczuujZWRpUy8zLpMAAgRm0Fd Q7zp0hY+ICWYNmH58+Wkz0R/ZlfSOA3xd1koneGiMxELebb9CxSwJCypOkZi8CG0kV MUv+lz7/ajDoQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=lobster-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xTPku-0000000HDWR-1QTT; Tue, 17 Nov 2026 20:26:16 +0000 Date: Tue, 17 Nov 2026 20:29:42 +0000 Message-ID: <87fqwz8amh.wl-maz@kernel.org> From: Marc Zyngier To: Jinjie Ruan Cc: , , , Subject: Re: [PATCH v2] irqchip/gic-v3-its: Size the collection table for all possible CPUs In-Reply-To: <20261117123116.591621-1-ruanjinjie@huawei.com> References: <20261117123116.591621-1-ruanjinjie@huawei.com> 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/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-Archived-By: 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: ruanjinjie@huawei.com, tglx@kernel.org, radu@rendec.net, linux-arm-kernel@lists.infradead.org, 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-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Tue, 17 Nov 2026 12:31:16 +0000, Jinjie Ruan wrote: > > The collection table is currently sized at a single ITS page size, > and the driver's allocation policy is to allocate a single collection > per CPU. On systems with more CPUs that the ITS can fit in a single > page, no LPI can be routed to the CPUs that don't have an allocated > collection, and the system grinds to a halt. > > Change the allocation policy to allow two-level tables, similarly to > the other tables. > > Signed-off-by: Jinjie Ruan > --- > v1 -> v2: > - Cleanup the similar calls of its_parse_indirect_baser() (Marc). > - Simplfy the commit message (Marc). > - Drop fix tag and comment (Marc). > - Give nr_ids a default for unrecognised BASER types. At this stage, and given that this is my commit message and my code (plus an additional bug of your own doing), you may as well put: Suggested-by: Marc Zyngier > --- > drivers/irqchip/irq-gic-v3-its.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c > index c952c069f937..41cd359e52a7 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -2682,7 +2682,7 @@ static int its_alloc_tables(struct its_node *its) > u64 val = its_read_baser(its, baser); > u64 type = GITS_BASER_TYPE(val); > bool indirect = false; > - u32 order; > + u32 order, nr_ids; > > if (type == GITS_BASER_TYPE_NONE) > continue; > @@ -2696,8 +2696,7 @@ static int its_alloc_tables(struct its_node *its) > > switch (type) { > case GITS_BASER_TYPE_DEVICE: > - indirect = its_parse_indirect_baser(its, baser, &order, > - device_ids(its)); > + nr_ids = device_ids(its); > break; > > case GITS_BASER_TYPE_VCPU: > @@ -2713,11 +2712,19 @@ static int its_alloc_tables(struct its_node *its) > } > } > > - indirect = its_parse_indirect_baser(its, baser, &order, > - ITS_MAX_VPEID_BITS); > + nr_ids = ITS_MAX_VPEID_BITS; > + break; > + > + case GITS_BASER_TYPE_COLLECTION: > + nr_ids = order_base_2(num_possible_cpus()); > + break; > + > + default: > + nr_ids = 0; Absolutely not. The above four BASER types are the only ones that are allowed by the architecture. Anything else is a HW bug. So no, we're not silently accepting this. We scream and *abort*. M. -- Jazz isn't dead. It just smells funny.