From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [RFC PATCH 2/7] iommu: add iommu_lookup_page to lookup guest gfn for a particular IOMMU mapping Date: Wed, 24 Feb 2016 15:10:39 +0000 Message-ID: <56CDC7EF.4000704@citrix.com> References: <1455099035-17649-1-git-send-email-malcolm.crossley@citrix.com> <1455099035-17649-3-git-send-email-malcolm.crossley@citrix.com> <20160217202239.GC25726@char.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap , Konrad Rzeszutek Wilk Cc: Malcolm Crossley , Jan Beulich , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 24/02/16 15:08, George Dunlap wrote: > On Wed, Feb 17, 2016 at 8:22 PM, Konrad Rzeszutek Wilk > wrote: >>> + { >>> + *gfn = bfn; >>> + return 0; >>> + } >>> + >>> + if ( !iommu_enabled || !hd->platform_ops || >>> + !hd->platform_ops->lookup_page ) >>> + return -ENOMEM; >> -ENOMEM ? ENXIO ? Or maybe -ENOSYS for the case when hd->platform_ops >> is not set nor ->lookup_page? > I think ENOTSUPP, perhaps? ENOMEM means a memory allocation failed > (which it hasn't); ENOSYS means this is an invalid system call (which > it isn't). ESRCH could be close too, but it seems like that would be > more appropriate when you try to lookup a non-existent BFN. Xen (fairly) consistently uses ESRCH for "domain not found". I would recommend -ENOTSUPP here. ~Andrew