WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 4/5] xen/blkback: don't add m2p overrides when using

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 4/5] xen/blkback: don't add m2p overrides when using autotranslated physmap
From: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
Date: Tue, 18 Oct 2011 16:26:22 -0400
Cc: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
Delivery-date: Tue, 18 Oct 2011 14:14:21 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1318969583-23902-1-git-send-email-dgdegra@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1318969583-23902-1-git-send-email-dgdegra@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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