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=-7.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,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 B8DE8CA9EC3 for ; Thu, 31 Oct 2019 08:30:48 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 4525920862 for ; Thu, 31 Oct 2019 08:30:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4525920862 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 92C164A4DF; Thu, 31 Oct 2019 04:30:47 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nrXv0wLDUglh; Thu, 31 Oct 2019 04:30:46 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 6C3E74A5A0; Thu, 31 Oct 2019 04:30:46 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 927F54A4DF for ; Thu, 31 Oct 2019 04:30:44 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ERbwP-3tcpGL for ; Thu, 31 Oct 2019 04:30:43 -0400 (EDT) Received: from inca-roads.misterjones.org (inca-roads.misterjones.org [213.251.177.50]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 696694A5A0 for ; Thu, 31 Oct 2019 04:30:43 -0400 (EDT) Received: from [91.217.168.176] (helo=big-swifty.misterjones.org) by cheepnis.misterjones.org with esmtpsa (TLSv1.2:AES256-GCM-SHA384:256) (Exim 4.80) (envelope-from ) id 1iQ5qp-0000r9-PS; Thu, 31 Oct 2019 09:30:39 +0100 Date: Thu, 31 Oct 2019 08:30:38 +0000 Message-ID: <86imo5xqoh.wl-maz@kernel.org> From: Marc Zyngier To: Zenghui Yu Subject: Re: [PATCH v2 06/36] irqchip/gic-v3-its: Kill its->device_ids and use TYPER copy instead In-Reply-To: <603e60d8-b2a5-74a4-6d32-8277aa0e39c1@huawei.com> References: <20191027144234.8395-1-maz@kernel.org> <20191027144234.8395-7-maz@kernel.org> <603e60d8-b2a5-74a4-6d32-8277aa0e39c1@huawei.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (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: 91.217.168.176 X-SA-Exim-Rcpt-To: yuzenghui@huawei.com, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, eric.auger@redhat.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, tglx@linutronix.de, jason@lakedaemon.net, lorenzo.pieralisi@arm.com, Andrew.Murray@arm.com, jnair@marvell.com, rrichter@marvell.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false Cc: Lorenzo Pieralisi , Jason Cooper , linux-kernel@vger.kernel.org, Robert Richter , Jayachandran C , Thomas Gleixner , kvmarm@lists.cs.columbia.edu X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Hi Zenghui, On Thu, 31 Oct 2019 06:33:23 +0000, Zenghui Yu wrote: > > Hi Marc, > > On 2019/10/27 22:42, Marc Zyngier wrote: > > Now that we have a copy of TYPER in the ITS structure, rely on this > > to provide the same service as its->device_ids, which gets axed. > > Errata workarounds are now updating the cached fields instead of > > requiring a separate field in the ITS structure. > > > > Signed-off-by: Marc Zyngier > > Reviewed-by: Zenghui Yu Thanks for that. > > > --- > > drivers/irqchip/irq-gic-v3-its.c | 24 +++++++++++++----------- > > include/linux/irqchip/arm-gic-v3.h | 2 +- > > 2 files changed, 14 insertions(+), 12 deletions(-) > > > > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c > > index 3b046181ddfc..6c91c7feadf3 100644 > > --- a/drivers/irqchip/irq-gic-v3-its.c > > +++ b/drivers/irqchip/irq-gic-v3-its.c > > @@ -109,7 +109,6 @@ struct its_node { > > struct list_head its_device_list; > > u64 flags; > > unsigned long list_nr; > > - u32 device_ids; > > int numa_node; > > unsigned int msi_domain_flags; > > u32 pre_its_base; /* for Socionext Synquacer */ > > @@ -117,6 +116,7 @@ struct its_node { > > }; > > #define is_v4(its) (!!((its)->typer & > > GITS_TYPER_VLPIS)) > > +#define device_ids(its) (FIELD_GET(GITS_TYPER_DEVBITS, (its)->typer) + 1) > > #define ITS_ITT_ALIGN SZ_256 > > @@ -1938,9 +1938,9 @@ static bool its_parse_indirect_baser(struct > > its_node *its, > > if (new_order >= MAX_ORDER) { > > new_order = MAX_ORDER - 1; > > ids = ilog2(PAGE_ORDER_TO_SIZE(new_order) / (int)esz); > > - pr_warn("ITS@%pa: %s Table too large, reduce ids %u->%u\n", > > + pr_warn("ITS@%pa: %s Table too large, reduce ids %llu->%u\n", > > &its->phys_base, its_base_type_string[type], > > - its->device_ids, ids); > > + device_ids(its), ids); > > But this pr_warn() looks a bit odd. The table type is chosen from > its_base_type_string[], but ids is always Devbits (+1)? This is a bit of a shortcut, I agree. But the device table practically is the only one where we can run out of space if the ITS doesn't support two level tables. All the other tables are very small, being limited by the number of CPUs (collections) or a small ID space (vPEs). So while this is a bit ugly, I don't thing it is not too concerning. Thanks, M. -- Jazz is not dead, it just smells funny. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm