From patchwork Fri Mar 9 15:11:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 131149 Delivered-To: patch@linaro.org Received: by 10.80.194.209 with SMTP id u17csp1135550edf; Fri, 9 Mar 2018 07:14:08 -0800 (PST) X-Google-Smtp-Source: AG47ELv9la2+SKjo9eaFwk3GCekDsjtRIyb6rRYvkJQjS6effTqX1+HX/9Be113YD/LCWY8aysK/ X-Received: by 2002:a24:4115:: with SMTP id x21-v6mr3875273ita.146.1520608448127; Fri, 09 Mar 2018 07:14:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520608448; cv=none; d=google.com; s=arc-20160816; b=g26smmE3vjGQpnVcros9+VuoDjCsBrYdWaibsXg/P+PTkV8A9cI3JiD3XzB0pmYLDx P9YQGOgPwHmfKHit52FwOQQy4Xct31TGsndv/sdLT5xxlhbhv17Z+nxf9pTm5gt5M3hw 6PrpRfqeE4ha/4LX9Pj9rR+d0q4zwpl93ovy7fYy0G0nnZN6j0RrFK0LDVTsDy5HeULH F1XS686H5tdgUaN1mO4mkkakZ7jAHPQZiZZRjsKj+4O5lY8J9EUB5l87vlq6smS6VQvL QrJME6JvyWzzl5GiWL+VfIas7VPdToyYgyoTblS1+KpwEQVMHJnT+PS8WeMqOLWIWuy8 l7nA== 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:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=X7nmIn9MxoX/oCwNsZo5Af/jRX6z2gKCacnTpMISmS0=; b=U5FS9XKqdEVvxynyCz4RjGLWZG6yuAi+CQj4cSW2F8S+bOirn0SrMnlxOZRfu3cqJj 0d5yPPm8bTOU57q5Y0ZvPy08vK0asY13lE/3qHTxhEgHFgKWY6RdxtJvuNHLahESGRFU Yz9TWxTrEVNrFn5W7WpPRJzZt2+WlbJCmNr0a48YHDXSK2I+FqjS7R2eqcLsuoyGRLPw 657/eR2H+uxZHJaQGNtmOyBZ3M52Lo9Rx466cd+xxzogX2mg5cHDW2u/u6qM+uJuAvRr Q9un8O7wS0PALqxpqnzmsCDH++yHVocWtXHXbJUXStVB1AraYZ48eeCSCaWo37SI5og1 zmAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CZe6EWIA; 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 c137si1314196ith.161.2018.03.09.07.14.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Mar 2018 07:14:08 -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=CZe6EWIA; 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 1euJgT-0005pP-B6; Fri, 09 Mar 2018 15:11:49 +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 1euJgS-0005ow-84 for xen-devel@lists.xenproject.org; Fri, 09 Mar 2018 15:11:48 +0000 X-Inumbo-ID: 03dac1ec-23ac-11e8-ba59-bc764e045a96 Received: from mail-wm0-x242.google.com (unknown [2a00:1450:400c:c09::242]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 03dac1ec-23ac-11e8-ba59-bc764e045a96; Fri, 09 Mar 2018 16:10:34 +0100 (CET) Received: by mail-wm0-x242.google.com with SMTP id z9so4469585wmb.3 for ; Fri, 09 Mar 2018 07:11:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XSQL7FEb7UfONEY/vlGtVjlLVb0BZNTwixeXQDQx39Q=; b=CZe6EWIALrT2ZT9Dpc06PMwgOEKnSYvc7h9UXcaY050RbbIc80MHghfJfqEuH36TZs gHybW6LcuQaZpVe/iDwFJ55IRwnqG7FsnisiA57blEW8lM8+qGIt9hhkPGfh0x284NQp kXFYqYapt6hJfVETlPB3M52Epklme/2LJYr3I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XSQL7FEb7UfONEY/vlGtVjlLVb0BZNTwixeXQDQx39Q=; b=s3a5l87Otf27KFIkLbE2fi+J+qES4TF4lukK8dXIlMVTmJ4hFFKfjJ3dpBKubPYIAC S0qjWvznwXNU0gKOYQk162fCGaaKpZ3B0OcUI6rvyu1dp3Qjf15ZRiyLLCml84w9yriS wBdrzurgqgkuzM84VZRBiMbmvDhHoO/PLkJ2P2e83fW7gilvSYpi/2Isu2BnjQVzhLcz FnMT5MJtH0Ld/OxiA5cv0Q54LU+ePBngUHidXKTPz4jkoxyrd+TTENHlUuYoqCXW+5PY WoEz5daM96igfatXyIPFWfgBvn0YpHEVdcbxsiCoBxqDp3Go5C/GfSb3r3i4ZdhzDm42 IFjQ== X-Gm-Message-State: AElRT7FmSZJ9j/ld7yhPgnx/KdQcTI00s/0VwnW5y6j26M1uvzLd94l7 dSOymU8yb+klbMj/7zR9CAq81Q== X-Received: by 10.28.195.133 with SMTP id t127mr2293255wmf.156.1520608305548; Fri, 09 Mar 2018 07:11:45 -0800 (PST) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id 1sm1721198wmj.35.2018.03.09.07.11.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 07:11:45 -0800 (PST) From: Andre Przywara To: Stefano Stabellini , Julien Grall Date: Fri, 9 Mar 2018 15:11:18 +0000 Message-Id: <20180309151133.31371-3-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180309151133.31371-1-andre.przywara@linaro.org> References: <20180309151133.31371-1-andre.przywara@linaro.org> Cc: xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH 02/17] ARM: GICv3: use hardware GICv3 redistributor values 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. Signed-off-by: Andre Przywara Reviewed-by: Julien Grall --- xen/arch/arm/gic-v3.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index 25c30bb9ea..b1f8a86409 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -1162,13 +1162,11 @@ static int gicv3_make_hwdom_dt_node(const struct domain *d, if ( res ) return res; - res = fdt_property_cell(fdt, "redistributor-stride", - d->arch.vgic.rdist_stride); + res = fdt_property_cell(fdt, "redistributor-stride", gicv3.rdist_stride); 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 +1176,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 +1404,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 +1423,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);