From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47])
 by dpdk.org (Postfix) with ESMTP id 786BFC38A
 for <dev@dpdk.org>; Tue, 14 Jul 2015 10:57:48 +0200 (CEST)
Received: by wgxm20 with SMTP id m20so3115137wgx.3
 for <dev@dpdk.org>; Tue, 14 Jul 2015 01:57:48 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:organization
 :user-agent:in-reply-to:references:mime-version
 :content-transfer-encoding:content-type;
 bh=y+VCNZU4K3sH5SzogVJAFBbqgX0+f/qDMhliNKOmUeU=;
 b=JTyORn5/tCTOG3cBmpStJDYdVBjvD+7Y/Er9pkppT6uqHQ8qdUPFo0yal8q0ZvCa8B
 HgouYo2y0R744RuN5uP6gtfkQKouiAbOroUl+yf3jfhgN23pzAJQKPTzTE6fpOkVbIs/
 YMD8R/WQAbDz1WEv3CMcccmosj6o+7Y1gzS7s2nXmW+rHI35P6k0NxIwrCSTr3LSfhsP
 LiolSnauEbVU9u2dIqhpedzYLFC/Z4ZXO6fgkTXO7BcZ5/6hOvwyvpu5SQctStYcgcgs
 ZlrKe7RIgvlODHSRuyiBy4m5Qzkyj+8cCLDkVV3gHUYz2sakdAamfcKyMQbogNwiIOz2
 /OYQ==
X-Gm-Message-State: ALoCoQmO+88lUu9N67jBePW+wzhxsavTV66XEXrrGdwM9k60hbo52Wawy58dk3oXVqU1SOf6OqlA
X-Received: by 10.194.235.227 with SMTP id up3mr81208394wjc.132.1436864268340; 
 Tue, 14 Jul 2015 01:57:48 -0700 (PDT)
Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136])
 by smtp.gmail.com with ESMTPSA id l6sm19482951wib.18.2015.07.14.01.57.46
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 14 Jul 2015 01:57:47 -0700 (PDT)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Date: Tue, 14 Jul 2015 10:56:35 +0200
Message-ID: <2812850.KVDAfLqkr9@xps13>
Organization: 6WIND
User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; )
In-Reply-To: <b5f3fef8563eab3e0120dfdf3b7a5026a7654b84.1436773804.git.rahul.lakkireddy@chelsio.com>
References: <2eeeff646a329cca169033f541de3e96cec3a27a.1435067129.git.rahul.lakkireddy@chelsio.com>
 <b5f3fef8563eab3e0120dfdf3b7a5026a7654b84.1436773804.git.rahul.lakkireddy@chelsio.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Cc: dev@dpdk.org, Felix Marti <felix@chelsio.com>,
 Nirranjan Kirubaharan <nirranjan@chelsio.com>,
 Kumar Sanghvi <kumaras@chelsio.com>
Subject: Re: [dpdk-dev] [PATCH v3] vfio: Fix overflow while assigning vfio
	BAR region offset and size
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Jul 2015 08:57:48 -0000

2015-07-13 14:21, Rahul Lakkireddy:
> When using vfio, the probe fails for BAR > 0 after the
> 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.
> 
> The fix is to use unsigned long for the offset and size.
> 
> This is based on patch by Alejandro Lucero <alejandro.lucero@netronome.com>
> posted at below:
> 
> http://dpdk.org/ml/archives/dev/2015-June/020201.html
> 
> and updated with diff from below to fix 32-bit compilation:
> 
> http://dpdk.org/ml/archives/dev/2015-July/020963.html
> 
> Fixes: 90a1633b2347 ("eal/linux: allow to map BARs with MSI-X tables")
> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
> Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>

Applied, thanks