KNI calls `get_user_pages_remote()` API which is using `FOLL_TOUCH` flag, but `FOLL_TOUCH` is no more in public headers since v6.3, causing a build error.
`FOLL_*` defines in Linux kernel first moved to another header [1], later some of them moved to memory subsystem internal header [2] for 6.3 Quickly fixing build error by defining it in KNI compatibility header when it is not defined in Linux headers. There is a risk in this approach that if Linux kernel updates flags value and it diverges from the value defined in KNI. [1] Commit b5054174ac7c ("mm: move FOLL_* defs to mm_types.h") [2] Commit 2c2241081f7d ("mm/gup: move private gup FOLL_ flags to internal.h") Signed-off-by: Ferruh Yigit <ferruh.yi...@amd.com> --- kernel/linux/kni/compat.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h index 7aa6cd9fca75..42305799ebbd 100644 --- a/kernel/linux/kni/compat.h +++ b/kernel/linux/kni/compat.h @@ -151,3 +151,8 @@ RHEL_RELEASE_VERSION(9, 1) <= RHEL_RELEASE_CODE)) #define HAVE_NETIF_RX_NI #endif + +/* defined in 'mm/internal.h' since v6.3 */ +#ifndef FOLL_TOUCH +#define FOLL_TOUCH (1 << 16) +#endif -- 2.34.1