From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rahul Lakkireddy Subject: Re: [PATCH v2] vfio: Fix overflow while assigning vfio BAR region offset and size Date: Tue, 7 Jul 2015 16:10:38 +0530 Message-ID: <20150707104036.GA20819@scalar.blr.asicdesigners.com> References: <61d1c9174f7f9159d4005dd2cea16c7719cec964.1434462470.git.rahul.lakkireddy@chelsio.com> <2eeeff646a329cca169033f541de3e96cec3a27a.1435067129.git.rahul.lakkireddy@chelsio.com> <4201419.gIoUKGuTjB@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: dev , Felix Marti , Nirranjan Kirubaharan , Kumar Sanghvi To: "Burakov, Anatoly" Return-path: Received: from stargate3.asicdesigners.com (stargate.chelsio.com [67.207.112.58]) by dpdk.org (Postfix) with ESMTP id 840E2FFA for ; Tue, 7 Jul 2015 12:40:49 +0200 (CEST) Content-Disposition: inline In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Anatoly, On Tue, Jul 07, 2015 at 09:08:08 +0000, Burakov, Anatoly wrote: > Hi all, >=20 > > So, as VFIO support for 32bit systems is broken, DPDK should not conf= igure VFIO in that case. >=20 > ...Or no one should try and run VFIO on a 32-bit system, which should b= e noted in documentation. I'm a bit wary of adding special handling in th= is case. >=20 > Does making the offset off_t fix the compile issues for 32 bit kernel? >=20 Making offset off_t seems to fail for x86_x32-native-linuxapp-gcc target = with the following error in 64-bit gcc, but is working fine with i686 and x86_64 targets: /home/ubuntu/dpdk/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c: In function= =E2=80=98pci_vfio_map_resource=E2=80=99: /home/ubuntu/dpdk/x86_x32-native-linuxapp-gcc/include/rte_common.h:90:30:= error: cast to pointer from integer of different size [-Werror=3Dint-to-= pointer-cast] #define RTE_PTR_ADD(ptr, x) ((void*)((uintptr_t)(ptr) + (x))) ^ /home/ubuntu/dpdk/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c:816:25: note= : in expansion of macro =E2=80=98RTE_PTR_ADD=E2=80=99 void *second_addr =3D RTE_PTR_ADD(bar_addr, memreg[1].offset); ^ cc1: all warnings being treated as errors make[7]: *** [eal_pci_vfio.o] Error 1 make[6]: *** [eal] Error 2 make[5]: *** [linuxapp] Error 2 make[4]: *** [librte_eal] Error 2 make[3]: *** [lib] Error 2 make[2]: *** [all] Error 2 make[1]: *** [x86_x32-native-linuxapp-gcc_install] Error 2 make: *** [install] Error 2 However, unsigned long seems to be working fine for all builds. Thanks, Rahul