Hi Huan,

> Subject: [PATCH 2/2] udmabuf: fix vmap missed offset page
> 
> Before invoke vmap, we need offer a pages pointer array which each page
> need to map in vmalloc area.
> 
> But currently vmap_udmabuf only set each folio's head page into pages,
> missed each offset pages when iter.
> 
> This patch set the correctly offset page in each folio into array.
> 
> Signed-off-by: Huan Yang <l...@vivo.com>
> Fixes: 5e72b2b41a21 ("udmabuf: convert udmabuf driver to use folios")
> ---
>  drivers/dma-buf/udmabuf.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
> index 79845565089d..af5200e360a6 100644
> --- a/drivers/dma-buf/udmabuf.c
> +++ b/drivers/dma-buf/udmabuf.c
> @@ -120,7 +120,8 @@ static int vmap_udmabuf(struct dma_buf *buf, struct
> iosys_map *map)
>               return -ENOMEM;
> 
>       for (pg = 0; pg < ubuf->pagecount; pg++)
> -             pages[pg] = &ubuf->folios[pg]->page;
> +             pages[pg] = folio_page(ubuf->folios[pg],
> +                                    ubuf->offsets[pg] >> PAGE_SHIFT);
IIUC, it does not look like vm_map_ram() or the other functions it calls would
write to these tail page pointers (struct page*), which should be safe even
when HVO is enabled (based on your conversations with Muchun). However,
I am wondering whether Bingbu can test this out with HVO enabled?

Regardless,
Acked-by: Vivek Kasireddy <vivek.kasire...@intel.com>

Thanks,
Vivek

> 
>       vaddr = vm_map_ram(pages, ubuf->pagecount, -1);
>       kvfree(pages);
> --
> 2.48.1

Reply via email to