Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp838301ybx; Thu, 31 Oct 2019 01:31:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOTNK0l5vrZ5YN66GhlLzXZpcOSp8Qz2wToEL+6gEeQsPR+7vGYXS7MCqvZJt8Sgzkpuo7 X-Received: by 2002:aa7:cd71:: with SMTP id ca17mr4490372edb.1.1572510702285; Thu, 31 Oct 2019 01:31:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572510702; cv=none; d=google.com; s=arc-20160816; b=0VF9vRJDdIhuF2tUG++3e1s03DftN1UWYbukSbP0W2F3CX5NrdTp9p51l3fg/dyMUm iMYRsBgsjhUcXSXyYLleEGePYZ5a4B/nNuD5Sil/20b19yierz43MflQTjG9D8ukILDi i1MxebZ1tP9V0490t2hRBpCivgWb6Ir9C6+ybGyVIFLoNoKMHN30LVWpJLL+VO84cK2J MfUW8uO7aBcMyfxYB7vLCVHbcAsiDUFm+jOs77HygPGDncG3wbViHPBoOdrDainD6Xr8 8fXGWK3u4UaP4EbWLS6VZyGEvyOfzrOC1PTxllrQ0dypeGkQYcpiheICeGKYAiEZ/L1q e70g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=xqodpLdueqTOZEUB1sw12IF1OEZbtXbX4HkIOrW32Wc=; b=MHYXTjGFqAACzia2OXnBn9rMrdeSTDwmkEPrBDPpnxd590ODfq6GPz7SwFRR/lqKcL i7e5TDG6srkozKgVhBtdZ+1t8IJ499hU0QkOq99GCFDMnuKg2p7eudGXCq54Uykt2XNt f/6RxkLS9TEmqI5tGhyL6BqrqPmbVa9HB6jOPERT6XfbaB6+3chxm6xqKqLTZf4TgQyB 70wcHIbqsoqslGONEoqK8nmQyXf6lovcMDKre7jvyCoq6SkQV0y5Egu15nkOvyEmNqof pWpN0ujI2jUuEaPfPI04P6qBte9/wkKc9QtbcQDQTrKrCyqtmRFBxblbN+4bfMEnIuGN OyFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2si3667140edi.413.2019.10.31.01.31.18; Thu, 31 Oct 2019 01:31:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726945AbfJaIar (ORCPT + 99 others); Thu, 31 Oct 2019 04:30:47 -0400 Received: from inca-roads.misterjones.org ([213.251.177.50]:41421 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726875AbfJaIar (ORCPT ); Thu, 31 Oct 2019 04:30:47 -0400 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 Cc: , , Eric Auger , James Morse , Julien Thierry , Suzuki K Poulose , Thomas Gleixner , Jason Cooper , Lorenzo Pieralisi , "Andrew Murray" , Jayachandran C , "Robert Richter" 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") Content-Type: text/plain; charset=US-ASCII 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.