From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752141AbdCPJSx (ORCPT ); Thu, 16 Mar 2017 05:18:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40052 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752126AbdCPJSu (ORCPT ); Thu, 16 Mar 2017 05:18:50 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C4C67437F44 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=eric.auger@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C4C67437F44 Subject: Re: [RFC PATCH 20/33] irqchip/gic-v3-its: Add VPE domain infrastructure To: Marc Zyngier , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu References: <1484648454-21216-1-git-send-email-marc.zyngier@arm.com> <1484648454-21216-21-git-send-email-marc.zyngier@arm.com> Cc: Thomas Gleixner , Jason Cooper , Christoffer Dall From: Auger Eric Message-ID: Date: Thu, 16 Mar 2017 10:18:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1484648454-21216-21-git-send-email-marc.zyngier@arm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 16 Mar 2017 09:18:46 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 17/01/2017 11:20, Marc Zyngier wrote: > Add the basic GICv4 VPE (vcpu in GICv4 parlance) infrastructure > (irqchip, irq domain) that is going to be populated in the following > patches. > > Signed-off-by: Marc Zyngier Reviewed-by: Eric Auger Eric > --- > drivers/irqchip/irq-gic-v3-its.c | 36 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 36 insertions(+) > > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c > index 6931018..ddd8096 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -1918,6 +1918,13 @@ static const struct irq_domain_ops its_domain_ops = { > .deactivate = its_irq_domain_deactivate, > }; > > +static struct irq_chip its_vpe_irq_chip = { > + .name = "GICv4-vpe", > +}; > + > +static const struct irq_domain_ops its_vpe_domain_ops = { > +}; > + > static int its_force_quiescent(void __iomem *base) > { > u32 count = 1000000; /* 1s */ > @@ -2017,6 +2024,27 @@ static int its_init_domain(struct fwnode_handle *handle, struct its_node *its) > return 0; > } > > +static struct irq_domain *its_init_vpe_domain(void) > +{ > + struct fwnode_handle *handle; > + struct irq_domain *domain; > + > + handle = irq_domain_alloc_fwnode("VPE domain"); > + if (!handle) > + return NULL; > + > + domain = irq_domain_create_tree(handle, &its_vpe_domain_ops, NULL); > + if (!domain) { > + kfree(handle); > + return NULL; > + } > + > + domain->parent = its_parent; > + domain->bus_token = DOMAIN_BUS_NEXUS; > + > + return domain; > +} > + > static int __init its_probe_one(struct resource *res, > struct fwnode_handle *handle, int numa_node) > { > @@ -2266,6 +2294,8 @@ int __init its_init(struct fwnode_handle *handle, struct rdists *rdists, > struct irq_domain *parent_domain) > { > struct device_node *of_node; > + struct its_node *its; > + bool has_v4 = false; > > its_parent = parent_domain; > of_node = to_of_node(handle); > @@ -2283,5 +2313,11 @@ int __init its_init(struct fwnode_handle *handle, struct rdists *rdists, > its_alloc_lpi_tables(); > its_lpi_init(rdists->id_bits); > > + list_for_each_entry(its, &its_nodes, entry) > + has_v4 |= its->is_v4; > + > + if (has_v4 & rdists->has_vlpis) > + its_init_vpe_domain(); > + > return 0; > } >