All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
	David Vrabel <david.vrabel@citrix.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH] xen-blkback: only attach blkback if the required features are met
Date: Fri, 4 Apr 2014 12:58:51 -0400	[thread overview]
Message-ID: <20140404165851.GS19478@phenom.dumpdata.com> (raw)
In-Reply-To: <1396622471-13114-1-git-send-email-roger.pau@citrix.com>

On Fri, Apr 04, 2014 at 04:41:11PM +0200, Roger Pau Monne wrote:
> Blkback cannot work properly on auto-translated guests if Xen doesn't
> update the IOMMU when performing grant maps/unmaps, so only attach if
> the newly introduced XENFEAT_hvm_gntmap_supports_iommu is found.

Could you point to the git commit that introduces it in the patch please?
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: David Vrabel <david.vrabel@citrix.com>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> ---
>  drivers/block/xen-blkback/blkback.c |   12 ++++++++++++
>  include/xen/interface/features.h    |    6 ++++++
>  2 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
> index 64c60ed..4c23ddd 100644
> --- a/drivers/block/xen-blkback/blkback.c
> +++ b/drivers/block/xen-blkback/blkback.c
> @@ -1381,6 +1381,18 @@ static int __init xen_blkif_init(void)
>  	if (!xen_domain())
>  		return -ENODEV;
>  
> +#ifdef CONFIG_X86
> +	if (xen_feature(XENFEAT_auto_translated_physmap) &&
> +	    !xen_feature(XENFEAT_hvm_gntmap_supports_iommu)) {
> +		/*
> +		 * blkback cannot work properly on auto-translated guests
> +		 * if grant table mappings don't update the IOMMU entries.
> +		 */
> +		pr_debug(DRV_PFX "Disabling blkback because Xen is missing feature XENFEAT_hvm_gntmap_supports_iommu\n");
> +		return -ENODEV;
> +	}
> +#endif /* CONFIG_X86 */
> +
>  	rc = xen_blkif_interface_init();
>  	if (rc)
>  		goto failed_init;
> diff --git a/include/xen/interface/features.h b/include/xen/interface/features.h
> index 131a6cc..d1e0f23 100644
> --- a/include/xen/interface/features.h
> +++ b/include/xen/interface/features.h
> @@ -53,6 +53,12 @@
>  /* operation as Dom0 is supported */
>  #define XENFEAT_dom0                      11
>  
> +/*
> + * If set, GNTTABOP_map_grant_ref sets the proper IOMMU mappings so the
> + * resulting mapped page can be used for IO with hardware devices.
> + */
> +#define XENFEAT_hvm_gntmap_supports_iommu 12
> +
>  #define XENFEAT_NR_SUBMAPS 1
>  
>  #endif /* __XEN_PUBLIC_FEATURES_H__ */
> -- 
> 1.7.7.5 (Apple Git-26)
> 

  parent reply	other threads:[~2014-04-04 16:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04 14:41 [PATCH] xen-blkback: only attach blkback if the required features are met Roger Pau Monne
2014-04-04 15:01 ` David Vrabel
2014-04-04 15:01 ` David Vrabel
2014-04-04 15:13   ` Roger Pau Monné
2014-04-04 15:13   ` Roger Pau Monné
2014-04-07 17:11     ` David Vrabel
2014-04-07 17:11     ` David Vrabel
2014-04-04 16:58 ` Konrad Rzeszutek Wilk
2014-04-04 16:58 ` Konrad Rzeszutek Wilk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-04-04 14:41 Roger Pau Monne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140404165851.GS19478@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.