From patchwork Fri Feb 9 14:38:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 127825 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp679648ljc; Fri, 9 Feb 2018 06:42:02 -0800 (PST) X-Google-Smtp-Source: AH8x226SQBJXHrAaXYSaHGRu1gj6dWUqRYe880fILl3MhTYL3pVnQjJKiUvD74Xlmcdoek6nD0lo X-Received: by 10.36.69.78 with SMTP id y75mr4018106ita.9.1518187321978; Fri, 09 Feb 2018 06:42:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518187321; cv=none; d=google.com; s=arc-20160816; b=O+VHV08D8ihQnhzZFh26STdpmgQX5pScuMwcev8TyTPaCb/2PErRg6/lhn8GnJOEqS CzzR6wr4CGWRhsHvEDXp1BYe4TUFZYE4KJJSVvS5Teivmw7lsyExA8S37BOznaSwU2Cy Wgt9/XkaoxZR9cOZ549Tdp3QaqflnGBOb/FmBqdBTyOjMZlhspqy4IG5N3koQy+C1oSx tl5/G1o7wyS+SytwVQu5S81foy4vXBj22Sf0Xoa/P3aihSm0B9HyGVyBtuqvDI4RDJCj lW6AIfF171glli3BpW4En0Jhq/CUqmLrjjh2RT6s2CZB4j6s9KshmMhkEp/XgPbjEwyo V/Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=UDZzCQLMa1X7QD69Tn3Kexc3mxmNehkzPnKAyd1nGFY=; b=igcrWGoUlsznly0ZUmKNA07q7EPvFNOZKsp2nkjYnRHEsQEIFaqooX/huw0dMcCwDi x72qXwBuRP/LIbE5HANDAlCoPQBAe3T9NWdAmTAQbyj+D53qqNin4wjuN8ife5Cc91hl fQp/okKX/9B0ToAo9m9jVhmKJW2s2yIlG58vAue9FHuwWtJT+q5wh5ov7zHmSoboCVHi MOUi+dI5PAswAXPuMcbuG2CaHy2D2s8PYcgu/Orl5RLC6ljIKAEvgffWvihhX43cdjOQ W5mKpviiaYo5UoPEhjR33V5SrmzGC+8XMr158NW0JN2kiOx8eFwOvj+vpi+YLG2kRkDU z8vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gwxczGNG; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id e124si1593491ita.172.2018.02.09.06.42.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 06:42:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gwxczGNG; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ek9qC-00081G-Oa; Fri, 09 Feb 2018 14:39:52 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ek9qB-0007yq-9a for xen-devel@lists.xenproject.org; Fri, 09 Feb 2018 14:39:51 +0000 X-Inumbo-ID: 0376daa5-0da7-11e8-ba59-bc764e045a96 Received: from mail-wm0-x241.google.com (unknown [2a00:1450:400c:c09::241]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 0376daa5-0da7-11e8-ba59-bc764e045a96; Fri, 09 Feb 2018 15:39:21 +0100 (CET) Received: by mail-wm0-x241.google.com with SMTP id i186so15770897wmi.4 for ; Fri, 09 Feb 2018 06:39:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=q2NPvTGhUSB0yRfX7ijq1J4J+vuiBmNKdfvSsycmQUY=; b=gwxczGNG5sopi6MDx9G0rdfF9TXTHmjxqqr+iqxTXHz6H/7uhxPGSVbo+jdpjEZdaM 2/Eody6hA3JCd7IovKxkB9UjWp1oB5zADS+EW/OA1nQ8PCW6JNn/Td8bLkYWO1CtZQkh 0hDRkHkVbyRfx5t0lrUs2P61xdclFRx5tx1QA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=q2NPvTGhUSB0yRfX7ijq1J4J+vuiBmNKdfvSsycmQUY=; b=MCbLqAaNxm6okuq6YqVPJ+EW03yTA8FQBHKY0Qzh22NT6B/XmcReUQqeq9Quj52/pk ciGLv4BuQnlJ8oGKtQinrzkL3zavrvuNNGrmVwMI9UUVMWp32YLpGJYV2fNg6kI8oMEA m1CeKj/bw+wcvqz9DcIi1z6drKkon3baFAWlbj7ear65dSCghkwco6QqSZCb37lxz1HK GTr+tUxzy98FJ90nzDo8hpMkoBswsAFMlY6khUIySs0BHsd3PKIAyM+SW7O1BCdCXs8D 9BYXAbHurY/xnuTrtdkKvCjs9v+gSu8q8he4S3cW+5ANeEazrGSkT4AqTujWpLwOKq4z JsNA== X-Gm-Message-State: APf1xPBsWirE1nSbczYXuCkE01J68GXS/AuLM1Nt/pMleM8ZDYhj3XOO V4rRzd/Xl4RZ0Z0G72/duVET8ZJbrCk= X-Received: by 10.28.55.81 with SMTP id e78mr2398580wma.50.1518187188178; Fri, 09 Feb 2018 06:39:48 -0800 (PST) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id b35sm2552229wra.13.2018.02.09.06.39.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Feb 2018 06:39:47 -0800 (PST) From: Andre Przywara To: Stefano Stabellini , Julien Grall , xen-devel@lists.xenproject.org Date: Fri, 9 Feb 2018 14:38:51 +0000 Message-Id: <20180209143937.28866-4-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180209143937.28866-1-andre.przywara@linaro.org> References: <20180209143937.28866-1-andre.przywara@linaro.org> Subject: [Xen-devel] [RFC PATCH 03/49] ARM: GICv3: use hardware GICv3 redistributor regions for Dom0 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The code to generate the DT node or MADT table for Dom0 reaches into the domain's VGIC structure to learn the number of redistributor regions and their base addresses. Since those values are copied from the hardware, we can as well use those hardware values directly when setting up the hardware domain. This avoids the hardware GIC code to reference vGIC data structures, making this variable VGIC internal. Signed-off-by: Andre Przywara --- xen/arch/arm/gic-v3.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index 25c30bb9ea..bdca77417c 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -1167,8 +1167,7 @@ static int gicv3_make_hwdom_dt_node(const struct domain *d, if ( res ) return res; - res = fdt_property_cell(fdt, "#redistributor-regions", - d->arch.vgic.nr_regions); + res = fdt_property_cell(fdt, "#redistributor-regions", gicv3.rdist_count); if ( res ) return res; @@ -1178,7 +1177,7 @@ static int gicv3_make_hwdom_dt_node(const struct domain *d, * CPU interface and virtual cpu interfaces accessesed as System registers * So cells are created only for Distributor and rdist regions */ - new_len = new_len * (d->arch.vgic.nr_regions + 1); + new_len = new_len * (gicv3.rdist_count + 1); hw_reg = dt_get_property(gic, "reg", &len); if ( !hw_reg ) @@ -1406,13 +1405,13 @@ static int gicv3_make_hwdom_madt(const struct domain *d, u32 offset) /* Add Generic Redistributor */ size = sizeof(struct acpi_madt_generic_redistributor); - for ( i = 0; i < d->arch.vgic.nr_regions; i++ ) + for ( i = 0; i < gicv3.rdist_count; i++ ) { gicr = (struct acpi_madt_generic_redistributor *)(base_ptr + table_len); gicr->header.type = ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR; gicr->header.length = size; - gicr->base_address = d->arch.vgic.rdist_regions[i].base; - gicr->length = d->arch.vgic.rdist_regions[i].size; + gicr->base_address = gicv3.rdist_regions[i].base; + gicr->length = gicv3.rdist_regions[i].size; table_len += size; } @@ -1425,8 +1424,7 @@ static unsigned long gicv3_get_hwdom_extra_madt_size(const struct domain *d) { unsigned long size; - size = sizeof(struct acpi_madt_generic_redistributor) - * d->arch.vgic.nr_regions; + size = sizeof(struct acpi_madt_generic_redistributor) * gicv3.rdist_count; size += sizeof(struct acpi_madt_generic_translator) * vgic_v3_its_count(d);