From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= Subject: Re: [PATCH] xen-blkback: only attach blkback if the required features are met Date: Fri, 4 Apr 2014 17:13:54 +0200 Message-ID: <533ECC32.5070302__8203.16106915033$1396624540$gmane$org@citrix.com> References: <1396622471-13114-1-git-send-email-roger.pau@citrix.com> <533EC966.7030101@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WW5od-000824-JM for xen-devel@lists.xenproject.org; Fri, 04 Apr 2014 15:13:59 +0000 In-Reply-To: <533EC966.7030101@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: xen-devel@lists.xenproject.org, Boris Ostrovsky , linux-kernel@vger.kernel.org List-Id: xen-devel@lists.xenproject.org On 04/04/14 17:01, David Vrabel wrote: > On 04/04/14 15:41, 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. > > Can you explain the problem in more detail and which guest > configurations are affected? > > This isn't a problem that is specific to blkback, but any backend that > grant maps and passes the foreign pages to a device so there needs to be > a generic solution. > > Why can't this be fixed by having the swiotlb bounce foreign pages? Yes, it could be fixed with that, FreeBSD has been doing it for a long time. But since nobody has complained about this, and the issue has been there for a long time, I'm not sure it's worth adding all the bounce buffer code for what seems to be an unused configuration. Also, since Linux also supports PV, I would just say that if you want to use driver domains you are forced to use PV guests (or have a recent Xen version that properly updates the IOMMU on grant map/unmap). >> --- 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 */ > > Why CONFIG_X86? ARM has a bounce buffer for foreign pages, so this is not needed. > > David >