From patchwork Fri Feb 9 14:38:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 127842 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp679865ljc; Fri, 9 Feb 2018 06:42:14 -0800 (PST) X-Google-Smtp-Source: AH8x225xfHo3kCiujzr0pUKnLxek8ts6NnJArqLre/ayPXf51UnGOdDVb27hwbeHBcdHtRwDLeh6 X-Received: by 10.36.60.203 with SMTP id m194mr3546666ita.96.1518187334517; Fri, 09 Feb 2018 06:42:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518187334; cv=none; d=google.com; s=arc-20160816; b=wnCik303ArihfaQd6VvX/CzPWwpcZvoCOu6pqF6WLvfQptLWqjFxFWBFgRPAy4zLSz NrYy5jOM21ps4N9hebESjPOArCbUd/Oz1/tKYkKFbuk8iLD4JHV/GA8+lFxyYCbqYBgo +etEyXadct9mUPKvIpsMUd5nJNdWRr3wsuIjWqhpwB9rnRpz4b9OQyPc5/TDHCxV4YpD BtTqD0RMG5UHcXLgBJBX2aOEeyb7Bhzaqi4l6g7UraVDJMGCsuHGPha0adCvCV9eqmgt F0jQ2+ueS5lRRijwKoPpj5H+TdrkW/m09VSuR/YwGkmeeENSZdUacMPMAdmZ+wX66kgC Be0g== 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=0Bh1Ou+BqLzJfG9BhedCs2upSrtdceAY0SMiYvaECWE=; b=Jc/SEJF1A/xDTo7K8hoZmIALJ+AMHG95r7pjuZYCiZbeiQh1Kj6z7DlumFPWu4zAb1 T7ON1OYR6RM57v2EsOC25eKvFWn4mVzmEgGOHyUSmmP2xtplsiadcLXJwBSLmvOM8Hwm YQ7FEWhna8BIqVTjqhNLNA/wGb2d/S8k/MmeGAXAN4nFy8XtDbYJmWUokG05nzNDNMzn uhwqoBuqQwsoVcGREPn7Al2Qsc0ZttMofZbVFuNAdBug1p+KYLDPdbLG8fzx/Qpt8I2F PehQC4dFdEdY8Ag+r+D4zbeodjBBTfVe9OL+PHcT1hiWOqjO74lMDtwShm6EHfxTLsnB cWWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=O3II11vP; 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 d16si1602971iob.10.2018.02.09.06.42.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 06:42:14 -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=O3II11vP; 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 1ek9qB-0007yy-9T; Fri, 09 Feb 2018 14:39:51 +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 1ek9q9-0007xe-U7 for xen-devel@lists.xenproject.org; Fri, 09 Feb 2018 14:39:49 +0000 X-Inumbo-ID: 02de22b5-0da7-11e8-ba59-bc764e045a96 Received: from mail-wm0-x244.google.com (unknown [2a00:1450:400c:c09::244]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 02de22b5-0da7-11e8-ba59-bc764e045a96; Fri, 09 Feb 2018 15:39:20 +0100 (CET) Received: by mail-wm0-x244.google.com with SMTP id f3so16715641wmc.1 for ; Fri, 09 Feb 2018 06:39:48 -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=3/xzXNip2rL3xoMHrNzBzugAxFc0Si6gV0uXAMttzUw=; b=O3II11vPKUfPimpNVKGAnDG/brHsYvqTXAD8tPG3EWHlk92S9Pm8mVXAjfHLFhE5/T w5G1btdcGQuPPnAmnJNnScefYE29qoCL+xH3gy405LMXw9y4tgSmFJC4+vBvKDqE88aq zliO6YI5Wh5DxkaR0A3gHZAZYwNfZW+CKL91c= 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=3/xzXNip2rL3xoMHrNzBzugAxFc0Si6gV0uXAMttzUw=; b=R8c3Ams6hc/tnJnjdqsPTVJLQaLrPxpHeax8LrA0djQ+PUb+i8HqH0QEo18YvVv2It ub+O9AsTuHb0ZA20mDdoDlHX7EAlzeJepuuhn/skDvwQG+0l4xM9/IUsU4KAfYaO7RPp McwV78JaMRE2ffwcRRn9EgMQlSWFbAHT3aa+lz8FXmgXbNJLa7SI4nrt+sOWZv6SD5mR uSa9f+N8kRsInU3RWzEm13S5hbBEVwV09ZtYG+gzD69L0GgQ00EVFyglodcO+c53mKw7 A2KW4n2bGJIVNp2lhq2YoYGNF2DdFJ7hY2mttm4K4fIoGmk65QcgYaGvLNfaTLwWBcFh VxOg== X-Gm-Message-State: APf1xPAz73Zcjv4S/qUHBrFRTYDrPBtRNmOgzUrwsTyQZ6qj93bK3kKK p+1gZzl7GNMd7pUTZj/1fOwqug== X-Received: by 10.28.71.198 with SMTP id m67mr2473906wmi.40.1518187187015; Fri, 09 Feb 2018 06:39:47 -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.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Feb 2018 06:39:46 -0800 (PST) From: Andre Przywara To: Stefano Stabellini , Julien Grall , xen-devel@lists.xenproject.org Date: Fri, 9 Feb 2018 14:38:50 +0000 Message-Id: <20180209143937.28866-3-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 02/49] ARM: vGICv3: drop GUEST_GICV3_RDIST_REGIONS symbol 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" Architecturally there is only one GICv3 redistributor region. Drop the symbol which suggested that was a delibarate choice for Xen guests, instead hard code the "1" in the appropriate places, along with a comment to explain the reasons. Signed-off-by: Andre Przywara --- xen/arch/arm/vgic-v3.c | 17 ++++++++++++----- xen/include/public/arch-arm.h | 1 - 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c index 2ad8a6be62..12338c6b21 100644 --- a/xen/arch/arm/vgic-v3.c +++ b/xen/arch/arm/vgic-v3.c @@ -1632,8 +1632,18 @@ static int vgic_v3_vcpu_init(struct vcpu *v) static inline unsigned int vgic_v3_rdist_count(struct domain *d) { - return is_hardware_domain(d) ? vgic_v3_hw.nr_rdist_regions : - GUEST_GICV3_RDIST_REGIONS; + /* + * Architecturally there is only one GICv3 redistributor region. + * The GICv3 DT binding provisions for multiple regions, since there are + * platforms out there which break this architectural assumption. + * ACPI does not support this workaround at all. + * For Dom0 we have to live with the MMIO layout the hardware provides, + * so we have to copy the multiple regions - as the first region may not + * provide enough space to hold all redistributors we need. + * However DomU get a constructed memory map, so we can go with + * the architected single redistributor region. + */ + return is_hardware_domain(d) ? vgic_v3_hw.nr_rdist_regions : 1; } static int vgic_v3_domain_init(struct domain *d) @@ -1692,9 +1702,6 @@ static int vgic_v3_domain_init(struct domain *d) { d->arch.vgic.dbase = GUEST_GICV3_GICD_BASE; - /* XXX: Only one Re-distributor region mapped for the guest */ - BUILD_BUG_ON(GUEST_GICV3_RDIST_REGIONS != 1); - d->arch.vgic.rdist_stride = GUEST_GICV3_RDIST_STRIDE; /* The first redistributor should contain enough space for all CPUs */ diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h index 05fd11ca38..ca79ab6284 100644 --- a/xen/include/public/arch-arm.h +++ b/xen/include/public/arch-arm.h @@ -402,7 +402,6 @@ typedef uint64_t xen_callback_t; #define GUEST_GICV3_GICD_SIZE xen_mk_ullong(0x00010000) #define GUEST_GICV3_RDIST_STRIDE xen_mk_ullong(0x00020000) -#define GUEST_GICV3_RDIST_REGIONS 1 #define GUEST_GICV3_GICR0_BASE xen_mk_ullong(0x03020000) /* vCPU0..127 */ #define GUEST_GICV3_GICR0_SIZE xen_mk_ullong(0x01000000)