[lkml]   [2019]   [Jun]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC PATCH 16/16] xen/grant-table: host_addr fixup in mapping on xenhost_r0
On 6/17/19 3:55 AM, Juergen Gross wrote:
> 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 <>
>> Signed-off-by: Ankur Arora <>
> Without seeing the __xenbus_map_ring() modification it is impossible to
> do a proper review of this patch.
Will do in v2.


> Juergen

 \ /
  Last update: 2019-06-19 05:03    [W:0.071 / U:2.876 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site