From patchwork Fri Feb 9 14:38:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 127828 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp679694ljc; Fri, 9 Feb 2018 06:42:04 -0800 (PST) X-Google-Smtp-Source: AH8x226iMNF9iu7h1up0iaXULjdv2QQ2EEJXwU4GN5zD5BSV/KAqQMfxsXRJv+w711qNsuXCbB0B X-Received: by 10.36.222.134 with SMTP id d128mr3854037itg.150.1518187324435; Fri, 09 Feb 2018 06:42:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518187324; cv=none; d=google.com; s=arc-20160816; b=s0XKizY7x5UOk5isfkCc3JnzIR1YO1QT1YxG+CFVzCkGFkm79HgR0h/y5IXRk2XKUo Hf5OjIu5ViH6kAETDl5okbS4Iyy2k7FN0x23sLw37jn2DO3y+l0iF9jQuJVboWrulNEU fX9EL5d2bcqYS6NSv05zWpQbP1/sQc9XoFcLX6evz3Iw6MJh4FriDcPHO/KmC9UeqYBQ beFG2IcxQYqlTEPwU/NczGTtZrgqrDBPsZer5iW1WacgCQIJYJLn1g4ujESEm97QgB3E BGN3D/iVPzM6gyte6Zts01zHkn+ANlqq2neUtFNshVrolLHZZHId8n5szHEOM2uw7Hsu 0CtA== 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=JRw0t5jSxsomgYXDPVMqXw5JBxIGFdzWQhPs4dgL4P8=; b=B8vLkcAF+OXqsw+Y6rt5l6J/oXx1K2IAssSBsUts+EehGgfFYdCbWjkjOM2nG+0qkb a0D1Q167TR2R32LEgg2tyOmHuSDnDpqYBTzbpq8SIMbbXlBfddPRy/a3humzyAXA2PSx LOBH+1vBWLIDRsSdK5VrBR82rgw2DnZtlw2bew8RJUPFV5U36Th3WPkp32vAiyEudi9Q 08XRyH+jAOPYek8NNIzEor0NG1g8MfTAnSlfMhHVWnSav6nX1yZJF5b6Lry3X4MAO5ky LnXZ4LxeXmDmJ8IsX8Wd2JQEkUmPRTkRRoI/I6ujsI8kO7uoh4Y0MXz7ZdeHMmHAJlLW 9dcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DeQW6+a3; 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 x83si15486ioe.30.2018.02.09.06.42.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 06:42:04 -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=DeQW6+a3; 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 1ek9qE-00083b-9p; Fri, 09 Feb 2018 14:39:54 +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 1ek9qD-00082m-T0 for xen-devel@lists.xenproject.org; Fri, 09 Feb 2018 14:39:53 +0000 X-Inumbo-ID: 058389f0-0da7-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 058389f0-0da7-11e8-ba59-bc764e045a96; Fri, 09 Feb 2018 15:39:24 +0100 (CET) Received: by mail-wm0-x241.google.com with SMTP id j21so4254052wmh.1 for ; Fri, 09 Feb 2018 06:39:52 -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=/ZBT6ijP5bY1HTWS8CRgrtJMlr5QOHlyWg8ha6Rt0/o=; b=DeQW6+a3fRuiwSexPU/Y0J+lEUrHAQP4+5HgoOOxirVkwpchDUkYvuhPDMahsv7ztm yreYdMxLj/kxtfURHSOXQmEOGe4Umed4l8/pLjjj10PWEenjqhjh6d2fbl3YMpSh9W4D jdBhF5d4H6EvoM5PHcJcftm3wBM9L+xGHUgwM= 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=/ZBT6ijP5bY1HTWS8CRgrtJMlr5QOHlyWg8ha6Rt0/o=; b=A1TfeFPa1HGNy9L9GR8CWvzx5Ml4Ls5Nw4snAqsURgw09e1VKVnSDwy+uAk3Cdw1Ek PodlGLbZdZ9W6TqvI6Jik5OrNVPiVCvHYe5RnGvulc+O11+BzgZFZDuGhszaXrptFtYb NjUOyjrSQKflU/ADuUlO5u8ws/WNLr7Ku6xOCAj7tFT0+asHczMJ5WdrYMeGlJ/WRfmq jRFLEXIjloH4fBroIUfRPUZSkz1xbdskTUUTDsU1ZyF/PsZ6QG5PVtPPzGVVCcGZAM4M LYb551Xn0hlLfbdJsfGI1mqHk3uPUjAXZ3jj0p6uEowX6i5A8Wj04xDWxbAfe3Ixsypn qyrw== X-Gm-Message-State: APf1xPDJKrdzJCSyb988ZfPnBkICG2MOOSuZC5KcNWQ2jNHrm0jo90Pe hTZrx3+o36zn0D4TNpU60K92iA== X-Received: by 10.28.122.11 with SMTP id v11mr2083557wmc.38.1518187191577; Fri, 09 Feb 2018 06:39:51 -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.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Feb 2018 06:39:51 -0800 (PST) From: Andre Przywara To: Stefano Stabellini , Julien Grall , xen-devel@lists.xenproject.org Date: Fri, 9 Feb 2018 14:38:54 +0000 Message-Id: <20180209143937.28866-7-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 06/49] 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 --- 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 | 2 -- 5 files changed, 1 insertion(+), 20 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 e45bbc6dcf..9b1b62744c 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; @@ -1700,8 +1688,6 @@ static int vgic_v3_domain_init(struct domain *d) { d->arch.vgic.dbase = GUEST_GICV3_GICD_BASE; - 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 ca79ab6284..3bca165fbf 100644 --- a/xen/include/public/arch-arm.h +++ b/xen/include/public/arch-arm.h @@ -401,8 +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_GICR0_BASE xen_mk_ullong(0x03020000) /* vCPU0..127 */ #define GUEST_GICV3_GICR0_SIZE xen_mk_ullong(0x01000000)