From patchwork Fri Dec 16 10:56:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101390 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1334467qgi; Fri, 16 Dec 2016 03:00:19 -0800 (PST) X-Received: by 10.84.218.76 with SMTP id f12mr5572640plm.141.1481886018913; Fri, 16 Dec 2016 03:00:18 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k67si7241434pfk.224.2016.12.16.03.00.17; Fri, 16 Dec 2016 03:00:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934976AbcLPK77 (ORCPT + 25 others); Fri, 16 Dec 2016 05:59:59 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:52019 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760723AbcLPK5G (ORCPT ); Fri, 16 Dec 2016 05:57:06 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0LcOxi-1d0I922lvi-00jqt9; Fri, 16 Dec 2016 11:56:46 +0100 From: Arnd Bergmann To: linux-arch@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, Russell King , Andrew Morton , kernel-build-reports@lists.linaro.org, kvmarm@lists.cs.columbia.edu, Arnd Bergmann Subject: [PATCH 01/13] [HACK] gcc-4.5: avoid link errors for unused function pointers Date: Fri, 16 Dec 2016 11:56:22 +0100 Message-Id: <20161216105634.235457-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161216105634.235457-1-arnd@arndb.de> References: <20161216105634.235457-1-arnd@arndb.de> X-Provags-ID: V03:K0:vFbgLrDYQ3zcvZ0Zuwem5grYkrDOoxhLHu/tDyrG0LozaMoku3E q4ocad26K13URQ8GCUm90U/KJGcppwb4ZEMTZ4gdHsD/GlgYiR3WohigOl7NbGA0uBKKNah 9AgQq7wJrKFNYRzi9MOmNzsniqd4u8QWhyThGDZ93uY6xi29SAjDZBA29XX62hBzN1dInG7 YhW7RNwRTP3CJQtSZQwrg== X-UI-Out-Filterresults: notjunk:1; V01:K0:U4tinFx8Xno=:g/nimuN89oZl8QdK/XHKDx L4gCYUA/+4ijHFAfiwFsJ/ZV0j4WzmBGxNX/5e2ojMxOTPQ2RA37qWC81Qre+FU+jFT3Qu7ra 4SszuwOhruWBqBJyfDrZ9FgkO6UQ44DVt1CRVjNQjy0dN52QMism6EOEmTEYL7e9+5EpqmgHk lSMRPqFRMiyFSSlbo9a4tWDu4RlMw3mRqkiFLlL20Qsl+VIN/SsaY+UJ8CF6DUx7XYDEQGM3/ CnuBM1gib+2Fg8i3S3GEbHQFswn53jY/be7jMnnLhETXHRRwdtR7/Xfxovy1P+YF6pqFWaupj va1WO0ZzYpuoX9D6iCblt7a8qLgc6x8PtOS0A7VIy53Qyw218R9JzfddnJFA8fp09BylRNtAz zjzfoLRZCZvEYltswga1XybUkDvlbKD3M0ci4atA4v87dgTYO1oO9/moDKWUwDWUfOE+UFaBl JZsD7uookZwDPKFMIwrTcHFRL4rpRoZi9hWBwioEZ5q3FI/2O+7Iy6bN9UBclxX5zp/YGTtEg 1OI7xo8spaqPewiZLy9QTZjQi08K+KXysCzgkBXIBQ7DhFWwBfgEQcyST4+xtix27A4FDiFzX cEmAWIB9BVy8T3IPfW3g6yTt8UppOZ7FtowanQORh5MDgC8pwCwVXDtbmJ3TqWNw5uDtre0O/ weVA733aQ/nt6VtaIhhErRgcAN2/xcGFro3gdjsJ3QwtBE8ofXEB1VxF6HJrDulIeAF8= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc versions before 4.6 cannot do dead code elimination across function pointers, e.g. with a construct like static int f(void) { return declared_extern_but_undefined_function(); } static int g(void) { if (0) reference_function(&f); } which we rely on in lots of places when registering functions, it results in a link error for declared_extern_but_undefined_function. This patch is incomplete and introduces a few other problems (at least warnings about unused functions), but it shows what we would have to do in order to address this in the kernel. The three options forward I see are: - Declare gcc-4.5 (and prior version) fully supported and do proper fixes for the bugs we find. - Officially declare gcc-4.6 the minimum required version for the kernel and remove all existing hacks we have for older versions. - Do nothing: if you use an older gcc version and you run into this, you are on your own and can submit a patch for the specific problem you find. At the moment, gcc-3.2 is in theory still supported, but I found that even gcc-4.2 is almost completely useless these days at least on ARM. If we want to keep gcc-4.5 supported, then we can probably have 4.3 as the minimum version without too many other workarounds. Do not apply but feel free to pick out parts of this patch and submit them if you use old gcc versions and run into the problems. Signed-off-by: Arnd Bergmann --- arch/arm/mach-imx/pm-imx5.c | 20 ++++++++++++++++---- arch/arm/mach-sa1100/pm.c | 2 ++ arch/arm/plat-samsung/pm.c | 4 ++++ drivers/dma/ti-dma-crossbar.c | 4 ++++ drivers/firmware/psci_checker.c | 3 +++ drivers/iio/adc/exynos_adc.c | 3 +++ drivers/net/ethernet/via/via-rhine.c | 6 ++++++ 7 files changed, 38 insertions(+), 4 deletions(-) -- 2.9.0 diff --git a/arch/arm/mach-imx/pm-imx5.c b/arch/arm/mach-imx/pm-imx5.c index 9424e7f808c7..de912b0a6451 100644 --- a/arch/arm/mach-imx/pm-imx5.c +++ b/arch/arm/mach-imx/pm-imx5.c @@ -78,6 +78,7 @@ struct imx5_pm_suspend_data { int suspend_io_count; }; +#ifdef CONFIG_SOC_IMX53 static const struct imx5_suspend_io_state imx53_suspend_io_config[] = { #define MX53_DSE_HIGHZ_MASK (0x7 << 19) {.offset = 0x584, .clear = MX53_DSE_HIGHZ_MASK}, /* DQM0 */ @@ -104,13 +105,17 @@ static const struct imx5_suspend_io_state imx53_suspend_io_config[] = { /* Controls the CKE signal which is required to leave self refresh */ {.offset = 0x720, .clear = MX53_DSE_HIGHZ_MASK, .set = 1 << 19}, /* CTLDS */ }; +#endif +#ifdef CONFIG_SOC_IMX51 static const struct imx5_pm_data imx51_pm_data __initconst = { .ccm_addr = 0x73fd4000, .cortex_addr = 0x83fa0000, .gpc_addr = 0x73fd8000, }; +#endif +#if defined(CONFIG_SOC_IMX53) && defined(CONFIG_SUSPEND) static const struct imx5_pm_data imx53_pm_data __initconst = { .ccm_addr = 0x53fd4000, .cortex_addr = 0x63fa0000, @@ -127,6 +132,9 @@ static const struct imx5_pm_suspend_data imx53_pm_suspend_data __initconst = { }; #define MX5_MAX_SUSPEND_IOSTATE ARRAY_SIZE(imx53_suspend_io_config) +#else +#define MX5_MAX_SUSPEND_IOSTATE 0 +#endif /* * This structure is for passing necessary data for low level ocram @@ -383,6 +391,7 @@ static int __init imx5_suspend_init(const struct imx5_pm_suspend_data *soc_data) return ret; } +#if defined(CONFIG_SUSPEND) static int __init imx5_pm_common_init(const struct imx5_pm_data *data, const struct imx5_pm_suspend_data *sdata) { @@ -420,15 +429,18 @@ static int __init imx5_pm_common_init(const struct imx5_pm_data *data, return 0; } +#endif void __init imx51_pm_init(void) { - if (IS_ENABLED(CONFIG_SOC_IMX51)) - imx5_pm_common_init(&imx51_pm_data, NULL); +#if defined(CONFIG_SOC_IMX51) && defined(CONFIG_SUSPEND) + imx5_pm_common_init(&imx51_pm_data, NULL); +#endif } void __init imx53_pm_init(void) { - if (IS_ENABLED(CONFIG_SOC_IMX53)) - imx5_pm_common_init(&imx53_pm_data, &imx53_pm_suspend_data); +#if defined(CONFIG_SOC_IMX53) && defined(CONFIG_SUSPEND) + imx5_pm_common_init(&imx53_pm_data, &imx53_pm_suspend_data); +#endif } diff --git a/arch/arm/mach-sa1100/pm.c b/arch/arm/mach-sa1100/pm.c index 34853d5dfda2..cb896dc97030 100644 --- a/arch/arm/mach-sa1100/pm.c +++ b/arch/arm/mach-sa1100/pm.c @@ -121,6 +121,8 @@ static const struct platform_suspend_ops sa11x0_pm_ops = { int __init sa11x0_pm_init(void) { +#ifdef CONFIG_SUSPEND suspend_set_ops(&sa11x0_pm_ops); +#endif return 0; } diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c index d7803b434732..264c538a3ab8 100644 --- a/arch/arm/plat-samsung/pm.c +++ b/arch/arm/plat-samsung/pm.c @@ -71,6 +71,7 @@ int (*pm_cpu_sleep)(unsigned long); * central control for sleep/resume process */ +#ifdef CONFIG_SUSPEND static int s3c_pm_enter(suspend_state_t state) { int ret; @@ -194,11 +195,14 @@ static const struct platform_suspend_ops s3c_pm_ops = { * from the board specific initialisation if the board supports * it. */ +#endif int __init s3c_pm_init(void) { +#ifdef CONFIG_SUSPEND printk("S3C Power Management, Copyright 2004 Simtec Electronics\n"); suspend_set_ops(&s3c_pm_ops); +#endif return 0; } diff --git a/drivers/dma/ti-dma-crossbar.c b/drivers/dma/ti-dma-crossbar.c index 3f24aeb48c0e..e9f0543cb30a 100644 --- a/drivers/dma/ti-dma-crossbar.c +++ b/drivers/dma/ti-dma-crossbar.c @@ -184,8 +184,10 @@ static int ti_am335x_xbar_probe(struct platform_device *pdev) for (i = 0; i < xbar->dma_requests; i++) ti_am335x_xbar_write(xbar->iomem, i, 0); +#ifdef CONFIG_DMA_OF ret = of_dma_router_register(node, ti_am335x_xbar_route_allocate, &xbar->dmarouter); +#endif return ret; } @@ -414,8 +416,10 @@ static int ti_dra7_xbar_probe(struct platform_device *pdev) ti_dra7_xbar_write(xbar->iomem, i, xbar->safe_val); } +#ifdef CONFIG_DMA_OF ret = of_dma_router_register(node, ti_dra7_xbar_route_allocate, &xbar->dmarouter); +#endif if (ret) { /* Restore the defaults for the crossbar */ for (i = 0; i < xbar->dma_requests; i++) { diff --git a/drivers/firmware/psci_checker.c b/drivers/firmware/psci_checker.c index 44bdb78f837b..37c5c873c5ec 100644 --- a/drivers/firmware/psci_checker.c +++ b/drivers/firmware/psci_checker.c @@ -273,6 +273,9 @@ static int suspend_test_thread(void *arg) struct timer_list wakeup_timer = TIMER_INITIALIZER(dummy_callback, 0, 0); + if (!IS_ENABLED(CONFIG_CPU_IDLE)) + return -ENXIO; + /* Wait for the main thread to give the start signal. */ wait_for_completion(&suspend_threads_started); diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c index c15756d7bf7f..b2a658aa9a83 100644 --- a/drivers/iio/adc/exynos_adc.c +++ b/drivers/iio/adc/exynos_adc.c @@ -615,6 +615,9 @@ static irqreturn_t exynos_ts_isr(int irq, void *dev_id) bool pressed; int ret; + if (!IS_REACHABLE(CONFIG_INPUT)) + return IRQ_HANDLED; + while (info->input->users) { ret = exynos_read_s3c64xx_ts(dev, &x, &y); if (ret == -ETIMEDOUT) diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c index ba5c54249055..6b45401ff149 100644 --- a/drivers/net/ethernet/via/via-rhine.c +++ b/drivers/net/ethernet/via/via-rhine.c @@ -2580,6 +2580,7 @@ static SIMPLE_DEV_PM_OPS(rhine_pm_ops, rhine_suspend, rhine_resume); #endif /* !CONFIG_PM_SLEEP */ +#ifdef CONFIG_PCI static struct pci_driver rhine_driver_pci = { .name = DRV_NAME, .id_table = rhine_pci_tbl, @@ -2588,6 +2589,7 @@ static struct pci_driver rhine_driver_pci = { .shutdown = rhine_shutdown_pci, .driver.pm = RHINE_PM_OPS, }; +#endif static struct platform_driver rhine_driver_platform = { .probe = rhine_init_one_platform, @@ -2633,7 +2635,9 @@ static int __init rhine_init(void) else if (avoid_D3) pr_info("avoid_D3 set\n"); +#ifdef CONFIG_PCI ret_pci = pci_register_driver(&rhine_driver_pci); +#endif ret_platform = platform_driver_register(&rhine_driver_platform); if ((ret_pci < 0) && (ret_platform < 0)) return ret_pci; @@ -2645,7 +2649,9 @@ static int __init rhine_init(void) static void __exit rhine_cleanup(void) { platform_driver_unregister(&rhine_driver_platform); +#ifdef CONFIG_PCI pci_unregister_driver(&rhine_driver_pci); +#endif } From patchwork Fri Dec 16 10:56:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101401 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1333525qgi; Fri, 16 Dec 2016 02:58:00 -0800 (PST) X-Received: by 10.99.207.17 with SMTP id j17mr4418028pgg.57.1481885880809; Fri, 16 Dec 2016 02:58:00 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si7244399pli.292.2016.12.16.02.58.00; Fri, 16 Dec 2016 02:58:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761059AbcLPK5n (ORCPT + 25 others); Fri, 16 Dec 2016 05:57:43 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:50357 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760265AbcLPK5G (ORCPT ); Fri, 16 Dec 2016 05:57:06 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0LalbM-1d1vVP04VM-00kO3Z; Fri, 16 Dec 2016 11:56:47 +0100 From: Arnd Bergmann To: linux-arch@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, Russell King , Andrew Morton , kernel-build-reports@lists.linaro.org, kvmarm@lists.cs.columbia.edu, Arnd Bergmann Subject: [PATCH 02/13] KVM: arm: fix gcc-4.5 build Date: Fri, 16 Dec 2016 11:56:23 +0100 Message-Id: <20161216105634.235457-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161216105634.235457-1-arnd@arndb.de> References: <20161216105634.235457-1-arnd@arndb.de> X-Provags-ID: V03:K0:DVCkK3KEcguB1qqf1HWMbg0hpnzFrcizh07o9Hxz7RocFz4+fsM cyZwBshFHrz2vVTZMxBsbM+9XI/jC81mwum1gKOiKXOuG+nfhnJC+mbYUZnkyTsMNIh/3xw dYMAaWQnqjtOCS/Wfio8wImPTh3eDmyJCeYMtNShd86ITYcOvb6RBf9qLwiFneqIi1OTzwv Hl6XswuE38jZlXQEItbCg== X-UI-Out-Filterresults: notjunk:1; V01:K0:wtr0xb8jMOM=:4X0/E50Oq98RE3pOFtlkA8 Q2iLPZlZ/9M+KsrBZ7Uodk6NfBmZwkgma5Tz1WScnXLHjpPKQ7PFUzUqCRKaCbSaFHy9XQNmP JUWCCvi4NgS+1hDgbsDqtYeNkPdYJd82G4NvGzdB2XDKSLiRYuSVN/Q0RY8OhH4IjdirYICIp Vlmx2wpleOfb+klBaOJ1AebKJM1DZiLM7bPem/ZmMehIpR9kpJckGgsCcgBPhTjjloyUbhvrE kE16NjTfD9UD73dF68LxpQ+xU7U65szMmUsL0nV60zhPx/mdaiBmV5o1OfN4ETjzvH7Zizw0q WpzGPIpR39qZvoYaf3tKbK4upCv3pzquNT8qYetJ3vFbtjEVhJs0obAve/PaVxz0BdwiEb0Qm O2iAipxDw2w0uoOc3s9YMtSgvGLElUWrtWAqg7zsqvR4cuVD7cn8LqYhbGfgG1u6nbJvpzJH6 jynn1HoQ9P5H78jPcH5XCYAgD9cmTuYRE7kVN09sebw+Sb9/PA32Kc6G9mZpNAG9ch3AHoBZg nvhPmQ4pDu4ZkdgWQPmuJCwSJdF9lxxHjmZJPTbnidvftLrE6a9O7yreYj+0bev23N6gOeC41 /smJgWodduKKmaIj/geaH0SwJcFY/bo/cY/BzsReFOckF/ABt9bF8tU96Jbelm4cZXDaDDXRX C4UucysoST/CVEqwHyxsNt7+6gBBDpfnzPEnwmt0mBUjGqi1ttzgxebcQwyJP3OhO/hQ= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Old gcc versions cannot used named initializers for anonymous unions, leading to a build failure here. This replaces the anonymous union with a named one, which allows us to build with at least gcc-4.3 through 4.5. Versions 4.6 and higher are fine without this. virt/kvm/arm/vgic/vgic-mmio-v2.c:295: error: unknown field 'read' specified in initializer virt/kvm/arm/vgic/vgic-mmio-v2.c:295: warning: missing braces around initializer virt/kvm/arm/vgic/vgic-mmio-v2.c:295: warning: (near initialization for 'vgic_v2_dist_registers[0].') virt/kvm/arm/vgic/vgic-mmio-v2.c:295: error: unknown field 'write' specified in initializer virt/kvm/arm/vgic/vgic-mmio-v2.c:298: error: unknown field 'read' specified in initializer Fixes: 59c5ab40989a ("KVM: arm64: vgic-its: Introduce ITS emulation file with MMIO framework") Signed-off-by: Arnd Bergmann --- virt/kvm/arm/vgic/vgic-its.c | 4 ++-- virt/kvm/arm/vgic/vgic-mmio-v3.c | 8 ++++---- virt/kvm/arm/vgic/vgic-mmio.c | 16 ++++++++-------- virt/kvm/arm/vgic/vgic-mmio.h | 12 ++++++------ 4 files changed, 20 insertions(+), 20 deletions(-) -- 2.9.0 diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c index 8c2b3cdcb2c5..922d820e2646 100644 --- a/virt/kvm/arm/vgic/vgic-its.c +++ b/virt/kvm/arm/vgic/vgic-its.c @@ -1292,8 +1292,8 @@ static void vgic_mmio_write_its_baser(struct kvm *kvm, .reg_offset = off, \ .len = length, \ .access_flags = acc, \ - .its_read = rd, \ - .its_write = wr, \ + .r.its_read = rd, \ + .w.its_write = wr, \ } static void its_mmio_write_wi(struct kvm *kvm, struct vgic_its *its, diff --git a/virt/kvm/arm/vgic/vgic-mmio-v3.c b/virt/kvm/arm/vgic/vgic-mmio-v3.c index 50f42f0f8c4f..aa31110e4ebd 100644 --- a/virt/kvm/arm/vgic/vgic-mmio-v3.c +++ b/virt/kvm/arm/vgic/vgic-mmio-v3.c @@ -362,15 +362,15 @@ static void vgic_mmio_write_pendbase(struct kvm_vcpu *vcpu, .bits_per_irq = bpi, \ .len = (bpi * VGIC_NR_PRIVATE_IRQS) / 8, \ .access_flags = acc, \ - .read = vgic_mmio_read_raz, \ - .write = vgic_mmio_write_wi, \ + .r.read = vgic_mmio_read_raz, \ + .w.write = vgic_mmio_write_wi, \ }, { \ .reg_offset = off + (bpi * VGIC_NR_PRIVATE_IRQS) / 8, \ .bits_per_irq = bpi, \ .len = (bpi * (1024 - VGIC_NR_PRIVATE_IRQS)) / 8, \ .access_flags = acc, \ - .read = rd, \ - .write = wr, \ + .r.read = rd, \ + .w.write = wr, \ } static const struct vgic_register_region vgic_v3_dist_registers[] = { diff --git a/virt/kvm/arm/vgic/vgic-mmio.c b/virt/kvm/arm/vgic/vgic-mmio.c index ebe1b9fa3c4d..6690922bc6b0 100644 --- a/virt/kvm/arm/vgic/vgic-mmio.c +++ b/virt/kvm/arm/vgic/vgic-mmio.c @@ -500,16 +500,16 @@ static int dispatch_mmio_read(struct kvm_vcpu *vcpu, struct kvm_io_device *dev, switch (iodev->iodev_type) { case IODEV_CPUIF: - data = region->read(vcpu, addr, len); + data = region->r.read(vcpu, addr, len); break; case IODEV_DIST: - data = region->read(vcpu, addr, len); + data = region->r.read(vcpu, addr, len); break; case IODEV_REDIST: - data = region->read(iodev->redist_vcpu, addr, len); + data = region->r.read(iodev->redist_vcpu, addr, len); break; case IODEV_ITS: - data = region->its_read(vcpu->kvm, iodev->its, addr, len); + data = region->r.its_read(vcpu->kvm, iodev->its, addr, len); break; } @@ -531,16 +531,16 @@ static int dispatch_mmio_write(struct kvm_vcpu *vcpu, struct kvm_io_device *dev, switch (iodev->iodev_type) { case IODEV_CPUIF: - region->write(vcpu, addr, len, data); + region->w.write(vcpu, addr, len, data); break; case IODEV_DIST: - region->write(vcpu, addr, len, data); + region->w.write(vcpu, addr, len, data); break; case IODEV_REDIST: - region->write(iodev->redist_vcpu, addr, len, data); + region->w.write(iodev->redist_vcpu, addr, len, data); break; case IODEV_ITS: - region->its_write(vcpu->kvm, iodev->its, addr, len, data); + region->w.its_write(vcpu->kvm, iodev->its, addr, len, data); break; } diff --git a/virt/kvm/arm/vgic/vgic-mmio.h b/virt/kvm/arm/vgic/vgic-mmio.h index 84961b4e4422..7f7da7239612 100644 --- a/virt/kvm/arm/vgic/vgic-mmio.h +++ b/virt/kvm/arm/vgic/vgic-mmio.h @@ -26,14 +26,14 @@ struct vgic_register_region { unsigned int len); unsigned long (*its_read)(struct kvm *kvm, struct vgic_its *its, gpa_t addr, unsigned int len); - }; + } r; union { void (*write)(struct kvm_vcpu *vcpu, gpa_t addr, unsigned int len, unsigned long val); void (*its_write)(struct kvm *kvm, struct vgic_its *its, gpa_t addr, unsigned int len, unsigned long val); - }; + } w; }; extern struct kvm_io_device_ops kvm_io_gic_ops; @@ -72,8 +72,8 @@ extern struct kvm_io_device_ops kvm_io_gic_ops; .bits_per_irq = bpi, \ .len = bpi * 1024 / 8, \ .access_flags = acc, \ - .read = rd, \ - .write = wr, \ + .r.read = rd, \ + .w.write = wr, \ } #define REGISTER_DESC_WITH_LENGTH(off, rd, wr, length, acc) \ @@ -82,8 +82,8 @@ extern struct kvm_io_device_ops kvm_io_gic_ops; .bits_per_irq = 0, \ .len = length, \ .access_flags = acc, \ - .read = rd, \ - .write = wr, \ + .r.read = rd, \ + .w.write = wr, \ } int kvm_vgic_register_mmio_region(struct kvm *kvm, struct kvm_vcpu *vcpu, From patchwork Fri Dec 16 10:56:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101394 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1334099qgi; Fri, 16 Dec 2016 02:59:28 -0800 (PST) X-Received: by 10.107.46.227 with SMTP id u96mr2370838iou.58.1481885968644; Fri, 16 Dec 2016 02:59:28 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69si5541315iop.162.2016.12.16.02.59.28; Fri, 16 Dec 2016 02:59:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761398AbcLPK7P (ORCPT + 25 others); Fri, 16 Dec 2016 05:59:15 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:60636 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760740AbcLPK5G (ORCPT ); Fri, 16 Dec 2016 05:57:06 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0LhePx-1cv4xC1fXN-00mqto; Fri, 16 Dec 2016 11:56:47 +0100 From: Arnd Bergmann To: linux-arch@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, Russell King , Andrew Morton , kernel-build-reports@lists.linaro.org, kvmarm@lists.cs.columbia.edu, Arnd Bergmann Subject: [PATCH 03/13] ARM: div64: fix building with gcc-4.5 and lower Date: Fri, 16 Dec 2016 11:56:24 +0100 Message-Id: <20161216105634.235457-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161216105634.235457-1-arnd@arndb.de> References: <20161216105634.235457-1-arnd@arndb.de> X-Provags-ID: V03:K0:j4f76WHAY+4er3F+sPncZ+Slq9VqmYBaANTsLzkR5n4xBGVHg1d y313Yw8sBIi1YvMgfc2hg53sfoPM22L3nb3ZUvQcbY++9nxFdGZmRd2W4k4XtJGZznD6qWr 72ZjIUSxC6jswCR+Cx8TnX77Wb2uc0lBjJbDu2HWnaWFZAgkfQnz9tZ93bPNyvw1cXnMBFo Vbiyx4I5+wW2ZZBS1J8Jg== X-UI-Out-Filterresults: notjunk:1; V01:K0:13eNAk/KnhE=:tR93KxZi4dsjEGyw7MNzp+ UncFSmm22D0ZZlg6xOEoni1cRp41VHob5fJ/1H63IYOP7ihg0A7ARo7ahXDW6LbjyirqlXdlW /MkxPMOpbNZHHhfJTcAokAHW6P6CFPOZWuxlyNK897PD3YuGLHjdb0b18GTVHyvBqhsBpOo0H bVWfo3vBV2z7qaMqWr0fKsk9t8/w4BAEa29Z+jTHQm+bZyXbr+PRK9EkDADF2Zy3FFEPtOl6Q d2NgMQCGC4t3r0VSK3m4uh5ZoZ48rUHwFbBCw1cD0FNQF3gR531TZc4KKTGFxhG7yP8IXBY4u /IczVYWoy6S8KujLERZIyFlNR+cGntwK4nQQ5LuspJe+3zZydPPTVM5vKO+IRD+ye7HChuQqU E/XTraKSVGKqK7N0PCck7KtMluuXNAcSK2rLTf6GHKnM1KV1b4tK3Bn4w9kkitogiFkADz7UQ 1q77FzoV0O08tBKUkuRrBFwMo7UMAK/jUdGwuw6iiaiZrDQeGvWfjngyu5j0W/44hRAMaKUfj vLNn67zvZqvolPU8l+2yPvj5ffZ9jsIJ+1vPrIrmGzdyTOYlAcPVwemc9tBUXNypgqMXMNieD mNpZxITwDfAr/iwdmFokGo5zSYs3IqaqYBfCEWir9LUx2SGL+JE5qv0gKlszGg5caJ/uIcywz 9rXkoiG93dOkmijwu8mRHQiytb3d285GPQRgt968LIZq5AwOnMTjsk1l7m+I/xpwMghw= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org drivers/media/dvb-frontends/s921.c: In function 's921_pll_tune': arch/arm/include/asm/div64.h:109: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm' arch/arm/include/asm/div64.h:127: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm' arch/arm/include/asm/div64.h:109: error: 'asm' operand has impossible constraints arch/arm/include/asm/div64.h:127: error: 'asm' operand has impossible constraints scripts/Makefile.build:299: recipe for target 'drivers/media/dvb-frontends/s921.o' failed Signed-off-by: Arnd Bergmann --- arch/arm/include/asm/div64.h | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) -- 2.9.0 diff --git a/arch/arm/include/asm/div64.h b/arch/arm/include/asm/div64.h index 7ca0c613c33b..e1c8d4a58797 100644 --- a/arch/arm/include/asm/div64.h +++ b/arch/arm/include/asm/div64.h @@ -66,27 +66,16 @@ static inline uint32_t __div64_32(uint64_t *n, uint32_t base) */ #define do_div(n, base) __div64_32(&(n), base) -#elif defined(CONFIG_CPU_32v3) +#elif GCC_VERSION < 40600 /* - * modern compiler versions (>= gcc-4.9) tend to misoptimize - * the code for ARMv3, and this is not getting fixed any more. + * gcc-4.4 and gcc-4.5 tend to run out of registers in their + * register allocation in some functions */ #define do_div(n, base) __div64_32(&(n), base) #else -/* - * gcc versions earlier than 4.0 are simply too problematic for the - * __div64_const32() code in asm-generic/div64.h. First there is - * gcc PR 15089 that tend to trig on more complex constructs, spurious - * .global __udivsi3 are inserted even if none of those symbols are - * referenced in the generated code, and those gcc versions are not able - * to do constant propagation on long long values anyway. - */ - -#define __div64_const32_is_OK (__GNUC__ >= 4) - static inline uint64_t __arch_xprod_64(uint64_t m, uint64_t n, bool bias) { unsigned long long res; From patchwork Fri Dec 16 10:56:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101395 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1334095qgi; Fri, 16 Dec 2016 02:59:28 -0800 (PST) X-Received: by 10.107.142.194 with SMTP id q185mr2287524iod.147.1481885968304; Fri, 16 Dec 2016 02:59:28 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69si5541315iop.162.2016.12.16.02.59.28; Fri, 16 Dec 2016 02:59:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761362AbcLPK7D (ORCPT + 25 others); Fri, 16 Dec 2016 05:59:03 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:63566 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760750AbcLPK5G (ORCPT ); Fri, 16 Dec 2016 05:57:06 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lj2nG-1cteJV3AZ4-00dD3r; Fri, 16 Dec 2016 11:56:47 +0100 From: Arnd Bergmann To: linux-arch@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, Russell King , Andrew Morton , kernel-build-reports@lists.linaro.org, kvmarm@lists.cs.columbia.edu, Arnd Bergmann Subject: [PATCH 04/13] vfio-pci: use 32-bit comparisons for register address for gcc-4.5 Date: Fri, 16 Dec 2016 11:56:25 +0100 Message-Id: <20161216105634.235457-5-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161216105634.235457-1-arnd@arndb.de> References: <20161216105634.235457-1-arnd@arndb.de> X-Provags-ID: V03:K0:3sAnhY1vCpHXx9fOmJrVw8C3+HAu6+XJdqOflIiYTkeafs/ysB6 L2BEvyjcYHhNFYyQFaUCVJ2wyweeT2/qrtLtbCOb08zPebTE4O1DZZxk79VFzZRg3kZcZSt SkFO6wWj1cPpWrP3oxBiii2cJVjzJ01B3qlw0kCICF+z5LzXF5JgLPUITK8L1YemK0YErHO +2MyOXlFcQsY9e5V9e3+g== X-UI-Out-Filterresults: notjunk:1; V01:K0:Ewo+Unz3rpk=:KQFoYguy5BBiVXJB17dFjU gnHehykkrew95/kbOcT2I8zn1jYtT5lKNWG4fumtb16wTjWjJxHYrePLXXs8BMrNQUNM26BlM J6Df6cldysipUYYVyPtHiurMTLy8i2bBUCte5WrTy93AEy7nO3oy+Gg1KIhg4rDSBbTZkpDFL 70IvaPlraa4ZPHTtidRvIUQoJg4TC9svazyCx9spEJXMoZcpHUghwd4Fv9hrLGU8SOsAi6xBF cRQfBP9Xnj8MfxRsMWoPdDwR0b8c9kHFTcG0cYZQvleewqcmtMerSllGxT1G8uzrZtaw1COGD 3o7s+UbgTsDcg/TErPqGrN1gnwJsZ32fiIBSUUDUwKyDLKA4/EoNyyDFXjmZ9dYUYdYnoW3CH Tl4CTBuvGFWCPNn8soau2owvh4kM7UUoEm0Bpdmkel/NqNGM3P7NmvJhnKl0v7DD5ZxUeiFAI z3EoGEdAHRlcQANxpCuYPUBtuDQsW/DKgD5PWJgMPuMhkOoNAqDDqsvA9ujEpCv0wjBB4RIaM kEOEPy1szanqdBFxcCsq/Mu4ku1urAcgoBkNPRhkXAlIH30owZV6ryEn3JxQXjsYc/7brb1CM UxWrS0UIQqmZ35+z89fqz1R62Ead6Ce+UweG4Jl6LuCgmQ6RiV0RNa17K1DJtzigzo7IisLJI OMrpAvO6mXJQvjOQmzIWHep8OtTD/H6bVK5MVOrwttHuAa3Bkeij+gSUlxkRokg/5FOM= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using ancient compilers (gcc-4.5 or older) on ARM, we get a link failure with the vfio-pci driver: ERROR: "__aeabi_lcmp" [drivers/vfio/pci/vfio-pci.ko] undefined! The reason is that the compiler tries to do a comparison of a 64-bit range. This changes it to convert to a 32-bit number explicitly first, as newer compilers do for themselves. Signed-off-by: Arnd Bergmann --- drivers/vfio/pci/vfio_pci_rdwr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/vfio/pci/vfio_pci_rdwr.c b/drivers/vfio/pci/vfio_pci_rdwr.c index 5ffd1d9ad4bd..357243d76f10 100644 --- a/drivers/vfio/pci/vfio_pci_rdwr.c +++ b/drivers/vfio/pci/vfio_pci_rdwr.c @@ -193,7 +193,10 @@ ssize_t vfio_pci_vga_rw(struct vfio_pci_device *vdev, char __user *buf, if (!vdev->has_vga) return -EINVAL; - switch (pos) { + if (pos > 0xbfffful) + return -EINVAL; + + switch ((u32)pos) { case 0xa0000 ... 0xbffff: count = min(count, (size_t)(0xc0000 - pos)); iomem = ioremap_nocache(0xa0000, 0xbffff - 0xa0000 + 1); From patchwork Fri Dec 16 10:56:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101402 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1333521qgi; Fri, 16 Dec 2016 02:58:00 -0800 (PST) X-Received: by 10.84.204.133 with SMTP id b5mr5518872ple.49.1481885880472; Fri, 16 Dec 2016 02:58:00 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si7244399pli.292.2016.12.16.02.58.00; Fri, 16 Dec 2016 02:58:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760970AbcLPK5d (ORCPT + 25 others); Fri, 16 Dec 2016 05:57:33 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:64363 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760229AbcLPK5G (ORCPT ); Fri, 16 Dec 2016 05:57:06 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0MJCxO-1cJU5a0QJ8-002lmZ; Fri, 16 Dec 2016 11:56:48 +0100 From: Arnd Bergmann To: linux-arch@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, Russell King , Andrew Morton , kernel-build-reports@lists.linaro.org, kvmarm@lists.cs.columbia.edu, Arnd Bergmann Subject: [PATCH 05/13] clk: pxa: fix gcc-4.4 build Date: Fri, 16 Dec 2016 11:56:26 +0100 Message-Id: <20161216105634.235457-6-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161216105634.235457-1-arnd@arndb.de> References: <20161216105634.235457-1-arnd@arndb.de> X-Provags-ID: V03:K0:ZoyDgURaDa9I23fw4uvF0FXdKYM6OnAKmQDx6ePgO76Qu0AC3I1 NYFVAifYJABeGewmUC4qRN0NOM5r7EzcpF5HLevOaSZVjnUIG1IUt+BUPOEMyL1qF2H3BJD tD4okY74wHP8fgd0aLn3EWhdj+MwTu3pTV+Qls625lnVM1OjCSHQzwqmCytICCUpNMn7trv nuvyWn6BjI4BaEUnm3ovw== X-UI-Out-Filterresults: notjunk:1; V01:K0:O3TX39O1fik=:N9xV33SV4FUkkDDhyJmFO5 wXvrg373bKpUViGqBsPZLQ7zMUDhQEshrD/ciebq0R23hrg02N2loOVmAU4K1SpU+RB/wEX/5 mC8QliampaCkf/4G5nDqoI6uJaqhQ4AG8Syd2tzboC/KVVR9dQ2F18tieCIOjq4nX4TYUsVBk MagtszYOv+TIqBtLO6adAzg6ZsnOffY/ZlOd9oV8CzEa+51z25asLcsiJo1wEtM4kSa8TlRWq AeFCrKnF/7XvUgP42LjL8Lph/mPNve9OjY9OJOH/HJwPtx2RBt41HOgbuqahSxDUuF0dz9B/F YEQbVwRMTOLtQHKIgY7RI82DJyENsRmsSFIMM00n+l0eg39EYyq9U10v5e0jbrs/NRSoKw2kx 0QFoDUy6DuvRnD2fm9wwDxWWGIflJwB5u0IrdWlpZ0pSXRjBjflaCyuc3SHmju2hHiWstuRzZ 9RhY/51HdroFtY0wzhDDU+Nk7ztRlJL5MZbi/W4ivk4rQ0il16d6b2MBp3Rj76XwrfLIi9JcW Orq0txhED5GD1xeqZks/OOXMmtFd5BP2k0M4g6/LYMh0URbhA3hdq/ButDsIh7gVSVAVUPsG4 eluo1r5MzYkXNCj9ctd3wRNpvPnRUyJtbB4tDG546/Va+ob9AhS54rZU2xWLWwrKRU5Za32MN fovitCCaACL1tq3IsZpjkxo9cZq8xJ2ZV3V6kiON8i8WiZDYJGnmg/gf3CW3d+jtyuX4= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With gcc-4.4 and earlier, the asm statement must not end in ':', or we get this build error: drivers/clk/pxa/clk-pxa.c: In function 'pxa2xx_core_turbo_switch': drivers/clk/pxa/clk-pxa.c:152: error: expected string literal before ')' token Signed-off-by: Arnd Bergmann --- drivers/clk/pxa/clk-pxa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.9.0 diff --git a/drivers/clk/pxa/clk-pxa.c b/drivers/clk/pxa/clk-pxa.c index 74f64c3c4290..626ec5613bb1 100644 --- a/drivers/clk/pxa/clk-pxa.c +++ b/drivers/clk/pxa/clk-pxa.c @@ -148,8 +148,7 @@ void pxa2xx_core_turbo_switch(bool on) "2: b 1b\n" "3: nop\n" : "=&r" (unused) - : "r" (clkcfg) - : ); + : "r" (clkcfg)); local_irq_restore(flags); } From patchwork Fri Dec 16 10:56:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101391 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1334276qgi; Fri, 16 Dec 2016 02:59:56 -0800 (PST) X-Received: by 10.99.181.76 with SMTP id u12mr4543658pgo.64.1481885996201; Fri, 16 Dec 2016 02:59:56 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 62si7274543ply.143.2016.12.16.02.59.53; Fri, 16 Dec 2016 02:59:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934895AbcLPK7q (ORCPT + 25 others); Fri, 16 Dec 2016 05:59:46 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:59246 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760724AbcLPK5G (ORCPT ); Fri, 16 Dec 2016 05:57:06 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0M3B8p-1cZW4N1vj5-00sxYg; Fri, 16 Dec 2016 11:56:48 +0100 From: Arnd Bergmann To: linux-arch@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, Russell King , Andrew Morton , kernel-build-reports@lists.linaro.org, kvmarm@lists.cs.columbia.edu, Arnd Bergmann Subject: [PATCH 06/13] ARM: atomic: fix gcc-4.4 build Date: Fri, 16 Dec 2016 11:56:27 +0100 Message-Id: <20161216105634.235457-7-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161216105634.235457-1-arnd@arndb.de> References: <20161216105634.235457-1-arnd@arndb.de> X-Provags-ID: V03:K0:vxJJPs6HvW9RBmgWtx+wBxKJHDbtZ+XZPepzQz7dHPu80Gg2CTj /dtFKYTEcYYOpPTZTvJMr1Dl6qizkCUQODROHsVYgTyUI/ecpKLlbFWM3TGtnOrkhz2PPbQ uC6gZ1KtOybCAtmBD85EznrZeg9d5BTOUsTSPQegdLbfBRAgLFxiwfCaWBhVVIlLo130Crl CgI6RyTmXLUZiLsHJ5ULQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:3IPkXmV89Ro=:9eeiDj0KghwpW7jj3nhNht n858QkUV0XBGwGX9gURpaf6wXyv4WXBb5JLWFSKXd1BgRwIFqG4Du553dIWLoftPNa6d9NReK V6gzY0WGHCXOmr36b3NHxQqfrnoosZtM+0KGqmIu0ToenkKKNoxX5lyvn3dGwypHKAFSbnMCQ AUNYBg0sXQid+x4Spe+edHJK/bN+XHeuBzbstnO0d5o3VzpcLa7BE1LMewJEeczslTM+QtR1Y IpklijTqY5IN966zSPlQ0o/2O4ypZawWk9LiEIJbzp3gfu0aw1p3S+BQsXd7v9mxfB0pnmKr/ v7EEpCFgot24n7AJUw1K7Fdca/pRDVjTJPrh0IwYXRGqrCMtOPwpkmxEId7RamUFDjBunCumR e9xOhYvufMkmKuIwjL5DOgtZ67NzyeBnKfe/AJpuUwnCwx8gbM+3e/XdIUBT4ZMMtxSW1lxPC jAJuaUrEa4990v+mj7KQypjACpC0iN0zJbRa0eddW8aQFc7cIFuIPp0tMlaAKzJPo0Uyq8VcT RPLHQ0B+IcdTJ4tm3Q3/t1kwD+JeIt229AviAy3XFjXjCdcDyKa/WKkZKKLzEW0Yf1Emp9cTx HiOaq7uMt+HYg3cXJ7d/cZC5wtVRV4TeBI544TDwjANyd9mT1+uZ0YV1mYK6aG9yZ8T+sjHLj DHlkEs5BdLf9tfQbFjp61la1WzLSoPumLA/F19LA+07ZqpbpiBxK2i7JQhmKkwfQlbxc= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc-4.4 fails to build some files with this constraint, which was added to help out with gcc-4.6 and higher: fs/btrfs/delayed-ref.c: In function 'add_delayed_tree_ref': arch/arm/include/asm/atomic.h:280: error: 'asm' operand requires impossible reload Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44492 Signed-off-by: Arnd Bergmann --- arch/arm/include/asm/atomic.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h index 66d0e215a773..65d5b843831a 100644 --- a/arch/arm/include/asm/atomic.h +++ b/arch/arm/include/asm/atomic.h @@ -280,7 +280,10 @@ static inline long long atomic64_read(const atomic64_t *v) __asm__ __volatile__("@ atomic64_read\n" " ldrd %0, %H0, [%1]" : "=&r" (result) - : "r" (&v->counter), "Qo" (v->counter) + : "r" (&v->counter) +#if GCC_VERSION >= 40600 + , "Qo" (v->counter) +#endif ); return result; @@ -302,7 +305,10 @@ static inline long long atomic64_read(const atomic64_t *v) __asm__ __volatile__("@ atomic64_read\n" " ldrexd %0, %H0, [%1]" : "=&r" (result) - : "r" (&v->counter), "Qo" (v->counter) + : "r" (&v->counter) +#if GCC_VERSION >= 40600 + , "Qo" (v->counter) +#endif ); return result; From patchwork Fri Dec 16 10:56:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101392 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1334257qgi; Fri, 16 Dec 2016 02:59:53 -0800 (PST) X-Received: by 10.99.253.85 with SMTP id m21mr4656758pgj.38.1481885993564; Fri, 16 Dec 2016 02:59:53 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 62si7274543ply.143.2016.12.16.02.59.53; Fri, 16 Dec 2016 02:59:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934842AbcLPK7e (ORCPT + 25 others); Fri, 16 Dec 2016 05:59:34 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:53721 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760749AbcLPK5G (ORCPT ); Fri, 16 Dec 2016 05:57:06 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0LhvGc-1cunxr0XPW-00n89H; Fri, 16 Dec 2016 11:56:49 +0100 From: Arnd Bergmann To: linux-arch@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, Russell King , Andrew Morton , kernel-build-reports@lists.linaro.org, kvmarm@lists.cs.columbia.edu, Arnd Bergmann Subject: [PATCH 07/13] watchdog: kempld: fix gcc-4.3 build Date: Fri, 16 Dec 2016 11:56:28 +0100 Message-Id: <20161216105634.235457-8-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161216105634.235457-1-arnd@arndb.de> References: <20161216105634.235457-1-arnd@arndb.de> X-Provags-ID: V03:K0:bKgB3BQpvPRs49NAbMvhifnnk+OPpWwz+xgJXiXXhJhceVUK53T pjG5Jkozv/z60G+zgNigp+MvManDrEdfbh3X58sL7SmI9KInhYNDGvXxPmux4vxrfN6W118 La5iu72TAlhJ4L8ZXZtrKDWCFcXDSryrUCvdC3VdjqXNcOUXcPcnxfebfYZBkXaeyAPkbRY IiTBTb62cfQn2/atd8z7Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:37K2/S81aS8=:oyK9ON1e80MvKf8hWmVAOF 2qacpbj2p7ICE5YMUGZAD195pk22r/PfA1HMzOrajCV0ucQ9mpgc9ybFyqub5lv86vALrbwhv iDisD+ul2j3CsPkssp8Hee7o92yk/vehO3m5zM8CVU++QUKvBtqeiB5Rt+YQ45Z6achujULEV BTZKYvt1BJwYzCKIT3WRg1lWIe2A2StsEOVR8KONAndSUyu+sL808vAyCELvab+zCoF33cb8G dMaB5KF8iSVoGHOExF7TgKbVMX1hf4Juhpsa9Rz0C11/TEMF6NuSiCD1OZeV8ZnFXWtJf4uql kCsKKCRjO9H8QqPhNmr/+5w/BDHBbSKMkm15NzxCivpjDRFlgcAuNjw701sy8VSRgdFdPlBkz /Ckf8TVnCj73plo9Qz14wC9RDxeniR0dFQ++cOiFwgXdvdUPPK4vgOfObxeSEmsHmqtokb6u5 bjwow8joa6NvD60Ag2qe1ab9tT4fN18c3ItH8BBOdICwpCILWmoiZzdmIG1mgtsSluuQyXZ2L WintplEXexDrwfG3PGKPfdJMXj1qVqjJpyy96WQekEGHjQqj4yoA9Eif7FYBTVjb2aA0JpO1v LfT1Xf5DS3nOvaElTg63LAuZW8FwuLepOrG+IPHeh6mDUZFPKVGMlv+BR7Uj3UsZUesBAIiPd pTx/XRJKE9TViOiLOdXR4K1LccLoU5dFIauZjngZOU3fN1mr+FJAyjtTqkXslTT/CMug= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc-4.3 can't decide whether the constant value in kempld_prescaler[PRESCALER_21] is built-time constant or not, and gets confused by the logic in do_div(): drivers/watchdog/kempld_wdt.o: In function `kempld_wdt_set_stage_timeout': kempld_wdt.c:(.text.kempld_wdt_set_stage_timeout+0x130): undefined reference to `__aeabi_uldivmod' This adds a call to ACCESS_ONCE() to force it to not consider it to be constant, and leaves the more efficient normal case in place for modern compilers, using an #ifdef to annotate why we do this hack. Signed-off-by: Arnd Bergmann --- drivers/watchdog/kempld_wdt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/watchdog/kempld_wdt.c b/drivers/watchdog/kempld_wdt.c index 8e302d0e346c..3efa295ac627 100644 --- a/drivers/watchdog/kempld_wdt.c +++ b/drivers/watchdog/kempld_wdt.c @@ -140,12 +140,19 @@ static int kempld_wdt_set_stage_timeout(struct kempld_wdt_data *wdt_data, unsigned int timeout) { struct kempld_device_data *pld = wdt_data->pld; - u32 prescaler = kempld_prescaler[PRESCALER_21]; + u32 prescaler; u64 stage_timeout64; u32 stage_timeout; u32 remainder; u8 stage_cfg; +#if GCC_VERSION < 40400 + /* work around a bug compiling do_div() */ + prescaler = READ_ONCE(kempld_prescaler[PRESCALER_21]); +#else + prescaler = kempld_prescaler[PRESCALER_21]; +#endif + if (!stage) return -EINVAL; From patchwork Fri Dec 16 10:56:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101393 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1334101qgi; Fri, 16 Dec 2016 02:59:29 -0800 (PST) X-Received: by 10.107.201.129 with SMTP id z123mr2068916iof.112.1481885968969; Fri, 16 Dec 2016 02:59:28 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69si5541315iop.162.2016.12.16.02.59.28; Fri, 16 Dec 2016 02:59:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934635AbcLPK7Y (ORCPT + 25 others); Fri, 16 Dec 2016 05:59:24 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:63515 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760727AbcLPK5G (ORCPT ); Fri, 16 Dec 2016 05:57:06 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0LkggW-1cs0QP21lk-00aSy9; Fri, 16 Dec 2016 11:56:49 +0100 From: Arnd Bergmann To: linux-arch@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, Russell King , Andrew Morton , kernel-build-reports@lists.linaro.org, kvmarm@lists.cs.columbia.edu, Arnd Bergmann Subject: [PATCH 08/13] arm/arm64: xen: avoid gcc-4.4 warning Date: Fri, 16 Dec 2016 11:56:29 +0100 Message-Id: <20161216105634.235457-9-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161216105634.235457-1-arnd@arndb.de> References: <20161216105634.235457-1-arnd@arndb.de> X-Provags-ID: V03:K0:dktSP2sjw4aS7ySR4Gb2om1wF7Glddnj2w+xQdODvhMzekqMXmP FDRhsNIfok+w1sX/XXM/U7pzThLUBFned/LBb1zJ7fvYajGknCWzg7dYHBlSikySt7vl+b1 p0/hIiDzLyPAZf+wTWPH/5qRnaJoIKOj1BOYmGq5U0D7LJen2AcQoZI1Dxn6oIMWOO+IL/Y ovmNY8oF5VSj2QyoYAotg== X-UI-Out-Filterresults: notjunk:1; V01:K0:7LX8ESfCQ1k=:OxFuZF9Yo8c8KnodV6y+NF 1TjJQwgnUhYmAssd2tOxTuECDO1+6Z4GT99JWr93DImVh+8G5+r774krtj767vPHROWbBzehM BEhkQjwbTL5CzCXOqFlorRmgWRnIkOcDPkJuhYLaYOWKGM7gQPuhBbmT22/GEgznjWRDvHKX7 7QHceTPvwLQ6ytEL1HCz5HeDAWElg3Ffm3nW6L7SQVE8jc7SoMZeE9fusmNIfFE2YB9/Jig5l BSGvVmiLe1iVaA+SX8R7stZrbi4JPE/OgY9V5ABWWJuyGWW6L76bsC8t0jH5Ua7oh4WXUB6Jg QStAbSPbmzMVy7QJMHOgddUijDtmc09vJ3b9tcxQWkZFZ90TbllkyufgRa4Obs6sCB9i4DRwQ VQTGHZMZYOQIXo8IVUcgoNd9+Y8xh+dvNK3q6qA3XZpB/jv0pKqETeAIWQNOxOl3KvIIZdifb BUBQ3O5qacUs+YoGFZNxjqwwOLd1MR+BoPkUp6dTo3lIrHDs/Bbg3c27A24z6ZFpyRSOUsO2h xuaoR536P0A+zDq86KTPBCbmG8JH4tFPcqI/ECzqbJtnSDRaPmb3HEDtLs4JkxHwOnaNNiOJv brZTgjIMLK4Hjs6UoU9vr+eYGjJYQVdK/sCDEu+Bbm/YlWHmHkjKU2+AESNlmTj8p8D4VAMkr dDtK+g/qX1grzzbBpJAhhMmN8IzJ9RroABrGujmGYbpShtDlTNjD7BhJ0tccbmdNnJ6w= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ancient gcc doesn't know about __builtin_unreachable(), causing lots of instances of a harmless warning: include/xen/arm/page.h: In function 'arbitrary_virt_to_machine': include/xen/arm/page.h:85: warning: no return statement in function returning non-void Adding a return statement doesn't change the behavior here, but shuts up that warning. Signed-off-by: Arnd Bergmann --- include/xen/arm/page.h | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 diff --git a/include/xen/arm/page.h b/include/xen/arm/page.h index 415dbc6e43fd..2485013e3c6f 100644 --- a/include/xen/arm/page.h +++ b/include/xen/arm/page.h @@ -82,6 +82,7 @@ static inline unsigned long bfn_to_pfn(unsigned long bfn) static inline xmaddr_t arbitrary_virt_to_machine(void *vaddr) { BUG(); + return XMADDR(0); } /* TODO: this shouldn't be here but it is because the frontend drivers From patchwork Fri Dec 16 10:56:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101396 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1334093qgi; Fri, 16 Dec 2016 02:59:27 -0800 (PST) X-Received: by 10.36.203.2 with SMTP id u2mr2197851itg.47.1481885967723; Fri, 16 Dec 2016 02:59:27 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69si5541315iop.162.2016.12.16.02.59.27; Fri, 16 Dec 2016 02:59:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934302AbcLPK6x (ORCPT + 25 others); Fri, 16 Dec 2016 05:58:53 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:57473 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760751AbcLPK5G (ORCPT ); Fri, 16 Dec 2016 05:57:06 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0MPGgy-1cDSTJ3g6C-004PPZ; Fri, 16 Dec 2016 11:56:50 +0100 From: Arnd Bergmann To: linux-arch@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, Russell King , Andrew Morton , kernel-build-reports@lists.linaro.org, kvmarm@lists.cs.columbia.edu, Arnd Bergmann Subject: [PATCH 09/13] ARM: mark cmpxchg and xchg __always_inline for gcc-4.3 Date: Fri, 16 Dec 2016 11:56:30 +0100 Message-Id: <20161216105634.235457-10-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161216105634.235457-1-arnd@arndb.de> References: <20161216105634.235457-1-arnd@arndb.de> X-Provags-ID: V03:K0:tleukSp46N3kqsbnVUMqr7xF4fk22v8EfBuU9mpZSBHKRF0dMLd nTSCp0b4HFVaaSlkuIn0ITGxB43Y969cEbFEbP08+OGJWFvtv6WATa2+PPSBJRp7YgexbOC FuzA6BokGpI3z/FyNLKr6fiJY5mU06wluA9dIYSGOwR9VWBIqWZNp+wB3qFShTZANIZ1AKI 2SwY7LytdVaG5xNDck0gw== X-UI-Out-Filterresults: notjunk:1; V01:K0:Nzc0IAt8xWw=:HyRCeDJiMwGmY6EMpRP6vU RnrT463rf3IdvNPWxZJhGfgbGGXpwsiGZaNmZeZYds++3eOWj1Bxouk1tlsWJBfYbnfBQKLQv daln9y2AnKvvhSu+FvvJqiHSVjjoenZ3WR75xzhLiFWpMA1ochj3zKr18EcS8mIWZ63rcRQVU 2T8Of4L8EolGyGMQAf/lkkeF4IN84yiCXuDtGU2X80K4yqva2LebFtMp6XyKJKB/BEZaQMtrO Cila1CjX43smsBgR7r81wy3a3LCXGP8LTaZ24Hel0xZsEHz4RRMj3Dbh2F4Fp0cXfcE4Q5ZAF 4wa/E7Y2LgmvBwQ6roxIfsmEWcjdqdHOG4Sku2sB5obUn3uZ8mGIyn7JHyfiVpuYYpOAe+b4F 67CrF2ae5YLzHiINhZWmrgAqQSPMv9aR3gOL2dsS/1QqctoisWgBciq9wbkjONpRNc30NIxfX lHtkMzfTfUaiLH2UnvTzMkQ/d/hGzS+tjNi7wvsAT9S/QLgGxuwo9PjNyz/chhEpe0lOXXphy 6IdDcJPN94+PV7owGCHkurCznVEVtcoyvVrgQC4emUDTJZms5rGfbBduFiug39L+mjvoAWKx1 gQXrYvDZDlT66jHds+oi3YumMzexIu/GKqQTDYLJp7dP88tx6zZnnmfRVX9S02LTTZQdRqsTb 53UFZrnFXZKUiiQXIrOPZJCJWJmtBUe5z00vXfTtaEcqBtijFO0/kPqkq7lPNBwUg0Ww= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With older compiler versions like gcc-4.3 and CONFIG_OPTIMIZE_INLINING, I run into link errors: kernel/task_work.o: In function `__cmpxchg': task_work.c:(.text+0x8c): undefined reference to `__bad_cmpxchg' kernel/kthread.o: In function `__xchg': kthread.c:(.text+0x7bc): undefined reference to `__bad_xchg' This marks the functions in question as __always_inline to force inlining. Signed-off-by: Arnd Bergmann --- arch/arm/include/asm/cmpxchg.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.9.0 diff --git a/arch/arm/include/asm/cmpxchg.h b/arch/arm/include/asm/cmpxchg.h index 12215515ba02..218ba0ae90cd 100644 --- a/arch/arm/include/asm/cmpxchg.h +++ b/arch/arm/include/asm/cmpxchg.h @@ -24,7 +24,8 @@ #define swp_is_buggy #endif -static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size) +static __always_inline unsigned long +__xchg(unsigned long x, volatile void *ptr, int size) { extern void __bad_xchg(volatile void *, int); unsigned long ret; @@ -152,8 +153,8 @@ extern void __bad_cmpxchg(volatile void *ptr, int size); * cmpxchg only support 32-bits operands on ARMv6. */ -static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, - unsigned long new, int size) +static __always_inline unsigned long +__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) { unsigned long oldval, res; @@ -213,9 +214,8 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, sizeof(*(ptr))); \ }) -static inline unsigned long __cmpxchg_local(volatile void *ptr, - unsigned long old, - unsigned long new, int size) +static __always_inline unsigned long +__cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new, int size) { unsigned long ret; From patchwork Fri Dec 16 10:56:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101397 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1334087qgi; Fri, 16 Dec 2016 02:59:27 -0800 (PST) X-Received: by 10.107.31.73 with SMTP id f70mr2375191iof.232.1481885966993; Fri, 16 Dec 2016 02:59:26 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69si5541315iop.162.2016.12.16.02.59.26; Fri, 16 Dec 2016 02:59:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933947AbcLPK6p (ORCPT + 25 others); Fri, 16 Dec 2016 05:58:45 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:63093 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760757AbcLPK5G (ORCPT ); Fri, 16 Dec 2016 05:57:06 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0M5P83-1cXKCz0xnL-00zX8k; Fri, 16 Dec 2016 11:56:50 +0100 From: Arnd Bergmann To: linux-arch@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, Russell King , Andrew Morton , kernel-build-reports@lists.linaro.org, kvmarm@lists.cs.columbia.edu, Arnd Bergmann Subject: [PATCH 10/13] asm-generic: mark cmpxchg as __always_inline for gcc-4.3 Date: Fri, 16 Dec 2016 11:56:31 +0100 Message-Id: <20161216105634.235457-11-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161216105634.235457-1-arnd@arndb.de> References: <20161216105634.235457-1-arnd@arndb.de> X-Provags-ID: V03:K0:0wthnYjJcfwJjt8em8pjW6mWCb+05G1x+UJ4FEpgV4RKl12sKEo CrZbNSTtYEV7+gj17W35EmFLItwUGjyBUH5mmEgyiJMlk/TXwFBEbB1gfV9CYQvG1PImrFv WzHpVOPZBaRA6vHz+H4deSFu0YXqSLprGvQMO5CtAQiSd8KTyScX7KUk6MVJMlMZuRRqie5 FF3NuG2pmtjvRX/U3Vaow== X-UI-Out-Filterresults: notjunk:1; V01:K0:AN3QBy7lSfQ=:O1tqGlVP/hmlMRCacKc0qR cs1WXeKGbPoxzjeeP4mOcA5+1QuBN6nGnbR6LSq8R2Gh3/MwdXF6gL8CGCTsCwXARRD6yu35F uzvnJcVnM4Pob86QKXgQWmOosDpOEuqay8pJzCRCzBnG4kN3kBW9B6vXoWzGpjNVALuShyzhn kKKBJGBFjK/adBL4WnZSPgGF3GFnTsXrla8jymA9jH/P1eOILrhV2WFykQ6TSs5lZNLze3wwa Y7xPDE8HTwNwCMl9zkYrlERb1qn7UNguDMDLim8LY3NzL+hbmPj6+9pq1K/pZ5iqZv7z8lkJP W1u8vnJ2yQhOpWZxLuM08O+oO2kQ/Le8pAysT++CoV2hcRQmvnFnCI3uQZZcGgTNRfSFsclGP VCZdEZnzTClu9e/dec68EckHta3cJBnCd5nKMfJgX0LaLJnFaUATbmqvZjkzijkNqUt0kk27p +THbMGHuRXCYpffHTLcs4FmddpIWfiMZlFU/u/R7cWXJ6QYctCU/mBdHVCsoB9f70Mf1BoQHb 5uwWOTTKl+pR5DasPNT99VQEFRNVtBcqFZ4zi0ahhwDLKBn/pC1tDxh4sGsajR4nAgD1wwCCs VrotN5vUm5OXIIuFhcW2bZJ5LBG9HEj6XiTOpceDBf3g3tG3h7Ck2zI7sx7dTKVd+GdqijVmP 2mp0gAYrKN51u0NWbavL7Xvc94jMpQ2cZls3Syd/j4KulwSWrDIrznR7xkzjljrC1aH0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With CONFIG_OPTIMIZE_INLINING and older compilers, we can get a link error such as kernel/task_work.o: In function `__cmpxchg_local_generic': task_work.c:(.text+0x14c): undefined reference to `wrong_size_cmpxchg' kernel/locking/rtmutex.o: In function `__cmpxchg_local_generic': rtmutex.c:(.text+0x5ec): undefined reference to `wrong_size_cmpxchg' kernel/trace/ring_buffer.o: In function `__cmpxchg_local_generic': Marking the functions in question as __always_inline avoids that possibility. Signed-off-by: Arnd Bergmann --- include/asm-generic/cmpxchg-local.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.9.0 diff --git a/include/asm-generic/cmpxchg-local.h b/include/asm-generic/cmpxchg-local.h index 70bef78912b7..e82d7032b1b8 100644 --- a/include/asm-generic/cmpxchg-local.h +++ b/include/asm-generic/cmpxchg-local.h @@ -11,7 +11,8 @@ extern unsigned long wrong_size_cmpxchg(volatile void *ptr) * Generic version of __cmpxchg_local (disables interrupts). Takes an unsigned * long parameter, supporting various types of architectures. */ -static inline unsigned long __cmpxchg_local_generic(volatile void *ptr, +static __always_inline unsigned long +__cmpxchg_local_generic(volatile void *ptr, unsigned long old, unsigned long new, int size) { unsigned long flags, prev; @@ -50,8 +51,8 @@ static inline unsigned long __cmpxchg_local_generic(volatile void *ptr, /* * Generic version of __cmpxchg64_local. Takes an u64 parameter. */ -static inline u64 __cmpxchg64_local_generic(volatile void *ptr, - u64 old, u64 new) +static __always_inline u64 +__cmpxchg64_local_generic(volatile void *ptr, u64 old, u64 new) { u64 prev; unsigned long flags; From patchwork Fri Dec 16 10:56:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101398 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1333800qgi; Fri, 16 Dec 2016 02:58:44 -0800 (PST) X-Received: by 10.84.132.35 with SMTP id 32mr5522467ple.44.1481885924782; Fri, 16 Dec 2016 02:58:44 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s5si7237634pgh.255.2016.12.16.02.58.44; Fri, 16 Dec 2016 02:58:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761338AbcLPK6b (ORCPT + 25 others); Fri, 16 Dec 2016 05:58:31 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:55252 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760762AbcLPK5G (ORCPT ); Fri, 16 Dec 2016 05:57:06 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0LxwDU-1cemz02Ohw-015Lkn; Fri, 16 Dec 2016 11:56:50 +0100 From: Arnd Bergmann To: linux-arch@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, Russell King , Andrew Morton , kernel-build-reports@lists.linaro.org, kvmarm@lists.cs.columbia.edu, Arnd Bergmann Subject: [PATCH 11/13] fs: fix unsigned enum warning with gcc-4.2 Date: Fri, 16 Dec 2016 11:56:32 +0100 Message-Id: <20161216105634.235457-12-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161216105634.235457-1-arnd@arndb.de> References: <20161216105634.235457-1-arnd@arndb.de> X-Provags-ID: V03:K0:1m16QfRKJmBLeVut8GQglfWvJ4vCfcjRq1W0ueAdlzeYE2jmQ+b C2kdCgH2936u44ccrF0pgag0qnBvJAXmzon5/crP/gQclYGPPaL97ng0Cju5RIeNoWBLmJU o47r8RwHNEZfZX3Dn5gVpbD5Z32Zf54TUOPYlWD8tQJrAUIr7KYgilZBVjqjlVmZn5NOcpD U8PFBvYck5qy/ZwVlj+ag== X-UI-Out-Filterresults: notjunk:1; V01:K0:9uKt/+l9ozw=:J/0u/yi1+xfvVIzlT+r0P8 FaNz1pRboV7/+LMq9bFQdGL+MDaBWeywzwJZyyDeNrB1BpPL1aoJfLi8HNk0bEjmeP/s8oT4L 753lNWirAD2qudwGc7PgtdlooZWin73v9EcrG+X1WtKtqL0Ns9OwiLSk3Jky5b4ZrqXrTdqTp 9j8x6DnYsv3nDQuVPJHW/biDGF+f6fLY0lBfqEo+4JPm7UsuvSZZC5y4PIHGH/LA4WAki3pOe 55ofB9fPUVT4O9UWDOHqGGfe3J659oy+wMI2xB7hOeb0OPna0+pUboJhV0TMs66Qq/89lBam1 4CcnSpzsF1tHdARX6mSBUvTGp/CNxt/8TAbj3r0VIu2cQxSkKS93jitbsxkpyTLCePxSljq5Q 8qSQC5tGywmXsph84XlubC1ksCa/7iehW5ms22qUIAB+M+plKkJfgiNhlBCKJmK8H7O3LJ2Fj tpRKXGfGerWa4TWca2Vy8FbYHOn0VP21b/8Isk7BziRvSVN2jHK2DjgUiQkpBLYI70E0VjIbi 2HIH09Tx/j/flD1HZuNnAsC8TrBcgc8CcWmPwjKl7K7nXUPQbtE0LnDdxzIAtsmmFBadlXd5G mRV99ScHA29l1kvP5A/O4Z7NLt/OcyfC5pnDIbLNHBzV2Tksbs2y02PPDFsw0EceOPhiXRVXK GBgcOTVaKLiWS4qBdABRxyRw6OrqjgXhc4X+Fwm42i6M0q10WpaFQ6YDGuaGnKkAvds8= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With arm-linux-gcc-4.2, almost every file we build in the kernel ends up with this warning: include/linux/fs.h:2648: warning: comparison of unsigned expression < 0 is always false Later versions don't have this problem, but it's easy enough to work around. Signed-off-by: Arnd Bergmann --- include/linux/fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/include/linux/fs.h b/include/linux/fs.h index 398cf20a706d..782c2a292fd7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2645,7 +2645,7 @@ static const char * const kernel_read_file_str[] = { static inline const char *kernel_read_file_id_str(enum kernel_read_file_id id) { - if (id < 0 || id >= READING_MAX_ID) + if ((unsigned)id >= READING_MAX_ID) return kernel_read_file_str[READING_UNKNOWN]; return kernel_read_file_str[id]; From patchwork Fri Dec 16 10:56:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101399 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1333793qgi; Fri, 16 Dec 2016 02:58:44 -0800 (PST) X-Received: by 10.84.174.129 with SMTP id r1mr5641808plb.19.1481885924029; Fri, 16 Dec 2016 02:58:44 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s5si7237634pgh.255.2016.12.16.02.58.43; Fri, 16 Dec 2016 02:58:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761278AbcLPK6X (ORCPT + 25 others); Fri, 16 Dec 2016 05:58:23 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:55340 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760765AbcLPK5G (ORCPT ); Fri, 16 Dec 2016 05:57:06 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0M7az9-1cV8Ld41ax-00xLHO; Fri, 16 Dec 2016 11:56:51 +0100 From: Arnd Bergmann To: linux-arch@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, Russell King , Andrew Morton , kernel-build-reports@lists.linaro.org, kvmarm@lists.cs.columbia.edu, Arnd Bergmann Subject: [PATCH 12/13] KVM: arm: avoid binary number literals for gcc-4.2 Date: Fri, 16 Dec 2016 11:56:33 +0100 Message-Id: <20161216105634.235457-13-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161216105634.235457-1-arnd@arndb.de> References: <20161216105634.235457-1-arnd@arndb.de> X-Provags-ID: V03:K0:4IxGduhOqB6XjZRZdXj+cuX90DpwIk9iqclSsMk96W+BO+7ZEu7 +CqLJK16S4jTFItVCCpOQtpa1zvDt9f7W/Uan16smhpSvg2HmjuKBkJxSeytT+j0PL1JQFM d3WbS4TWCdwxFa8WeH2QProrFOu7Hm3za6i2xNArKMstK8UxAbDwofyyR0PLqo7vSuci8F2 DmDrg5Pd1+lOxVjMphOLg== X-UI-Out-Filterresults: notjunk:1; V01:K0:jrtifOEhEok=:zgBt5ixz/ueXrLmGOFq9Je L7qTXZ8CXoXaSXGm+PPlBA3JNA8NfU0qcsM1ov9IqT0ICj/HxWowegRYIpcyVTTqDM+qJMafl 0BHJN1gq+KwiDzGBMX7+ZRvaNp6zvc+iQhe+rVv7n/RBi1GfM6dqy/fMn3Qjp9IRFMUMxd+rO FDniCcMQq/gMZ0koXanYtJl8XSy9dSF9R8H7U80TvzQMngTtu8RKN1lmAz4GcZjruV36DmyAu JADWHke9rG/g4KVmH+C/xJSA2KevSvZMCJ7PdIPKv0QsXjqKzE0CUqdeJA6bRMyxqtwPysjj6 OAeTpoJRYo7Uv7rKVF6R+bAf5yAYDjgwPznf0O0WU/n9SQACOYVWCG9n2C36160S/DNdM9z5R bNYvZj7RzBJXnECfUYHj7V8Zdf1WORT/a4Ui+8fL9GjRcJQy0odBQOIWvDOvb8BoqDq38cfR/ 0X2yFdsFer7jRppSUYlh1zVx3yqvs3u4TDFfwILDPWVRmOQTRBA4oDoY/vB1gCaAnwsmbB+CW C2Z4e71EBnhFoTO500TyTnGL27mLiaH3ODCPi+kSC94QA9TJnCRfV543woKWy85tfS5GC9SxI EU4U/8GwL8XYvZbc715+2QJX8HyBwrqd7zlbjQrKkNcRCicnAF+xdt5He1qDAHi/S2qQXfgcE cCAlyZrh7+9j+mPPiVKFX7x0AAfI7fN4JyDLYf6hd+p401yv/2UyT13wpkT4M1nadorc= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Old gcc versions prior to 4.3 don't understand the 0b... syntax for numbers, and this seems to be the only instance in the kernel, so better use hexadecimal instead. arch/arm/include/asm/kvm_mmu.h:127:38: error: invalid suffix "b101" on integer constant Fixes: 159793001d7d ("ARM: KVM: force cache clean on page fault when caches are off") Signed-off-by: Arnd Bergmann --- arch/arm/include/asm/kvm_mmu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h index 74a44727f8e1..61121300174f 100644 --- a/arch/arm/include/asm/kvm_mmu.h +++ b/arch/arm/include/asm/kvm_mmu.h @@ -124,7 +124,7 @@ struct kvm; static inline bool vcpu_has_cache_enabled(struct kvm_vcpu *vcpu) { - return (vcpu_cp15(vcpu, c1_SCTLR) & 0b101) == 0b101; + return (vcpu_cp15(vcpu, c1_SCTLR) & 0x5) == 0x5; } static inline void __coherent_cache_guest_page(struct kvm_vcpu *vcpu, From patchwork Fri Dec 16 10:56:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101400 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1333650qgi; Fri, 16 Dec 2016 02:58:19 -0800 (PST) X-Received: by 10.98.0.143 with SMTP id 137mr2417750pfa.183.1481885899531; Fri, 16 Dec 2016 02:58:19 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 34si7280124pln.78.2016.12.16.02.58.18; Fri, 16 Dec 2016 02:58:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761194AbcLPK6N (ORCPT + 25 others); Fri, 16 Dec 2016 05:58:13 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:64880 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760770AbcLPK5G (ORCPT ); Fri, 16 Dec 2016 05:57:06 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0MBSfG-1cRENZ1VRe-00AW4R; Fri, 16 Dec 2016 11:56:51 +0100 From: Arnd Bergmann To: linux-arch@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, Russell King , Andrew Morton , kernel-build-reports@lists.linaro.org, kvmarm@lists.cs.columbia.edu, Arnd Bergmann Subject: [PATCH 13/13] ARM: avoid 'Q' asm constraint for gcc-4.1 and earlier Date: Fri, 16 Dec 2016 11:56:34 +0100 Message-Id: <20161216105634.235457-14-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161216105634.235457-1-arnd@arndb.de> References: <20161216105634.235457-1-arnd@arndb.de> X-Provags-ID: V03:K0:Xse5Cos1IL8GPmA5+TD39QpTBn85andwQI7lBvdxgY+bbxcvPyQ WR8T+0cHO9yKafMr3MxoyIizQBwJCKQLuxoZ/IJTDZ8BlZkZVLT9uPaTmiROk2dMZhS2iXT iro7lHvsHol2xVkxocIxs1xLOtHw+X1Vp/s7Z2I3uE+HdU8o6J0fy9/EeHAia3jlhoLYya4 bVS75fgu4h+Z7haTyhEDQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:/F+IqrFNW2U=:DXBh+mGowddr+XFI91XFoK TAcqosMJKRX23MiKsDqZk/KFzCh+wXUs4quLQnguYjItJgjz8nKbaqlH57joDzBDgr0lZ7R+l ELigEurYpjDAVTUtNFEhRV8m7sH4pI7M6bRZJZHwuAXHdosUhqxFf/7B2lBktu25T6Mo350WU Bn2TmsKtIuKW4uAJJXFCXjq+6JX1XlXEn5UAOcTWj/JZbRPYhty+L3A10V2vfsYrSBkQ5LE5o K30I+mJP2SbV3+Wq6HiHhMEpoZ8UvWCnBt77LawC8/tKLGKCu08JDTEHzPkSK7Vd34LfNHERf +dELaStNKHbemJFQdCBmOLWHzfeq4w75Yga6pxa4IKaFB5uCSWDAgbkqmLLEXyqUYdywWI8Yv K7hIAPehoNBflvsaeVogA1/HBBVg8N/PZImJwTb39yeItqavBiBAe1Kj/SrhDRpHjp85cXv4n FFrWj8/XNH6WepUgogQ3LQw1p3Bticts4W801dzeQsOwOlmoAW0Bp6Yje4M8Scg8bQVsCjaJK r27fCzocfwHWaTlPDX9H1Du65enqbyFhjNhPFD38PxpKuCnr6BNCizXPW8TB1U8FUOoiJarWY n1/8WBoeQ/l6+LHpwzhYG9jd8ZEIfqMwpnyE500tlriGuD3+6yvJldslU83MNWjOqdhMZ0lvu 4kyXvQS3BVZ4XaTJGU+xJf+yZty4O0pYFSqR6FuWaoTCtBVftnSpEIOxLymD73If1LtM= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Building with ancient gcc versions results in a stream of build errors like: arch/arm/include/asm/io.h:100: error: impossible constraint in 'asm' arch/arm/include/asm/io.h:118: error: impossible constraint in 'asm' This reverts to an older version of __raw_readl, __raw_writel and __my_cpu_offset, which seem to be the only functions affected by this. Signed-off-by: Arnd Bergmann --- arch/arm/include/asm/io.h | 8 ++++++++ arch/arm/include/asm/percpu.h | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) -- 2.9.0 diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 6f89a4d9fc85..d0f89c4cb8e2 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -97,8 +97,12 @@ static inline void __raw_writeb(u8 val, volatile void __iomem *addr) #define __raw_writel __raw_writel static inline void __raw_writel(u32 val, volatile void __iomem *addr) { +#if GCC_VERSION < 40200 + *(volatile u32 __force *)addr = val; +#else asm volatile("str %1, %0" : : "Qo" (*(volatile u32 __force *)addr), "r" (val)); +#endif } #define __raw_readb __raw_readb @@ -115,9 +119,13 @@ static inline u8 __raw_readb(const volatile void __iomem *addr) static inline u32 __raw_readl(const volatile void __iomem *addr) { u32 val; +#if GCC_VERSION < 40200 + val = *(volatile u32 __force *)addr; +#else asm volatile("ldr %0, %1" : "=r" (val) : "Qo" (*(volatile u32 __force *)addr)); +#endif return val; } diff --git a/arch/arm/include/asm/percpu.h b/arch/arm/include/asm/percpu.h index a89b4076cde4..dee4c89b4458 100644 --- a/arch/arm/include/asm/percpu.h +++ b/arch/arm/include/asm/percpu.h @@ -36,9 +36,12 @@ static inline unsigned long __my_cpu_offset(void) * We want to allow caching the value, so avoid using volatile and * instead use a fake stack read to hazard against barrier(). */ +#if GCC_VERSION < 40200 + asm("mrc p15, 0, %0, c13, c0, 4" : "=r" (off) : : "memory"); +#else asm("mrc p15, 0, %0, c13, c0, 4" : "=r" (off) : "Q" (*(const unsigned long *)current_stack_pointer)); - +#endif return off; } #define __my_cpu_offset __my_cpu_offset()