From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 3A8201B7BB; Fri, 9 Feb 2018 02:54:27 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Feb 2018 17:54:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,481,1511856000"; d="scan'208";a="26013351" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by FMSMGA003.fm.intel.com with ESMTP; 08 Feb 2018 17:54:26 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 8 Feb 2018 17:54:26 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.253]) with mapi id 14.03.0319.002; Fri, 9 Feb 2018 09:54:24 +0800 From: "Tan, Jianfeng" To: "Kulasek, TomaszX" , "yliu@fridaylinux.org" CC: "dev@dpdk.org" , "yuanhan.liu@linux.intel.com" , "stable@dpdk.org" , "Wodkowski, PawelX" Thread-Topic: [dpdk-dev] [PATCH] vhost: fix offset while mmaping log base address Thread-Index: AQHToP6QtxqCIC35vEeO7k0cveWIqKObT6yw Date: Fri, 9 Feb 2018 01:54:23 +0000 Message-ID: References: <20180208165938.44860-1-tomaszx.kulasek@intel.com> In-Reply-To: <20180208165938.44860-1-tomaszx.kulasek@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] vhost: fix offset while mmaping log base address 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: , X-List-Received-Date: Fri, 09 Feb 2018 01:54:28 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Tomasz Kulasek > Sent: Friday, February 9, 2018 1:00 AM > To: yliu@fridaylinux.org > Cc: dev@dpdk.org; yuanhan.liu@linux.intel.com; stable@dpdk.org; > Wodkowski, PawelX > Subject: [dpdk-dev] [PATCH] vhost: fix offset while mmaping log base > address >=20 > QEMU always set offset to 0 but for sanity we should take the offset > into account. >=20 > Fixes: 54f9e32305d4 ("vhost: handle dirty pages logging request") > Cc: yuanhan.liu@linux.intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Pawel Wodkowski > Signed-off-by: Tomasz Kulasek Reviewed-by: Jianfeng Tan Thanks! > --- > lib/librte_vhost/vhost_user.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.= c > index 65ee33919..674f2ffe8 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -991,7 +991,7 @@ vhost_user_set_log_base(struct virtio_net *dev, > struct VhostUserMsg *msg) > * mmap from 0 to workaround a hugepage mmap bug: mmap will > * fail when offset is not page size aligned. > */ > - addr =3D mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, > 0); > + addr =3D mmap(0, size + off, PROT_READ | PROT_WRITE, > MAP_SHARED, fd, 0); > close(fd); > if (addr =3D=3D MAP_FAILED) { > RTE_LOG(ERR, VHOST_CONFIG, "mmap log base failed!\n"); > -- > 2.14.1