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

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

To: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 4/5] xen/blkback: don't add m2p overrides when using autotranslated physmap
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Wed, 19 Oct 2011 10:10:43 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 19 Oct 2011 02:11:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1318969583-23902-5-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>
Organization: Citrix Systems, Inc.
References: <1318969583-23902-1-git-send-email-dgdegra@xxxxxxxxxxxxx> <1318969583-23902-5-git-send-email-dgdegra@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, 2011-10-18 at 21:26 +0100, Daniel De Graaf wrote:
> This is the same logic as used in grant-table.c, which blkback bypasses.

It would be better to make blkback use grant-table.c.

Ian.

> 
> 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;
>  }



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel