1 From 23cfd7b53ec1521d3c23ceddfda49352c2d349dc Mon Sep 17 00:00:00 2001
2 From: Ovidiu Panait <ovidiu.panait@windriver.com>
3 Date: Thu, 14 May 2020 13:05:24 +0300
4 Subject: [PATCH 3/4] Fix: Use vmalloc_sync_mappings on kernel 5.6 as well
6 Upstream commit [1], that got rid of vmalloc_sync_all and introduced
7 vmalloc_sync_mappings, is a v5.6 commit:
8 $ git tag --contains 763802b53a427ed3cbd419dbba255c414fdd9e7c
15 Extend the LINUX_VERSION_CODE check to v5.6 to fix the following warnings:
17 [ 483.242037] LTTng: vmalloc_sync_all symbol lookup failed.
18 [ 483.257056] Page fault handler and NMI tracing might trigger faults.
21 [1] https://github.com/torvalds/linux/commit/763802b53a427ed3cbd419dbba255c414fdd9e7c
23 Upstream-Status: Backport [https://github.com/lttng/lttng-modules/commit/da356b324dfc160e09b8966b691792037badf455]
25 Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
26 Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
27 Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
29 wrapper/vmalloc.h | 12 ++++++------
30 1 file changed, 6 insertions(+), 6 deletions(-)
32 diff --git a/wrapper/vmalloc.h b/wrapper/vmalloc.h
33 index 5d0b389..d905f60 100644
34 --- a/wrapper/vmalloc.h
35 +++ b/wrapper/vmalloc.h
37 #include <linux/kallsyms.h>
38 #include <wrapper/kallsyms.h>
40 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0))
41 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
44 void wrapper_vmalloc_sync_mappings(void)
45 @@ -43,7 +43,7 @@ void wrapper_vmalloc_sync_mappings(void)
49 -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */
50 +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) */
53 * Map vmalloc_sync_mappings to vmalloc_sync_all() on kernels before 5.7.
54 @@ -68,11 +68,11 @@ void wrapper_vmalloc_sync_mappings(void)
58 -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */
59 +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) */
63 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0))
64 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
67 void wrapper_vmalloc_sync_mappings(void)
68 @@ -80,7 +80,7 @@ void wrapper_vmalloc_sync_mappings(void)
69 return vmalloc_sync_mappings();
72 -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */
73 +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) */
76 void wrapper_vmalloc_sync_mappings(void)
77 @@ -88,7 +88,7 @@ void wrapper_vmalloc_sync_mappings(void)
78 return vmalloc_sync_all();
81 -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */
82 +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) */