From patchwork Wed Jan 24 14:35:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 125673 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp457022ljf; Wed, 24 Jan 2018 06:37:42 -0800 (PST) X-Google-Smtp-Source: AH8x225t5ZHwd9V2Jx8TayuvmCACmPbZmjylYWk/UucwzAmarzRMF/agxh/3Aqm6OI9HBe0RUQhE X-Received: by 10.36.90.137 with SMTP id v131mr9197850ita.41.1516804662302; Wed, 24 Jan 2018 06:37:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516804662; cv=none; d=google.com; s=arc-20160816; b=a/LblNw9PeNsg6yVpXbznn5L4V/cbi7fjKqQ44NUm/D44A2bvOulUM9jlTV7ZhNSsW 2ZxmGXxi+ggw2wUVbdavQ2/pctdg4Ixb8e6A3XXJz3/RC0iwxJxiFYz/iQSm3dFUyZjD +25LrH7tzvCjRRlphaUWaLS/vz19aOSfpwMtnAlOa4oJiV3lTloYFMZMqesWVFdASfYX Zn0vNPYxRsOgfuXDa6Tl0Z72pbqf0DlSmlwBhtGqIt4UVT9tMybGC6AFMMCcVcYkIxuB gKZ0LBaXZ4AtnBw8aFm5VF0sxdNYgGxfvKL1TLrLoaDdmgXXbNh7KsQe5gkpALWQnF5E kw2A== 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=ouEpdbQm3pc4IjDc4WwiKJir3MSEl3NnmfrdIR9uZW0=; b=D2uogeY5Bp1FHznulDtPjLJLg2qeY1DUcig/9HINe/ROsXxTLfc31sHzpYbdICqFwc 7tFyJyuV2xgUFD53u3/3UyaGNRDKDfPwHMh4nXcCJAPfAfOzT1G77i1Z+k8SZbolhFhr wHBW8sN/0ZUfKuZkNc5N9yQq+gqGYiDG7AjBSfoe+JsykZCM6xSm3ZMG+oZDdEARXWZp BSSX+HIivciJ3xlALYxTFteK62PHg7guinDwQ52bMXN9oVpW0RslFgzwU43eykHKjPjv WtoRdpy72d8Wm8BFiNObC/6BSyVBPRPUN6zyqOwUi5yvDbXqK+n/8q4/tw9EEszeQNNv OcEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=dsU2v4G5; 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 p125si281158itb.143.2018.01.24.06.37.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 06:37:42 -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=dsU2v4G5; 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 1eeM90-00014U-Th; Wed, 24 Jan 2018 14:35:18 +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 1eeM8z-00013y-Fm for xen-devel@lists.xenproject.org; Wed, 24 Jan 2018 14:35:17 +0000 X-Inumbo-ID: c8957b64-0113-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 c8957b64-0113-11e8-ba59-bc764e045a96; Wed, 24 Jan 2018 15:35:12 +0100 (CET) Received: by mail-wm0-x242.google.com with SMTP id i186so8837062wmi.4 for ; Wed, 24 Jan 2018 06:35:15 -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=L3jF9cr9V3ZWy1QP0r71MXQnbRvoLvzyfUP8KwYMZnQ=; b=dsU2v4G5mIB2U4mVq8sJ2KC5QYaleB9WXwUiJtAw93r6CpuN+2oBfBek1YiFJVKrYH z3S4C5JdN9pvVzNnWL+hDaNUEVYFsRLDqGySCuQsYVQo9yNMmZacOWYDtuxTyPesAJ8R Q5NLu8KW8JvlcAsUHfjJ8h8obxkuIO5iA7lgA= 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=L3jF9cr9V3ZWy1QP0r71MXQnbRvoLvzyfUP8KwYMZnQ=; b=D2xruo1VWUi+79QrVabrnNtzSGRfDdKi8Zc1B8DbjZM58VCQvbzJcKU+9Z2Qk5gsT3 z6DAqlYF9PzkgI10SMuD59O2M8e7OEYb/zO/X038Dr6rEYqmFOC7IbLho6AFi1i6LyNF Nq+/YP6wtubJ9qPromhcakn4EC2tCCZ2qN1zuFK8Cdpr6A6Ux18p929CGBXVJPkSr+lp M3zEhhGyNLaxVVA7RDkFDKO7gjsM8BezFpi8U4+d8MGq54Err5fI9HRWnw36jWFY5ymW e0pV+7kFZeyFVuhvH/isQHwIk75wwLJGwfEKNQT9pmUWYEdsbYS98zYnDpE65SND5Q88 6sKQ== X-Gm-Message-State: AKwxytdWIma3m4OqVIVq5oaPpM69a2fw/1bUZVnI/Y433KTY9TrAHIjR 7hfu1xj7VPSJfHEhP/50uOx5MBlAQs8= X-Received: by 10.28.186.132 with SMTP id k126mr4766650wmf.159.1516804514750; Wed, 24 Jan 2018 06:35:14 -0800 (PST) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id l9sm3267923wrb.91.2018.01.24.06.35.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Jan 2018 06:35:14 -0800 (PST) From: Andre Przywara To: Stefano Stabellini , Julien Grall Date: Wed, 24 Jan 2018 14:35:12 +0000 Message-Id: <20180124143517.18469-3-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180124143517.18469-1-andre.przywara@linaro.org> References: <20180124143517.18469-1-andre.przywara@linaro.org> Cc: xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH 2/7] 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 af16dfd005..7d3ea171b4 100644 --- a/xen/arch/arm/vgic-v3.c +++ b/xen/arch/arm/vgic-v3.c @@ -1640,8 +1640,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) @@ -1700,9 +1710,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)