From nobody Tue Dec 16 02:53:25 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1573032066; cv=none; d=zoho.com; s=zohoarc; b=lfjTHBCe5vBnQ9YsEW67fVvsKTFyq5HQAw/pu7R52B9jPCggM0HpwSoZVOqNcvF2tFFGIBnWGdjvGRXG4YIdMoLzvuk5nXSyBuC68l0FjeBUK/mbYUPVYXhiSjzdPruBOkZmH22VStFc0Im13zyqGV62D76nTX5wLLYYhBh8mtE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573032066; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZiK48GROqu/FWjG7CyrmoH6YB5fgR1MrVua8sA6jhMU=; b=PogqfFdYI+tb0ZCc2U7kjJGBwPmDRtF6Eu6psz4GmUjXUwnMPyPV3GL466BRPzygJ5jeuXgecUTUa75u0GG1ShrAMlnNAFRB6xwbXk6+s3Q0ediN4AiN+YjHYMzuEbhjK9bq3ebB/CQMppc4OjCCf31u/un+WvXSNfkcqOyHlKo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1573032066414317.06897125289004; Wed, 6 Nov 2019 01:21:06 -0800 (PST) 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 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) 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) X-Inumbo-ID: 896fa1a8-0076-11ea-984a-bc764e2007e4 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) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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= =3D { .set_affinity =3D gicv3_irq_set_affinity, }; =20 -static paddr_t __initdata dbase =3D INVALID_PADDR; -static paddr_t __initdata vbase =3D INVALID_PADDR, vsize =3D 0; -static paddr_t __initdata cbase =3D INVALID_PADDR, csize =3D 0; +static paddr_t __initdata dbase_v3 =3D INVALID_PADDR; +static paddr_t __initdata vbase_v3 =3D INVALID_PADDR, vsize_v3 =3D 0; +static paddr_t __initdata cbase_v3 =3D INVALID_PADDR, csize_v3 =3D 0; =20 /* If the GICv3 supports GICv2, initialize it */ static void __init gicv3_init_v2(void) { - if ( cbase =3D=3D INVALID_PADDR || vbase =3D=3D INVALID_PADDR ) + if ( cbase_v3 =3D=3D INVALID_PADDR || vbase_v3 =3D=3D INVALID_PADDR ) return; =20 /* @@ -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; } =20 printk("GICv3 compatible with GICv2 cbase %#"PRIpaddr" vbase %#"PRIpad= dr"\n", - cbase, vbase); + cbase_v3, vbase_v3); =20 - vgic_v2_setup_hw(dbase, cbase, csize, vbase, 0); + vgic_v2_setup_hw(dbase_v3, cbase_v3, csize_v3, vbase_v3, 0); } =20 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); =20 gicv3.map_dbase =3D 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 =3D gicv3_info.node; =20 - res =3D dt_device_get_address(node, 0, &dbase, NULL); + res =3D dt_device_get_address(node, 0, &dbase_v3, NULL); if ( res ) panic("GICv3: Cannot find a valid distributor address\n"); =20 - gicv3_ioremap_distributor(dbase); + gicv3_ioremap_distributor(dbase_v3); =20 if ( !dt_property_read_u32(node, "#redistributor-regions", &gicv3.rdist_count) ) @@ -1416,10 +1416,10 @@ static void __init gicv3_dt_init(void) * provided. */ res =3D 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); } =20 static int gicv3_iomem_deny_access(const struct domain *d) @@ -1427,7 +1427,7 @@ static int gicv3_iomem_deny_access(const struct domai= n *d) int rc, i; unsigned long mfn, nr; =20 - mfn =3D dbase >> PAGE_SHIFT; + mfn =3D dbase_v3 >> PAGE_SHIFT; nr =3D PFN_UP(SZ_64K); rc =3D iomem_deny_access(d, mfn, mfn + nr); if ( rc ) @@ -1446,19 +1446,19 @@ static int gicv3_iomem_deny_access(const struct dom= ain *d) return rc; } =20 - if ( cbase !=3D INVALID_PADDR ) + if ( cbase_v3 !=3D INVALID_PADDR ) { - mfn =3D cbase >> PAGE_SHIFT; - nr =3D PFN_UP(csize); + mfn =3D cbase_v3 >> PAGE_SHIFT; + nr =3D PFN_UP(csize_v3); rc =3D iomem_deny_access(d, mfn, mfn + nr); if ( rc ) return rc; } =20 - if ( vbase !=3D INVALID_PADDR ) + if ( vbase_v3 !=3D INVALID_PADDR ) { - mfn =3D vbase >> PAGE_SHIFT; - nr =3D PFN_UP(csize); + mfn =3D vbase_v3 >> PAGE_SHIFT; + nr =3D PFN_UP(csize_v3); return iomem_deny_access(d, mfn, mfn + nr); } =20 @@ -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 =3D processor->base_address; - vbase =3D processor->gicv_base_address; + cbase_v3 =3D processor->base_address; + vbase_v3 =3D processor->gicv_base_address; gicv3_info.maintenance_irq =3D processor->vgic_interrupt; =20 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 !=3D processor->base_address - || vbase !=3D processor->gicv_base_address + if ( cbase_v3 !=3D processor->base_address + || vbase_v3 !=3D processor->gicv_base_address || gicv3_info.maintenance_irq !=3D 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; =20 - dbase =3D dist->base_address; + dbase_v3 =3D dist->base_address; =20 return 0; } @@ -1674,7 +1674,7 @@ static void __init gicv3_acpi_init(void) if ( count <=3D 0 ) panic("GICv3: No valid GICD entries exists\n"); =20 - gicv3_ioremap_distributor(dbase); + gicv3_ioremap_distributor(dbase_v3); =20 /* Get number of redistributor */ count =3D 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 =3D INVALID_PADDR; + if ( !cbase_v3 ) + cbase_v3 =3D INVALID_PADDR; else - csize =3D SZ_8K; + csize_v3 =3D SZ_8K; =20 - if ( !vbase ) - vbase =3D INVALID_PADDR; + if ( !vbase_v3 ) + vbase_v3 =3D INVALID_PADDR; else - vsize =3D GUEST_GICC_SIZE; + vsize_v3 =3D GUEST_GICC_SIZE; =20 } #else @@ -1789,7 +1789,7 @@ static int __init gicv3_init(void) " gic_maintenance_irq=3D%u\n" " gic_rdist_stride=3D%#x\n" " gic_rdist_regions=3D%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 =3D 0; i < gicv3.rdist_count; i++ ) @@ -1803,7 +1803,7 @@ static int __init gicv3_init(void) reg =3D readl_relaxed(GICD + GICD_TYPER); intid_bits =3D GICD_TYPE_ID_BITS(reg); =20 - 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, int= id_bits); gicv3_init_v2(); =20 spin_lock_init(&gicv3.lock); --=20 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel