From mboxrd@z Thu Jan 1 00:00:00 1970 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) 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=N3a98T/dgm0VEGgW1MuMv3/rag1awTMHa1S1j/PetyY=; b=ORTCZQ/a+YIBlSL+uC6NN1rXX/U0Q4kBX96YZm5xHqIzLPsPiDS8RV95hKyHBGhm9Q nVRj6Gmtm186Hk8eiUFctoTs0xHZUee90Kn8AiO/i8Yv5wTpCf1DqXT7vxc1FZHFg7Ph wQeZXjSoFNUbgg3R2kUrJ5jUFC2Sncy32FKEJUumscw7JD4HxctZj5aN/bW2XzqFdAtp 6ULd/DkT46fs46DTSFtdulU43tJo4JaNJ6CbxFXOl3NEkyxJmPXLVBUdjdtrfNfjKPFg k4VF5jMclrFZFn2ZfbCTwGAPd/fkwhoQiccLbaBHkbAp5xABK4IfTEwoWH0Yptd98uPD 2XTA== X-Gm-Message-State: ALoCoQlgBBJcHCLlbUo7g+cv8k7aMfWbPDExeswhuzH2Yv4k0pJesXOC5NiiIOJJsMI4tSisvKul X-Received: by 10.194.185.8 with SMTP id ey8mr42841823wjc.118.1435698841335; Tue, 30 Jun 2015 14:14:01 -0700 (PDT) Received: from xps13.localnet (guy78-1-82-235-116-147.fbx.proxad.net. [82.235.116.147]) by mx.google.com with ESMTPSA id nb9sm180137wic.10.2015.06.30.14.13.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jun 2015 14:14:00 -0700 (PDT) From: Thomas Monjalon To: anatoly.burakov@intel.com Date: Tue, 30 Jun 2015 23:12:52 +0200 Message-ID: <4201419.gIoUKGuTjB@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <2eeeff646a329cca169033f541de3e96cec3a27a.1435067129.git.rahul.lakkireddy@chelsio.com> References: <61d1c9174f7f9159d4005dd2cea16c7719cec964.1434462470.git.rahul.lakkireddy@chelsio.com> <2eeeff646a329cca169033f541de3e96cec3a27a.1435067129.git.rahul.lakkireddy@chelsio.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org, Nirranjan Kirubaharan , Felix Marti , Kumar Sanghvi Subject: Re: [dpdk-dev] [PATCH v2] 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 21:14:02 -0000 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