From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] vfio: Fix overflow while assigning vfio BAR region offset and size Date: Tue, 30 Jun 2015 23:12:52 +0200 Message-ID: <4201419.gIoUKGuTjB@xps13> References: <61d1c9174f7f9159d4005dd2cea16c7719cec964.1434462470.git.rahul.lakkireddy@chelsio.com> <2eeeff646a329cca169033f541de3e96cec3a27a.1435067129.git.rahul.lakkireddy@chelsio.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Nirranjan Kirubaharan , Felix Marti , Kumar Sanghvi To: anatoly.burakov@intel.com Return-path: Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id C184EC394 for ; Tue, 30 Jun 2015 23:14:01 +0200 (CEST) Received: by wgqq4 with SMTP id q4so20267412wgq.1 for ; Tue, 30 Jun 2015 14:14:01 -0700 (PDT) In-Reply-To: <2eeeff646a329cca169033f541de3e96cec3a27a.1435067129.git.rahul.lakkireddy@chelsio.com> 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, Please could you review this fix to allow Chelsio using VFIO? Thanks 2015-06-23 20:30, Rahul Lakkireddy: > When using vfio, the probe fails over Chelsio T5 adapters after > commit-id 90a1633b2 (eal/linux: allow to map BARs with MSI-X tables). > > While debugging further, found that the BAR region offset and size read from > vfio are u64, but are assigned to uint32_t variables. This results in the u64 > value getting truncated to 0 and passing wrong offset and size to mmap for > subsequent BAR regions (i.e. trying to overwrite previously allocated BAR 0 > region). > > The fix is to use these region offset and size directly rather than assigning > to uint32_t variables. > > Fixes: 90a1633b2347 ("eal/linux: allow to map BARs with MSI-X tables") > Signed-off-by: Rahul Lakkireddy > Signed-off-by: Kumar Sanghvi