From patchwork Wed Nov 6 09:19:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Anisov X-Patchwork-Id: 11229747 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 728B916B1 for ; Wed, 6 Nov 2019 09:21:18 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 424D62173E for ; Wed, 6 Nov 2019 09:21:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SqVGA3Hc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 424D62173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iSHTn-00070X-RC; Wed, 06 Nov 2019 09:19:55 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iSHTm-000707-UT for xen-devel@lists.xenproject.org; Wed, 06 Nov 2019 09:19:54 +0000 X-Inumbo-ID: 896fa1a8-0076-11ea-984a-bc764e2007e4 Received: from mail-lf1-x144.google.com (unknown [2a00:1450:4864:20::144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 896fa1a8-0076-11ea-984a-bc764e2007e4; Wed, 06 Nov 2019 09:19:30 +0000 (UTC) Received: by mail-lf1-x144.google.com with SMTP id v4so17458437lfd.11 for ; Wed, 06 Nov 2019 01:19:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=a/yqnQeFJjOCdFr+6UQnrZBzrb36Gxv30QFZEk+hOfM=; b=SqVGA3HcPy64SPdiz6I+fO41zRqVsvTsNLsctkROyvYfjJ+Ab4bMxR76BB4bkBgDWn fIrHy41eguVb/io3Cdi0EmLii0PHxC3AoVaBlIpRH0HdraSUeqJ2Ant02PzGLsEE9dmg +wO/Jr7JPc+Fmg5qaoRLAEEXFygNtdr9bvOacpPCvKS+n2rg+zKmEPaAUESSOTtbF+aH VnNxndZ4rpcFvsuvuI+4/uaV+d8XJ0n08GMhiOo7L+OWz0G2IWA0ivoGT4w27huh71zH Dktn+qKtFDHqglgdsmAdUV7kkp997zhETSX0nJEEL/+P6xHBHrXMKOm5nYI9qQfVSmww 4JYQ== 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=a/yqnQeFJjOCdFr+6UQnrZBzrb36Gxv30QFZEk+hOfM=; b=LfRwkkI6MrsnWIQbR8WaoQLeNRiqf6mjO0pZ9c1ktHmaIgma4WEYxSfB1ZLi5gfgy1 G41ce/RpVT+o4hLZDp7pURyq7Jos9M04Z/uDg35uKthjjBAO00FjDJ/d7wdE9EVZjLmt g2Xy3E5OdmTbSuX2JwXXmkEvb15iqzRyp26YA0MV+Lb3UKpJGGtgjvPdqXuJ3uAgjcNf Xn2eaUJD3mJNauKnYh50jLgV8mXUIq+T2CtMo63YNZkvm8E7NsuPDsm8Thykpbsl14Dw ldEWr2beslOYV5c0AO4qRjSeCfsHhyXGCvhyv1ES/MU+AqivXgOfkI6jmoO1WNWUyPcH iJwg== X-Gm-Message-State: APjAAAUfOfJYLM8p9+UfWxgzSoEjLib8Pn22+z8Ovo6mArzpKN5xogMy QoMHW7k3lmTCYHRxl6loT6vCMR9k1hc= X-Google-Smtp-Source: APXvYqxUWE0/HQgGgtxE8ZQtp/uCj4yolTP0Dd1CJQ21BgI5yC4VaeSr/QMuNlpCy9SrCTxVWBZlhQ== X-Received: by 2002:a19:ad43:: with SMTP id s3mr1822047lfd.34.1573031968927; Wed, 06 Nov 2019 01:19:28 -0800 (PST) Received: from aanisov-work.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id g23sm3945937lja.104.2019.11.06.01.19.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Nov 2019 01:19:27 -0800 (PST) From: Andrii Anisov To: xen-devel@lists.xenproject.org Date: Wed, 6 Nov 2019 11:19:13 +0200 Message-Id: <1573031953-12894-8-git-send-email-andrii.anisov@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> References: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> Subject: [Xen-devel] [RFC 7/7] arm/gic-v3: add GIC version suffix to iomem range variables X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , Stefano Stabellini , Andrii Anisov , Volodymyr Babchuk MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Andrii Anisov ARM Compiler 6.6 has a proven bug: static data symbols, moved to an init section, becomes global. Thus these symbols clash with ones defined in gic-v2.c. The straight forward way to resolve the issue is to add the GIC version suffix, at least for one of the conflicting side. Signed-off-by: Andrii Anisov --- xen/arch/arm/gic-v3.c | 68 +++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index 0f6cbf6..f57597a 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -1328,14 +1328,14 @@ static const hw_irq_controller gicv3_guest_irq_type = { .set_affinity = gicv3_irq_set_affinity, }; -static paddr_t __initdata dbase = INVALID_PADDR; -static paddr_t __initdata vbase = INVALID_PADDR, vsize = 0; -static paddr_t __initdata cbase = INVALID_PADDR, csize = 0; +static paddr_t __initdata dbase_v3 = INVALID_PADDR; +static paddr_t __initdata vbase_v3 = INVALID_PADDR, vsize_v3 = 0; +static paddr_t __initdata cbase_v3 = INVALID_PADDR, csize_v3 = 0; /* If the GICv3 supports GICv2, initialize it */ static void __init gicv3_init_v2(void) { - if ( cbase == INVALID_PADDR || vbase == INVALID_PADDR ) + if ( cbase_v3 == INVALID_PADDR || vbase_v3 == INVALID_PADDR ) return; /* @@ -1343,26 +1343,26 @@ static void __init gicv3_init_v2(void) * So only support GICv2 on GICv3 when the virtual CPU interface is * at least GUEST_GICC_SIZE. */ - if ( vsize < GUEST_GICC_SIZE ) + if ( vsize_v3 < GUEST_GICC_SIZE ) { printk(XENLOG_WARNING "GICv3: WARNING: Not enabling support for GICv2 compat mode.\n" "Size of GICV (%#"PRIpaddr") must at least be %#llx.\n", - vsize, GUEST_GICC_SIZE); + vsize_v3, GUEST_GICC_SIZE); return; } printk("GICv3 compatible with GICv2 cbase %#"PRIpaddr" vbase %#"PRIpaddr"\n", - cbase, vbase); + cbase_v3, vbase_v3); - vgic_v2_setup_hw(dbase, cbase, csize, vbase, 0); + vgic_v2_setup_hw(dbase_v3, cbase_v3, csize_v3, vbase_v3, 0); } static void __init gicv3_ioremap_distributor(paddr_t dist_paddr) { if ( dist_paddr & ~PAGE_MASK ) panic("GICv3: Found unaligned distributor address %"PRIpaddr"\n", - dbase); + dbase_v3); gicv3.map_dbase = ioremap_nocache(dist_paddr, SZ_64K); if ( !gicv3.map_dbase ) @@ -1375,11 +1375,11 @@ static void __init gicv3_dt_init(void) int res, i; const struct dt_device_node *node = gicv3_info.node; - res = dt_device_get_address(node, 0, &dbase, NULL); + res = dt_device_get_address(node, 0, &dbase_v3, NULL); if ( res ) panic("GICv3: Cannot find a valid distributor address\n"); - gicv3_ioremap_distributor(dbase); + gicv3_ioremap_distributor(dbase_v3); if ( !dt_property_read_u32(node, "#redistributor-regions", &gicv3.rdist_count) ) @@ -1416,10 +1416,10 @@ static void __init gicv3_dt_init(void) * provided. */ res = dt_device_get_address(node, 1 + gicv3.rdist_count, - &cbase, &csize); + &cbase_v3, &csize_v3); if ( !res ) dt_device_get_address(node, 1 + gicv3.rdist_count + 2, - &vbase, &vsize); + &vbase_v3, &vsize_v3); } static int gicv3_iomem_deny_access(const struct domain *d) @@ -1427,7 +1427,7 @@ static int gicv3_iomem_deny_access(const struct domain *d) int rc, i; unsigned long mfn, nr; - mfn = dbase >> PAGE_SHIFT; + mfn = dbase_v3 >> PAGE_SHIFT; nr = PFN_UP(SZ_64K); rc = iomem_deny_access(d, mfn, mfn + nr); if ( rc ) @@ -1446,19 +1446,19 @@ static int gicv3_iomem_deny_access(const struct domain *d) return rc; } - if ( cbase != INVALID_PADDR ) + if ( cbase_v3 != INVALID_PADDR ) { - mfn = cbase >> PAGE_SHIFT; - nr = PFN_UP(csize); + mfn = cbase_v3 >> PAGE_SHIFT; + nr = PFN_UP(csize_v3); rc = iomem_deny_access(d, mfn, mfn + nr); if ( rc ) return rc; } - if ( vbase != INVALID_PADDR ) + if ( vbase_v3 != INVALID_PADDR ) { - mfn = vbase >> PAGE_SHIFT; - nr = PFN_UP(csize); + mfn = vbase_v3 >> PAGE_SHIFT; + nr = PFN_UP(csize_v3); return iomem_deny_access(d, mfn, mfn + nr); } @@ -1564,8 +1564,8 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header, /* Read from APIC table and fill up the GIC variables */ if ( !cpu_base_assigned ) { - cbase = processor->base_address; - vbase = processor->gicv_base_address; + cbase_v3 = processor->base_address; + vbase_v3 = processor->gicv_base_address; gicv3_info.maintenance_irq = processor->vgic_interrupt; if ( processor->flags & ACPI_MADT_VGIC_IRQ_MODE ) @@ -1577,8 +1577,8 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header, } else { - if ( cbase != processor->base_address - || vbase != processor->gicv_base_address + if ( cbase_v3 != processor->base_address + || vbase_v3 != processor->gicv_base_address || gicv3_info.maintenance_irq != processor->vgic_interrupt ) { printk("GICv3: GICC entries are not same in MADT table\n"); @@ -1599,7 +1599,7 @@ gic_acpi_parse_madt_distributor(struct acpi_subtable_header *header, if ( BAD_MADT_ENTRY(dist, end) ) return -EINVAL; - dbase = dist->base_address; + dbase_v3 = dist->base_address; return 0; } @@ -1674,7 +1674,7 @@ static void __init gicv3_acpi_init(void) if ( count <= 0 ) panic("GICv3: No valid GICD entries exists\n"); - gicv3_ioremap_distributor(dbase); + gicv3_ioremap_distributor(dbase_v3); /* Get number of redistributor */ count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR, @@ -1722,15 +1722,15 @@ static void __init gicv3_acpi_init(void) * Also set the size of the GICC and GICV when there base address * is not invalid as those values are not present in ACPI. */ - if ( !cbase ) - cbase = INVALID_PADDR; + if ( !cbase_v3 ) + cbase_v3 = INVALID_PADDR; else - csize = SZ_8K; + csize_v3 = SZ_8K; - if ( !vbase ) - vbase = INVALID_PADDR; + if ( !vbase_v3 ) + vbase_v3 = INVALID_PADDR; else - vsize = GUEST_GICC_SIZE; + vsize_v3 = GUEST_GICC_SIZE; } #else @@ -1789,7 +1789,7 @@ static int __init gicv3_init(void) " gic_maintenance_irq=%u\n" " gic_rdist_stride=%#x\n" " gic_rdist_regions=%d\n", - dbase, gicv3_info.maintenance_irq, + dbase_v3, gicv3_info.maintenance_irq, gicv3.rdist_stride, gicv3.rdist_count); printk(" redistributor regions:\n"); for ( i = 0; i < gicv3.rdist_count; i++ ) @@ -1803,7 +1803,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, intid_bits); + vgic_v3_setup_hw(dbase_v3, gicv3.rdist_count, gicv3.rdist_regions, intid_bits); gicv3_init_v2(); spin_lock_init(&gicv3.lock);