From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: GNTTABOP_unmap_grant_ref doc Date: Mon, 29 Jul 2013 10:00:21 +0100 Message-ID: References: <1375087363.14896.12.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1375087363.14896.12.camel@kazak.uk.xensource.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: Ian Campbell , Stefano Stabellini Cc: David Scott , xen-devel List-Id: xen-devel@lists.xenproject.org On 29/07/2013 09:42, "Ian Campbell" wrote: >>> If it turns out that I have misread the doc, I'll happily send a patch to >>> improve the text (once I'm sure I understand what it should say...) >> >> From reading the implementation it woudl seem clear that host_addr is >> actually needed. > > In fact I think you need to pass in whatever you passed to the original > mapping operation, because op->flags here is not an argument from the > unmap call but is actually a reference to the original flags used to > make the mapping. So if you made the mapping with GNTMAP_host_map then > you need to pass the host_addr on unmap. Likewise if you used > GNTMAP_device_map then you need to specify dev_bus_addr. > > I've added Keir to the CC since he's the ultimate authority on these > things. The documentation is simply vague. GNTTABOP_unmap_grant_ref will only undo mappings that it is given the address of. If you provide a zero address in either field, that field is ignored. If you provide only zero addresses, then GNTTABOP_unmap_grant_ref does no work at all! But you now worked all this out already of course. ;) -- Keir