Re: [RFC PATCH v5 23/26] util: Add iova_tree_alloc

2022-01-27 Thread Eugenio Perez Martin
On Thu, Jan 27, 2022 at 12:25 PM Peter Xu wrote: > > On Thu, Jan 27, 2022 at 11:09:44AM +0100, Eugenio Perez Martin wrote: > > > > +/** > > > > + * Try to accomodate a map of size ret->size in a hole between > > > > + * max(end(hole_left), iova_start). > > > > > > I think this functions need the

Re: [RFC PATCH v5 23/26] util: Add iova_tree_alloc

2022-01-27 Thread Peter Xu
On Thu, Jan 27, 2022 at 11:09:44AM +0100, Eugenio Perez Martin wrote: > > > +/** > > > + * Try to accomodate a map of size ret->size in a hole between > > > + * max(end(hole_left), iova_start). > > > > I think this functions need the most comments, and above sentence is more or > > less not

Re: [RFC PATCH v5 23/26] util: Add iova_tree_alloc

2022-01-27 Thread Eugenio Perez Martin
On Thu, Jan 27, 2022 at 9:57 AM Peter Xu wrote: > > On Fri, Oct 29, 2021 at 08:35:22PM +0200, Eugenio Pérez wrote: > > This iova tree function allows it to look for a hole in allocated > > regions and return a totally new translation for a given translated > > address. > > > > It's usage is

Re: [RFC PATCH v5 23/26] util: Add iova_tree_alloc

2022-01-27 Thread Peter Xu
On Fri, Oct 29, 2021 at 08:35:22PM +0200, Eugenio Pérez wrote: > This iova tree function allows it to look for a hole in allocated > regions and return a totally new translation for a given translated > address. > > It's usage is mainly to allow devices to access qemu address space, > remapping

Re: [RFC PATCH v5 23/26] util: Add iova_tree_alloc

2021-11-22 Thread Eugenio Perez Martin
On Tue, Nov 23, 2021 at 7:57 AM Peter Xu wrote: > > Hi, Eugenio, > > Sorry for the super late response. > No problem! > On Fri, Oct 29, 2021 at 08:35:22PM +0200, Eugenio Pérez wrote: > > [...] > > > +int iova_tree_alloc(IOVATree *tree, DMAMap *map, hwaddr iova_begin, > > +

Re: [RFC PATCH v5 23/26] util: Add iova_tree_alloc

2021-11-22 Thread Peter Xu
Hi, Eugenio, Sorry for the super late response. On Fri, Oct 29, 2021 at 08:35:22PM +0200, Eugenio Pérez wrote: [...] > +int iova_tree_alloc(IOVATree *tree, DMAMap *map, hwaddr iova_begin, > +hwaddr iova_last) > +{ > +struct IOVATreeAllocArgs args = { > +

Re: [RFC PATCH v5 23/26] util: Add iova_tree_alloc

2021-11-03 Thread Eugenio Perez Martin
On Wed, Nov 3, 2021 at 4:10 AM Jason Wang wrote: > > On Tue, Nov 2, 2021 at 4:29 PM Eugenio Perez Martin > wrote: > > > > On Tue, Nov 2, 2021 at 7:35 AM Jason Wang wrote: > > > > > > > > > 在 2021/10/30 上午2:35, Eugenio Pérez 写道: > > > > This iova tree function allows it to look for a hole in

Re: [RFC PATCH v5 23/26] util: Add iova_tree_alloc

2021-11-02 Thread Jason Wang
On Tue, Nov 2, 2021 at 4:29 PM Eugenio Perez Martin wrote: > > On Tue, Nov 2, 2021 at 7:35 AM Jason Wang wrote: > > > > > > 在 2021/10/30 上午2:35, Eugenio Pérez 写道: > > > This iova tree function allows it to look for a hole in allocated > > > regions and return a totally new translation for a

Re: [RFC PATCH v5 23/26] util: Add iova_tree_alloc

2021-11-02 Thread Eugenio Perez Martin
On Tue, Nov 2, 2021 at 7:35 AM Jason Wang wrote: > > > 在 2021/10/30 上午2:35, Eugenio Pérez 写道: > > This iova tree function allows it to look for a hole in allocated > > regions and return a totally new translation for a given translated > > address. > > > > It's usage is mainly to allow devices to

Re: [RFC PATCH v5 23/26] util: Add iova_tree_alloc

2021-11-02 Thread Jason Wang
在 2021/10/30 上午2:35, Eugenio Pérez 写道: This iova tree function allows it to look for a hole in allocated regions and return a totally new translation for a given translated address. It's usage is mainly to allow devices to access qemu address space, remapping guest's one into a new iova space

[RFC PATCH v5 23/26] util: Add iova_tree_alloc

2021-10-29 Thread Eugenio Pérez
This iova tree function allows it to look for a hole in allocated regions and return a totally new translation for a given translated address. It's usage is mainly to allow devices to access qemu address space, remapping guest's one into a new iova space where qemu can add chunks of addresses.