From patchwork Fri Mar 9 15:11:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 131144 Delivered-To: patch@linaro.org Received: by 10.80.194.209 with SMTP id u17csp1135454edf; Fri, 9 Mar 2018 07:14:02 -0800 (PST) X-Google-Smtp-Source: AG47ELt3EUMUYZb9Wosgm/1JWiWLWn+Cqfp6s24ZUJOBhWYKB8TsXQ4ycw2PeHct/Kw2Etokootd X-Received: by 10.36.225.72 with SMTP id n69mr4076657ith.82.1520608440170; Fri, 09 Mar 2018 07:14:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520608440; cv=none; d=google.com; s=arc-20160816; b=V6sVnQyhSpA1shhwMZs/QWO7SZ9o2IO7O+pxQjNVNPeCTxv/HN+lXXQUigInDmXCSj kjpWxb52JmHrbxTsDYm5ay8e8qC+1p6/tJH0LV03W5TeU8FokJwaHzqOZ5EW2y318RLR Z54JNjeiiNDkMVrEXrWEUv1LQiwy5UwuSC/iko35tt7nuwSaQIf1NxAkTgp5LoqAixF4 SuSQjuGMRyIe8XO3T00EqGl6oDZ6DvDeH5dT+aYbOEd9sdiDjgg+XYMj+UqfXGEVFksW 8Q5J2kFFE7E5un/4CZEm2lbZJVZTC1t3srbHkbcpacZTIPecF2KmH6Clterx4NOBmYUY OcFg== 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=U6rs4yxrcUP4nL5zgcvzEPhQN+fUnCZOeR6ZI9PkZuw=; b=GyD3bqXNT8Fp7BfyMn+JW7nwT+WNqxu+khflt0r2ee7qXf1feBdxyOWWTF0b3hJayq I9/fbgivcpbv+Cwhf8pOGTzmlHlxbAe3ES5LQEM+f5yOwWuCfrK59py/nwPyZYXgc3ID WJpCSoGYhRTN3unUYCbUePzb+nRmFkuiJH4kFw8ypRKAg0EV4hNC4s0A0hnosbvuqhr4 WnIlNJuLUp2Z5+Ml4Q+Ww2dTa8A7phZ6MBPLCAr9FWGKrUxIXyl4pHbZqQifPhTIZzg+ Po8vbQbPKEHkXU4/qL/1T71FajUloqIpGQuLmUqEZqYh0UOGVLphrMmMKUkKt4RaqFnA f4Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=T3lAz2PD; 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 y6si1288996itd.25.2018.03.09.07.14.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Mar 2018 07:14:00 -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=T3lAz2PD; 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 1euJgS-0005ox-4U; Fri, 09 Mar 2018 15:11:48 +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 1euJgQ-0005of-Sg for xen-devel@lists.xenproject.org; Fri, 09 Mar 2018 15:11:46 +0000 X-Inumbo-ID: 0352d99c-23ac-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 0352d99c-23ac-11e8-ba59-bc764e045a96; Fri, 09 Mar 2018 16:10:33 +0100 (CET) Received: by mail-wr0-x244.google.com with SMTP id v18so9340741wrv.0 for ; Fri, 09 Mar 2018 07:11:45 -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=KTbd32Z6Jd+1U8JtShwavQLv4WmjEHj+VvxGHJirom8=; b=T3lAz2PDQFxlKm3Y2jtiCLWA1gphHjZY2RS4Rf6VXrhU6fw4u3QkjyS3gk2uZlf/Pq mrtJ4lPDnrWIpjhsm92k2CVDQTaQb3sDwc1B1iD9d8tzUiz7kxOlbAaRiBIOy05surQ7 MhGGLvuyWROQnY7kTDe29eN9UwP1oIphPIU+0= 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=KTbd32Z6Jd+1U8JtShwavQLv4WmjEHj+VvxGHJirom8=; b=eTKV4KDz4xIJF7sG/48RLoP9wapOzjWsFrbFbq+7ludpUiCDt0EM5p/J6c74sPol+T 8A/bHC3GXymBNlsuansepcOcF4b+Lr6r5/jjsjFQ9OCFatRpXFMhjIqg0cBoV24t+oDX RU34qepmCtIA+n9YXGcIk2hMhrqdAcznd6RDWjwGzurxhsbJ85EN67yfMKHlNtDPDkdo 1RhQiZLhswR0Pis1AIOXQYqZeOsGTY5wXFahn/o9lYMOPxhts0PbkLFk6hL7SyLSApKa bTz/RBUpBDECoGCdF5xbhT80/PQ4cyAx3W6VdFPHFvTmBbfO48AYwB0pk6xleSNi3Vea xwAw== X-Gm-Message-State: APf1xPCJcY9j7GqYgPK9LCmNp97IOQYjc7lmRKFn+fZuLzAHrZAysZ6K wfPb4zQexHEV2A/JiZlQVwhnPQ== X-Received: by 10.223.136.220 with SMTP id g28mr25301628wrg.246.1520608304641; Fri, 09 Mar 2018 07:11:44 -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.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 07:11:44 -0800 (PST) From: Andre Przywara To: Stefano Stabellini , Julien Grall Date: Fri, 9 Mar 2018 15:11:17 +0000 Message-Id: <20180309151133.31371-2-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 01/17] ARM: vGICv3: clarify on 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" Normally there is only one GICv3 redistributor region, and we use that for DomU guests using a GICv3. Explain the background in a comment and why we need to keep the number of hardware regions for Dom0. Signed-off-by: Andre Przywara Acked-by: Julien Grall --- xen/arch/arm/vgic-v3.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c index 2ad8a6be62..d5b34a7d0f 100644 --- a/xen/arch/arm/vgic-v3.c +++ b/xen/arch/arm/vgic-v3.c @@ -1632,6 +1632,16 @@ static int vgic_v3_vcpu_init(struct vcpu *v) static inline unsigned int vgic_v3_rdist_count(struct domain *d) { + /* + * Normally there is only one GICv3 redistributor region. + * The GICv3 DT binding provisions for multiple regions, since there are + * platforms out there which need those (multi-socket systems). + * 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 : GUEST_GICV3_RDIST_REGIONS; } @@ -1692,7 +1702,7 @@ 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 */ + /* A single Re-distributor region is mapped for the guest. */ BUILD_BUG_ON(GUEST_GICV3_RDIST_REGIONS != 1); d->arch.vgic.rdist_stride = GUEST_GICV3_RDIST_STRIDE;