From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6488FA32A8 for ; Sat, 26 Oct 2019 17:31:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A0FA61BF7D; Sat, 26 Oct 2019 17:31:48 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 396B61BEEE for ; Sat, 26 Oct 2019 17:31:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572103905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jeWy+XcMoX1PB9ZX4/Y/jcSsPXctsaVZ+wU7ClEcET4=; b=cqVuILdgEiLBYTysYMQl2q1zGhh53ELlAQd/CgjQ59y+y/MAEKFcSuwYpGHnpcQxnEN+6n vaCez8XK7m+vTqWIfczXC3GX6mWshs2fDIZM9an4vJAzr9lG/A3it8Cw1EkXEaImznz3VG OLmOoENlR77PApEA3r/Ex3t+XYQRGto= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-292-tXCjfbo6MjmyJ2dV2gRLmg-1; Sat, 26 Oct 2019 11:31:42 -0400 Received: by mail-vk1-f200.google.com with SMTP id a188so1883128vkc.7 for ; Sat, 26 Oct 2019 08:31:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oC4n6pRKLS1Aw2ZzVMWXIF3E31kU9jOfHB8Y6NVeOHM=; b=YtcMabPooXCueJGdYSIgw/vnHKDONQhgWIhKZ++OjvysqmCj9Uf4sSZcg4E/o1UcD1 sCOW0iPGMU2GN8O20rTHJu7UrrpiXM+KQtUXz+ThLAxVrV+D5DVoZ0yfDYny2L+cQvLR 959+20NDFPrEUTwVrh1rAFzGvohHWvMhhEe5xplbhBckcydl3utX902sv8bWHJeACvQz kvp7ZK5EWNOVxpiW8yrqPchknIgcNmgYhgvDab8xLbgjy6bDnAq92NPbG6moT4J1S7+m DxdMsBUUDlpmwkrVW37Y9KhJU1LhfdpBiIvVqFn01KYXNaWHT3jy16LPzxZ+LVzbtag3 iv1g== X-Gm-Message-State: APjAAAXXHTG86xmqM36+NPSexuRiMQyTzMWjhReqEC/RiDjOEq1327Y+ 1NodU4mOROXTnnUXQxqy8Oe+6MZt4EkbnJn1P21kTTOvXiB6X+2fwDAberIHXKZStuhYFAK7Y6D ny/mrZwRrY9Mrx/kIngU= X-Received: by 2002:ab0:189a:: with SMTP id t26mr4534171uag.87.1572103901725; Sat, 26 Oct 2019 08:31:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWYERljP47CSoNU0JJtkUGuBcb58yP7Z/ZTIYAOefJJZon+rPwCab7A4Dri8w7Zv6gATfD6Q6YFXJdHpo2wY0= X-Received: by 2002:ab0:189a:: with SMTP id t26mr4534150uag.87.1572103901391; Sat, 26 Oct 2019 08:31:41 -0700 (PDT) MIME-Version: 1.0 References: <20191024121046.30244-1-mk@semihalf.com> <96426c4b-8c2b-b825-dd0a-515497dbcb91@intel.com> In-Reply-To: <96426c4b-8c2b-b825-dd0a-515497dbcb91@intel.com> From: David Marchand Date: Sat, 26 Oct 2019 17:31:30 +0200 Message-ID: To: Michal Krawczyk Cc: dev , igorch@amazon.com, Guy Tzalik , rahul.lakkireddy@chelsio.com, dpdk stable , "Burakov, Anatoly" X-MC-Unique: tXCjfbo6MjmyJ2dV2gRLmg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] vfio: fix BAR offset type for 32-bit app X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Oct 25, 2019 at 5:41 PM Burakov, Anatoly wrote: > > On 24-Oct-19 1:10 PM, Michal Krawczyk wrote: > > When 32-bit application is built on 64-bit system it is possible that > > the offset of the resource is outside of the 32-bit value. > > > > The problem with the unsigned long is, that it is 32-bit and not 64-bit > > when using armhf compiler. Although the system is returning u64 value, > > we are losing it's value if it's higher than 32-bit in the conversion > > process. It can further cause mmap to fail due to offset being 0 or to > > map not intended memory region. > > > > To make it more portable, the uint64_t value is now being used for > > storing offset instead of unsigned long. The size of being 32-bit seems > > to be fine as the 32-bit application won't be able to access bigger > > memory and it is further converted to size_t anyway. But for better > > readability and to be consistent, it's type was changed to size_t as > > well. > > > > Fixes: 0205f873557c ("vfio: fix overflow of BAR region offset and size"= ) > > Cc: stable@dpdk.org > > > > Signed-off-by: Michal Krawczyk > > --- > > Acked-by: Anatoly Burakov Applied, thanks. --=20 David Marchand