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: 9477763 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 22FAB601C2 for ; Fri, 16 Dec 2016 11:00:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10DD7287EC for ; Fri, 16 Dec 2016 11:00:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 059C3287EF; Fri, 16 Dec 2016 11:00:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AD0D287EC for ; Fri, 16 Dec 2016 11:00:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761206AbcLPK6P (ORCPT ); Fri, 16 Dec 2016 05:58:15 -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-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Alex Williamson --- drivers/vfio/pci/vfio_pci_rdwr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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);