Page MenuHomeFreeBSD

LinuxKPI: Import linux_page.c and some dependent code from drm-kmod
ClosedPublic

Authored by wulf on Sep 27 2021, 11:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 2, 10:35 PM
Unknown Object (File)
Dec 14 2023, 8:44 PM
Unknown Object (File)
Dec 12 2023, 9:39 AM
Unknown Object (File)
Nov 23 2023, 2:11 AM
Unknown Object (File)
Oct 19 2023, 1:25 AM
Unknown Object (File)
Sep 26 2023, 5:39 PM
Unknown Object (File)
Aug 17 2023, 1:37 PM
Unknown Object (File)
Jul 8 2023, 12:33 AM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

wulf requested review of this revision.Sep 27 2021, 11:26 PM
bz added a subscriber: bz.
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/scatterlist.h
568

Do you need to use kmap/kunmap here or can you not just pin the entire loop and us sf_* directly as done above?

sys/compat/linuxkpi/common/src/linux_page.c
71

Is this PMAP_HAS_DMAP now?

425

Probably %s: func better here now or rather remove this entirely as we don't have a LINUX_VERBOSE_DEBUG?

sys/compat/linuxkpi/common/include/linux/scatterlist.h
568

kmap/kunmap expands to NO-OP on most of supported archs

sys/compat/linuxkpi/common/src/linux_page.c
71

Looks like that

Use PMAP_HAS_DMAP instead of LP64
Optimize sg_pcopy_to_buffer() for !PMAP_HAS_DMAP case
Move kmap/kunmap implementation in to header file
Drop debugging printf

wulf marked 3 inline comments as done.Sep 28 2021, 8:53 AM
wulf added inline comments.
sys/compat/linuxkpi/common/include/linux/scatterlist.h
568

Do you need to use kmap/kunmap here or can you not just pin the entire loop and us sf_* directly as done above?

loop is rewritten to use pin/unpin and sf_* directly

sys/compat/linuxkpi/common/src/linux_page.c
425

Probably %s: func better here now or rather remove this entirely as we don't have a LINUX_VERBOSE_DEBUG?

debugging stuff removed

Thanks a lot, that's something I wanted to do for a long time.

This revision is now accepted and ready to land.Sep 28 2021, 9:07 AM

Looks good. Just make sure "make buildkernel WITH_OFED=YES" passes.

sys/compat/linuxkpi/common/include/linux/scatterlist.h
566

min() will truncate parameters to unsigned int. I guess it should be ulmin().

sys/compat/linuxkpi/common/src/linux_page.c
352

We always start at pindex 0, so holebegin is ignored. I understand that this may provide the desired semantics (or is it a bug?) but it looks wrong and deserves a comment IMHO.

361

Which vm_object_reference() call does this pair with?

wulf marked an inline comment as done.Sep 28 2021, 6:28 PM
wulf added inline comments.
sys/compat/linuxkpi/common/src/linux_page.c
361

It lies in linux_file_mmap_single() in sys/compat/linuxkpi/common/src/linux_compat.c (through cdev_pager_allocate() call). This routine is destructor for it.

sys/compat/linuxkpi/common/include/linux/scatterlist.h
566

There is also the MIN() macro and min_t().

  • Add short comment about unmap_mapping_range() parameters
  • min -> ulmin
This revision now requires review to proceed.Sep 28 2021, 7:40 PM
This revision is now accepted and ready to land.Sep 28 2021, 7:51 PM