From: Tim Deegan Subject: Re: [PATCH 2/4] xen: introduce grant_map_exists Date: Thu, 2 Oct 2014 16:01:56 +0200 Message-ID: <20141002140156.GC56564@deinos.phlegethon.org> References: <1412244158-12124-2-git-send-email-stefano.stabellini@eu.citrix.com> <20141002101741.GC43394@deinos.phlegethon.org> <20141002114141.GE43394@deinos.phlegethon.org> <542D5A55020000780003BF5E@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <542D5A55020000780003BF5E@mail.emea.novell.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: Stefano Stabellini Cc: julien.grall@citrix.com, xen-devel@lists.xensource.com, Ian.Campbell@citrix.com, Jan Beulich List-Id: xen-devel@lists.xenproject.org At 12:59 +0100 on 02 Oct (1412251189), Jan Beulich wrote: > >>> On 02.10.14 at 13:41, wrote: > > Blargh. Silly linux, forgetting its grant handles. :) > > > > So after some IRL discussion with Stefano and IanC, I'm convinced that > > the alternatives (linux maintaining per-map lookup tables to get back > > from DMA address to grant handle) aren't going to work. But we can > > make this API a bit neater. I think the design we came up with is: > > > > - the cache-flush hypercall becomes a grant-table op instead of a > > memop. > > - the argument becomes a 'dev_bus_addr' instead of an MFN. That is, > > it must be the address returned in the dev_bus_addr field of a > > grant map operation. If not, it will return EINVAL. > > Then at the very least let's allow for either a dev_bus_addr or > a grant-ref (even if for the moment the latter may yield > -EOPNOTSUPP in order to not spend more time on this than > immediately necessary). That way guests remembering what > they did a few microseconds back can do this in a more well > behaved fashion. Good idea. Another thing that occurs to me: this should handle transitive grants as well if possible. Cheers, Tim.