[dpdk-stable] patch 'vhost: fix guest/host physical address mapping' has been queued to stable release 16.11.1

Yuanhan Liu yuanhan.liu at linux.intel.com
Mon Jan 23 08:47:47 CET 2017


Hi,

FYI, your patch has been queued to stable release 16.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
yet. It will be pushed if I get no objections before 01/28/17.
So please shout if anyone has objections.

---

Note 16.11 is a LTS release. v16.11.1 is planned to be released
shortly (about 2-3 weeks) after v17.02.

---

Thanks.

	--yliu

---
>From aa86b1608f9cda8aabc66a14a1c9a9c9a437c1c9 Mon Sep 17 00:00:00 2001
From: Haifeng Lin <haifeng.lin at huawei.com>
Date: Thu, 1 Dec 2016 19:42:02 +0800
Subject: [PATCH] vhost: fix guest/host physical address mapping

[ upstream commit 8c33fc10f65d250cf84d9dcf2766dabd605a37b2 ]

When reg_size < page_size the function read in
rte_mem_virt2phy would not return, because
host_user_addr is invalid.

Fixes: e246896178e6 ("vhost: get guest/host physical address mappings")

Signed-off-by: Haifeng Lin <haifeng.lin at huawei.com>
Acked-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
---
 lib/librte_vhost/vhost_user.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 6b83c15..50cb6d1 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -447,14 +447,14 @@ add_guest_pages(struct virtio_net *dev, struct virtio_memory_region *reg,
 	reg_size -= size;
 
 	while (reg_size > 0) {
+		size = RTE_MIN(reg_size, page_size);
 		host_phys_addr = rte_mem_virt2phy((void *)(uintptr_t)
 						  host_user_addr);
-		add_one_guest_page(dev, guest_phys_addr, host_phys_addr,
-				   page_size);
+		add_one_guest_page(dev, guest_phys_addr, host_phys_addr, size);
 
-		host_user_addr  += page_size;
-		guest_phys_addr += page_size;
-		reg_size -= page_size;
+		host_user_addr  += size;
+		guest_phys_addr += size;
+		reg_size -= size;
 	}
 }
 
-- 
1.9.0



More information about the stable mailing list