From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794947178; b=wr3hZwt2uQe3pK8bvl2mkVssSBwVWpLKjxjcmpmdmBpSL9YjOs4vPTG8LrhVLribdRtO e4S3nLHorv1kdLemvnbeaXV7V6MCsbefAE135dA+KEHkfru65uiUMAfvcFitR1TzvdHqn uQp76/eXrjk/y99FslM2SLpk0ZuVBwkkWVZbtn51ZEWJnFPgrn35YHsKxLJF1fcI4tGdm H+zhPFynPxs2/I+Bbqypu/OIuE2WEy+iLmU31bbAz6o5G+XYSENOReCjGq9HhwTSKy7FM yzTRWogUKdBaHJGF9K/cWBKV7k3YjyF4/jwwOcIgE8K4lzv95Grf67ha5pgfHmEqKYA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794947178; h=Received:DKIM-Signature:Received:Date:Message-ID:From:To:Cc:Subject: In-Reply-To:References:User-Agent:MIME-Version:Content-Type: X-SA-Exim-Connect-IP:X-SA-Exim-Rcpt-To:X-SA-Exim-Mail-From: X-SA-Exim-Scanned; bh=kkDShut3nNXZJqqKxEoTK2XjC9cIbBY9KkzckUmhS3Q=; b=MXScd+7VIWQc8ruu7yIGIvqtQ/mA/3qPPcVfJgw54G5eafhadIJGyrv4HkZLTY/10KF7 P5yaLOolm2Tcm4Oh1tkOSJjjEf/kiMufkF6xxymd0jQlqyl2XtLPGpo4OOhnOFSKWI200 cRXRFk09Gqt8OBWusUie+DT/uGGR8BuzWFgd9ZqBgzeYKPT1YoPDMsZmN7wh2UtGrIbH8 LqqkorwPBIKs8PS1ryPvN8pRCIRSSC4RYOhavrtbpqgK0r6Hrs6jzedAln3ReNevNI7yb yUM3szw8eh0WWvvVbeLGz9OjvHyiGQwAv1FfpERJe8DaOcnKJK0RLViZF/cIE+zY/Aw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=C4JfPfSl; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B21BC606A31C for ; Tue, 17 Nov 2026 20:26:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=C4JfPfSl 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-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 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.