This is the same logic as used in grant-table.c, which blkback bypasses.
Signed-off-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
---
drivers/block/xen-blkback/blkback.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/block/xen-blkback/blkback.c
b/drivers/block/xen-blkback/blkback.c
index a0d3cbd..d8232e7 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -336,6 +336,10 @@ static void xen_blkbk_unmap(struct pending_req *req)
ret = HYPERVISOR_grant_table_op(
GNTTABOP_unmap_grant_ref, unmap, invcount);
BUG_ON(ret);
+
+ if (xen_feature(XENFEAT_auto_translated_physmap))
+ return;
+
/*
* Note, we use invcount, so nr->pages, so we can't index
* using vaddr(req, i).
@@ -396,6 +400,12 @@ static int xen_blkbk_map(struct blkif_request *req,
if (ret)
continue;
+ seg[i].buf = map[i].dev_bus_addr |
+ (req->u.rw.seg[i].first_sect << 9);
+
+ if (xen_feature(XENFEAT_auto_translated_physmap))
+ continue;
+
ret = m2p_add_override(PFN_DOWN(map[i].dev_bus_addr),
blkbk->pending_page(pending_req, i), false);
if (ret) {
@@ -404,9 +414,6 @@ static int xen_blkbk_map(struct blkif_request *req,
/* We could switch over to GNTTABOP_copy */
continue;
}
-
- seg[i].buf = map[i].dev_bus_addr |
- (req->u.rw.seg[i].first_sect << 9);
}
return ret;
}
--
1.7.6.4
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|