Skip to content

Fix udmabuf vmap error

Huan Yang dri-devel linux-media lkml 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesNew
  2. v12 patches 8 repliesSuperseded

ChangeLog from the cover letter

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Revert "udmabuf: fix vmap_udmabuf error page set"drivers/dma-buf/Kconfig drivers/dma-buf/udmabuf.c+7 -160 replies
2/2udmabuf: fix vmap missed offset pagedrivers/dma-buf/udmabuf.c+2 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] Fix udmabuf vmap error

V2 version just change commit message, no functional change.

In [1] Bingbu report an error that vmap_udmabuf invoke failed due to use vmap_pfn and blocked by !pfn_valid.

Due to misunderstand it, I change vmap_pfn check of !pfn_valid to pfn_valid, then send [2], then Christoph point that:
vmap_pfn is entirely for memory not backed by pages or folios, i.e. PCIe BARs and similar memory. This must not be mixed with proper folio backed memory.

So, I given a misuse of vmap_pfn. But to fix vmap_udmabuf, and consider HVO effect, I offer a RFC patchset [3], which simple copy vmap_pfn to vmap_udmabuf, other implement folio range based vmap.

But in [3], Muchun point that I misunderstand HVO, which do not released any page struct pointer in vmemmap, only change this VA's PTE point to hugetlb's **HEAD** page frame, and release remainned **tail** page frame. So any page struct pointer do exist, and folio_page, folio_pfn or other api still can work.

By this, we can fix this error simpliy:
Patch 1 revert this vmap_pfn misuse patch.
Patch 2 fix missed offset page set.

ChangeLog:
v1->v2: change Patch1's commit message which vivek suggested.

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/
[3] https://lore.kernel.org/all/[email protected]/

Huan Yang (2):
Revert "udmabuf: fix vmap_udmabuf error page set"
udmabuf: fix vmap missed offset page

 drivers/dma-buf/Kconfig   |  1 -
 drivers/dma-buf/udmabuf.c | 23 ++++++++---------------
 2 files changed, 8 insertions(+), 16 deletions(-)

base-commit: b425262c07a6a643ebeed91046e161e20b944164 --
2.48.1