From patchwork Mon Mar 5 16:03:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 130678 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp2853908lja; Mon, 5 Mar 2018 08:07:16 -0800 (PST) X-Google-Smtp-Source: AG47ELui9PluFA5HvLtimmI+6cyESMB6iE1SPfXrAHX+lGTlbWkKhUKS7rsfAubuBzOHekyE3VKA X-Received: by 10.107.29.3 with SMTP id d3mr18039187iod.45.1520266036102; Mon, 05 Mar 2018 08:07:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520266036; cv=none; d=google.com; s=arc-20160816; b=Dllszn+BtY8EO8Cq4FdZNcoAGoU5j0LKJM252wy1sq6cLjB6isWr6W7xKIDNgIGugt /wJh4zaAWzn/+lTCZYjbaqfeMkmWngfmqZ7x1I0jIcdAoeUgaqJHqB+0yS27zDhYVtmk GnHZ6Vf9UJM0lDJ3BYXN1cL/TeuBHkJJb/ibMeVl83XO7/wmedcH45HQKRmdIVOKCXXG Kol0P0A2zR0+bRa9rI015nChzzvE2nk/rsNN8NNvcco3eLlvvvscjznerrwpzJVde+0Z kFsCpv8WY9dvfisz7KqagmTM3LXq62o0PpNF13kk+cFxmGCqsjn1XU7hmY16/dC8Ko/0 wA+w== 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=Pbi2u4r5KH3FNJi1VP0zCzZvyYk1ntkNAwVnkLCnHN0=; b=SWVOHMBJrJvc1krCyAqwThazmrEPgvTYWM9RP2tZrOqGxj5vGZElCCR7BAjIuAnEzB 8SUIXoEgGoi1rXGv4ib8eQkIX5c1yQHxDMPxcp+3/1NMu50p0ia62IMNEHIWaAt2/JaK hIqEUJVsPXkDOniztY8g02JMC1ObBCBmXkBxxG0pFdrM9dFoV2mfM+f31fsvJgbTEpr2 g5ArCEYiPwxIQ/vKNDIGUoQVX5tBurFj0MSM6F9dL9IpN82ps+dOH1zWzQHj23RmXiRy OTyFY+Zm5jF4JPQDDr19HAkjR9sB/on8naoiYBqrwitntKnfjo/LJYHhtWdbBHxjIY/v 7L5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=W26Nk4Cs; 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 e68si5933059itc.3.2018.03.05.08.07.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 08:07:16 -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=W26Nk4Cs; 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 1essbI-00079P-Kn; Mon, 05 Mar 2018 16:04:32 +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 1essbH-00077S-19 for xen-devel@lists.xenproject.org; Mon, 05 Mar 2018 16:04:31 +0000 X-Inumbo-ID: bb3b3f7b-208e-11e8-ba59-bc764e045a96 Received: from mail-wm0-x241.google.com (unknown [2a00:1450:400c:c09::241]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id bb3b3f7b-208e-11e8-ba59-bc764e045a96; Mon, 05 Mar 2018 17:03:24 +0100 (CET) Received: by mail-wm0-x241.google.com with SMTP id 188so16520895wme.1 for ; Mon, 05 Mar 2018 08:04:29 -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=SBmbgq9PI3vtZqOYfp4sihIsoEuhQVh/MiFhks5s2Tk=; b=W26Nk4Cso8cbcZDapjWwTkcSCupPy+cQ6W9UWMu3v3SFL650SxbHa7m6iTgl0Qejat /6H5vK9JKszaNrC03xTNJcyHY5poKSAuvsrUMhNNwOkHqc+zrg3qteUEi2MLqpRL+arv WwbLJBrae0cpDxTqXflwVGPgYHy/hU72uQPd4= 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=SBmbgq9PI3vtZqOYfp4sihIsoEuhQVh/MiFhks5s2Tk=; b=CjTlQZXGkdBRSE57D9ZvucvjDwHwTZ4lt2BSeZEvyqfINSoET1mTao5X+QB7zT0d7P OTS+48rFPSvdy3LivBtTFAvvS67HnlQKhnM+jLWtq9ClD2iRX8tsHndx3P54efxWw55l beLIzUQvrQuiQRNPqCk3lfWEVnZ/xWHYEg0B6UlJ/NlnsaJJxppwWdK7nGKGVdPPG4zT Alshhwip4KsOHdMmEUU4whOuinXpH7JEg56m91mb/ucAy/DOQNoZG26KmBjtWey7xxvF cH2garJqmPVJtFy77VQBxgIMDdi9PuTGccc7vfl1Digy59jkgDKEuspkNVHCG9lCHiqX Okog== X-Gm-Message-State: AElRT7HIUduAPaR/AqKTz/tum50fvxvHyKDrkOGMuZdYNTHra8a4hsXI 7viSH32kodhFBcEZRUXkKf6yjw== X-Received: by 10.28.40.214 with SMTP id o205mr8037788wmo.22.1520265868576; Mon, 05 Mar 2018 08:04:28 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Mar 2018 08:04:28 -0800 (PST) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Mon, 5 Mar 2018 16:03:24 +0000 Message-Id: <20180305160415.16760-7-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 06/57] ARM: vGICv3: remove rdist_stride from VGIC structure 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 last patch removed the usage of the hardware's redistributor-stride value from our (Dom0) GICv3 emulation. This means we no longer need to store this value in the VGIC data structure. Remove that variable and every code snippet that handled that, instead simply always use the architected value. Signed-off-by: Andre Przywara Acked-by: Julien Grall --- Changelog RFC ... v1: - Add Julien's ACK xen/arch/arm/gic-v3.c | 3 +-- xen/arch/arm/vgic-v3.c | 14 -------------- xen/include/asm-arm/domain.h | 1 - xen/include/asm-arm/vgic.h | 1 - xen/include/public/arch-arm.h | 1 - 5 files changed, 1 insertion(+), 19 deletions(-) diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index 02c85e4c0c..ea14ab4028 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -1682,8 +1682,7 @@ static int __init gicv3_init(void) reg = readl_relaxed(GICD + GICD_TYPER); intid_bits = GICD_TYPE_ID_BITS(reg); - vgic_v3_setup_hw(dbase, gicv3.rdist_count, gicv3.rdist_regions, - gicv3.rdist_stride, intid_bits); + vgic_v3_setup_hw(dbase, gicv3.rdist_count, gicv3.rdist_regions, intid_bits); gicv3_init_v2(); spin_lock_init(&gicv3.lock); diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c index 56cc38ffcc..4b42739a52 100644 --- a/xen/arch/arm/vgic-v3.c +++ b/xen/arch/arm/vgic-v3.c @@ -58,21 +58,18 @@ static struct { /* Re-distributor regions */ unsigned int nr_rdist_regions; const struct rdist_region *regions; - uint32_t rdist_stride; /* Re-distributor stride */ unsigned int intid_bits; /* Number of interrupt ID bits */ } vgic_v3_hw; void vgic_v3_setup_hw(paddr_t dbase, unsigned int nr_rdist_regions, const struct rdist_region *regions, - uint32_t rdist_stride, unsigned int intid_bits) { vgic_v3_hw.enabled = true; vgic_v3_hw.dbase = dbase; vgic_v3_hw.nr_rdist_regions = nr_rdist_regions; vgic_v3_hw.regions = regions; - vgic_v3_hw.rdist_stride = rdist_stride; vgic_v3_hw.intid_bits = intid_bits; } @@ -1672,15 +1669,6 @@ static int vgic_v3_domain_init(struct domain *d) d->arch.vgic.dbase = vgic_v3_hw.dbase; - d->arch.vgic.rdist_stride = vgic_v3_hw.rdist_stride; - /* - * If the stride is not set, the default stride for GICv3 is 2 * 64K: - * - first 64k page for Control and Physical LPIs - * - second 64k page for Control and Generation of SGIs - */ - if ( !d->arch.vgic.rdist_stride ) - d->arch.vgic.rdist_stride = 2 * SZ_64K; - for ( i = 0; i < vgic_v3_hw.nr_rdist_regions; i++ ) { paddr_t size = vgic_v3_hw.regions[i].size; @@ -1703,8 +1691,6 @@ static int vgic_v3_domain_init(struct domain *d) /* 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; - /* The first redistributor should contain enough space for all CPUs */ BUILD_BUG_ON((GUEST_GICV3_GICR0_SIZE / GICV3_GICR_SIZE) < MAX_VIRT_CPUS); d->arch.vgic.rdist_regions[0].base = GUEST_GICV3_GICR0_BASE; diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h index 4fe189b1c3..3eda7196ff 100644 --- a/xen/include/asm-arm/domain.h +++ b/xen/include/asm-arm/domain.h @@ -108,7 +108,6 @@ struct arch_domain unsigned int first_cpu; /* First CPU handled */ } *rdist_regions; int nr_regions; /* Number of rdist regions */ - uint32_t rdist_stride; /* Re-Distributor stride */ unsigned long int nr_lpis; uint64_t rdist_propbase; struct rb_root its_devices; /* Devices mapped to an ITS */ diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h index 6ea9f140a7..d61b54867b 100644 --- a/xen/include/asm-arm/vgic.h +++ b/xen/include/asm-arm/vgic.h @@ -261,7 +261,6 @@ struct rdist_region; void vgic_v3_setup_hw(paddr_t dbase, unsigned int nr_rdist_regions, const struct rdist_region *regions, - uint32_t rdist_stride, unsigned int intid_bits); #endif diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h index 05fd11ca38..eb424e8286 100644 --- a/xen/include/public/arch-arm.h +++ b/xen/include/public/arch-arm.h @@ -401,7 +401,6 @@ typedef uint64_t xen_callback_t; #define GUEST_GICV3_GICD_BASE xen_mk_ullong(0x03001000) #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 */