From patchwork Mon Mar 5 16:03:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 130684 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp2854110lja; Mon, 5 Mar 2018 08:07:23 -0800 (PST) X-Google-Smtp-Source: AG47ELsFlI/ll7dB1HlPiNNy80ENM+7tw/ayEGkDVdd0D7CaiwZPLmsLrALB1/l6nlKS2CJmoQ/d X-Received: by 10.107.160.74 with SMTP id j71mr17386423ioe.10.1520266043771; Mon, 05 Mar 2018 08:07:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520266043; cv=none; d=google.com; s=arc-20160816; b=hKYFY4+ZzKrWvNskFU69znyjQEkzb7nZgMzwUJQmbxe3JKzu7v72EVnJdUVjUX9Go2 CgfvrfB+/gVCDuMli6CMaVoUXE3B6lEJb9cOTqQ8OEqvkv12E8TkmzVdzcdyTcFMKSfL dj33dJ5texCWRts0tYuZGeWnKI0j2VGjLorjahu3yF5nnmqLPByHVrNXYmBbqCvusnFr +57/qmHYyQtctfCBUawFppzo6zobtuCKgh555AarWkCi9i6tReRGZcmiD5gyvePUa0O+ RQRUOLuVQdTUGhUD5CbKKVhiMduqfooAcsuf0F1L06vQCWk78jqB7g+xcv+gSuHPSxTW ++iA== 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=o4Dz9OBTOP8dl4E+pSD8BGSxBqsv8812UQSmN55YAVU=; b=BA6fF14oRIpMy1Xng23sYl7sgMEqqYx4U8CAsJccXsChNd0EmkGkxiJ4jAu8Bjc5E0 l9+zHmuurN7koDD0nILu4nGZZi7ly4sVZOfzW/ZNu4OFbHZB+cT/KfBAjdqusWhn617x /y6NA7iNPB2loAIJJ3IoPkSKg4ZQMowrqodMRR41kq5H0keDu0A6l2sCy+W/kpb0RMG+ XhtDKW4znyQ0vMj/seAAvtF04TzaJP0sUvizg3gYonTsTNvJJLxk8DRpr5tteslmbVPG I8/umB6tMk1xjF19QwxCoSv+dX2I07Ngk3RJMdRbHpAkQFct23Uyca07yQLuKrUGbnIF Y6Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=G28Y9bdP; 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 k73si8906619iod.229.2018.03.05.08.07.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 08:07:23 -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=G28Y9bdP; 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 1essbF-00076b-0e; Mon, 05 Mar 2018 16:04:29 +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 1essbD-00075h-MH for xen-devel@lists.xenproject.org; Mon, 05 Mar 2018 16:04:27 +0000 X-Inumbo-ID: b965a15d-208e-11e8-ba59-bc764e045a96 Received: from mail-wr0-x244.google.com (unknown [2a00:1450:400c:c0c::244]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id b965a15d-208e-11e8-ba59-bc764e045a96; Mon, 05 Mar 2018 17:03:21 +0100 (CET) Received: by mail-wr0-x244.google.com with SMTP id l43so17853865wrc.2 for ; Mon, 05 Mar 2018 08:04:26 -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=dcdN7NT+yBUVd8rX4JjQQhV/evYuOzNtzptGXHbeUAw=; b=G28Y9bdP5S2P8B+NPBZ2diBJtRzIrlZusmU01SlVTZN6yS99I83X0wmF96DT99iRr/ fHHcv54dVXWjGHMuwdszBVjxv3L5sQVzsJsXngxHO2gf+jHnfIdKvu3YvacTaq7ZNo3v QstCJo/pbSTn+T4KxekrNb6rB/iZ+M70mtAg0= 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=dcdN7NT+yBUVd8rX4JjQQhV/evYuOzNtzptGXHbeUAw=; b=JolDg6ullp//15F+gwUBeohVVvz8sCjv2vEZAzs1YyRuiOqZUNC3euhyjaePEvwsCT e5KJp1fQI3VNrMMStADg7U65rwi32L40aX5ttKkcBc+OCulxJ5XRZT3f6chYFJhTHBRm Ps2sIZFqw6ZlzKZ6KeT2hiF3SqRgOf24UPiD74dSmulyxo9dZbHFcKV9mkk2h+XhX1ul eaRa38snx8wWqYl2a54TLY9VaDa7S88cep7NAodVeRG113UzULYAJvTWLZPdEeObFGIQ N8hlTKm6RpNmgMnBD3rxEhS5jRhikoiPl1p62RJpiltT0MMFHTtsWtTGgR8n+6/fAGiB ppgw== X-Gm-Message-State: APf1xPDcnOZc0m6Ll3kGoFemFFHU3tSmtSPFvIMufS9uiQDtflaR/FJR 4PKqan9IOWhf6FkvR1dHYvFO2jDzYvc= X-Received: by 10.223.209.68 with SMTP id b4mr13075324wri.161.1520265865562; Mon, 05 Mar 2018 08:04:25 -0800 (PST) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id y6sm6574381wmy.14.2018.03.05.08.04.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Mar 2018 08:04:25 -0800 (PST) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Mon, 5 Mar 2018 16:03:21 +0000 Message-Id: <20180305160415.16760-4-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180305160415.16760-1-andre.przywara@linaro.org> References: <20180305160415.16760-1-andre.przywara@linaro.org> Cc: xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH 03/57] 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 --- Changelog RFC ... v1: - Use GIC hardware values consistently in this function. 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);