[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a35ab9a8-4874-fbc8-0148-aa07543e8672@suse.com>
Date: Mon, 17 Jun 2019 12:55:59 +0200
From: Juergen Gross <jgross@...e.com>
To: Ankur Arora <ankur.a.arora@...cle.com>,
linux-kernel@...r.kernel.org, xen-devel@...ts.xenproject.org
Cc: pbonzini@...hat.com, boris.ostrovsky@...cle.com,
konrad.wilk@...cle.com, sstabellini@...nel.org,
joao.m.martins@...cle.com
Subject: Re: [RFC PATCH 16/16] xen/grant-table: host_addr fixup in mapping on
xenhost_r0
On 09.05.19 19:25, Ankur Arora wrote:
> Xenhost type xenhost_r0 does not support standard GNTTABOP_map_grant_ref
> semantics (map a gref onto a specified host_addr). That's because
> since the hypervisor is local (same address space as the caller of
> GNTTABOP_map_grant_ref), there is no external entity that could
> map an arbitrary page underneath an arbitrary address.
>
> To handle this, the GNTTABOP_map_grant_ref hypercall on xenhost_r0
> treats the host_addr as an OUT parameter instead of IN and expects the
> gnttab_map_refs() and similar to fixup any state that caches the
> value of host_addr from before the hypercall.
>
> Accordingly gnttab_map_refs() now adds two parameters, a fixup function
> and a pointer to cached maps to fixup:
> int gnttab_map_refs(xenhost_t *xh, struct gnttab_map_grant_ref *map_ops,
> struct gnttab_map_grant_ref *kmap_ops,
> - struct page **pages, unsigned int count)
> + struct page **pages, gnttab_map_fixup_t map_fixup_fn,
> + void **map_fixup[], unsigned int count)
>
> The reason we use a fixup function and not an additional mapping op
> in the xenhost_t is because, depending on the caller, what we are fixing
> might be different: blkback, netback for instance cache host_addr in
> via a struct page *, while __xenbus_map_ring() caches a phys_addr.
>
> This patch fixes up xen-blkback and xen-gntdev drivers.
>
> TODO:
> - also rewrite gnttab_batch_map() and __xenbus_map_ring().
> - modify xen-netback, scsiback, pciback etc
>
> Co-developed-by: Joao Martins <joao.m.martins@...cle.com>
> Signed-off-by: Ankur Arora <ankur.a.arora@...cle.com>
Without seeing the __xenbus_map_ring() modification it is impossible to
do a proper review of this patch.
Juergen
Powered by blists - more mailing lists