0001-zero-copy-Fix-build-for-Linux-6-4.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 592017c3a910a3905b1925aee88c4674e9a596b7 Mon Sep 17 00:00:00 2001
  2. From: Gaurav Jain <gaurav.jain@nxp.com>
  3. Date: Tue, 30 May 2023 17:09:42 +0530
  4. Subject: [PATCH] zero copy: Fix build for Linux 6.4
  5. get_user_pages_remote api prototype is changed in kernel.
  6. struct vm_area_struct **vmas argument is removed.
  7. Migrate to the new API.
  8. Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
  9. Upstream: https://github.com/cryptodev-linux/cryptodev-linux/commit/592017c3a910a3905b1925aee88c4674e9a596b7
  10. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  11. ---
  12. zc.c | 6 +++++-
  13. 1 file changed, 5 insertions(+), 1 deletion(-)
  14. diff --git a/zc.c b/zc.c
  15. index fdf7da17..6637945a 100644
  16. --- a/zc.c
  17. +++ b/zc.c
  18. @@ -80,10 +80,14 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write,
  19. ret = get_user_pages_remote(task, mm,
  20. (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0,
  21. pg, NULL, NULL);
  22. -#else
  23. +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
  24. ret = get_user_pages_remote(mm,
  25. (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0,
  26. pg, NULL, NULL);
  27. +#else
  28. + ret = get_user_pages_remote(mm,
  29. + (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0,
  30. + pg, NULL);
  31. #endif
  32. #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
  33. up_read(&mm->mmap_sem);