OFS / linux-dfl-backport

Backport version of the linux-dfl (Device Feature List) kernel driver for FPGA devices. This is an out-of-tree driver, designed to be built, packaged, and installed as a stand-alone set of driver modules.
GNU General Public License v2.0
3 stars 11 forks source link

Fpgamatt/fpga ofs dev 6.6 lts/cxl updates #122

Closed fpgamatt closed 6 months ago

fpgamatt commented 6 months ago

Sync the changes to drivers/fpga/dfl-cxl-cache.c from https://github.com/OFS/linux-dfl/tree/fpga-ofs-dev-6.6-lts.

pcolberg commented 6 months ago

CentOS 8.2 (4.18.0-193.28.1.el8_2.x86_64):

/__w/linux-dfl-backport/linux-dfl-backport/drivers/fpga/dfl-cxl-cache.c:25:10: fatal error: linux/mmap_lock.h: No such file or directory
 #include <linux/mmap_lock.h>
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.

Fedora rawhide (6.8.0-0.rc6.20240227git45ec2f5f6ed3.50.fc41.x86_64):

/__w/linux-dfl-backport/linux-dfl-backport/drivers/fpga/dfl-cxl-cache.c: In function 'cxl_cache_set_region_read_only':
/__w/linux-dfl-backport/linux-dfl-backport/drivers/fpga/dfl-cxl-cache.c:298:23: error: assignment of read-only member 'vm_flags'
  298 |         vma->vm_flags &= ~VM_WRITE;
      |                       ^~
pcolberg commented 6 months ago

The unrelated RHEL 9.4 failure is resolved in https://github.com/OFS/linux-dfl-backport/pull/124.

pcolberg commented 6 months ago

Up to RHEL 8.4 (4.18.0-305.25.1.el8_4.x86_64):

/__w/linux-dfl-backport/linux-dfl-backport/drivers/fpga/dfl-cxl-cache.c: In function 'cxl_cache_set_region_read_only':
/__w/linux-dfl-backport/linux-dfl-backport/drivers/fpga/dfl-cxl-cache.c:288:8: error: implicit declaration of function 'vma_lookup'; did you mean 'key_lookup'? [-Werror=implicit-function-declaration]
  vma = vma_lookup(current->mm, region->user_addr);
        ^~~~~~~~~~
        key_lookup
/__w/linux-dfl-backport/linux-dfl-backport/drivers/fpga/dfl-cxl-cache.c:288:6: warning: assignment to 'struct vm_area_struct *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  vma = vma_lookup(current->mm, region->user_addr);
      ^
cc1: some warnings being treated as errors

Would find_vma() work? vma_lookup() was added in commit ce6d42f2e4a2 ("mm: add vma_lookup(), update find_vma_intersection() comments") and seems amenable to backporting.