diff options
5 files changed, 1044 insertions, 0 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0001-Update-for-kernel-5.7-use-vmalloc_sync_mappings-on-k.patch b/meta/recipes-kernel/lttng/lttng-modules/0001-Update-for-kernel-5.7-use-vmalloc_sync_mappings-on-k.patch new file mode 100644 index 0000000000..58f4d29193 --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0001-Update-for-kernel-5.7-use-vmalloc_sync_mappings-on-k.patch | |||
| @@ -0,0 +1,853 @@ | |||
| 1 | From a2cc0e06330e55eefe668f7d6370de6d3177a907 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
| 3 | Date: Tue, 5 May 2020 13:38:31 -0400 | ||
| 4 | Subject: [PATCH] Update for kernel 5.7: use vmalloc_sync_mappings on kernels | ||
| 5 | >= 5.7 | ||
| 6 | |||
| 7 | Upstream-Status: Backport [https://github.com/lttng/lttng-modules/commit/da0fcb1497ff2437407883647a8a0bba12bd0f91] | ||
| 8 | |||
| 9 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
| 10 | Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> | ||
| 11 | --- | ||
| 12 | lib/ringbuffer/ring_buffer_backend.c | 4 +-- | ||
| 13 | lttng-abi.c | 4 +-- | ||
| 14 | lttng-context-callstack.c | 2 +- | ||
| 15 | lttng-context-cgroup-ns.c | 2 +- | ||
| 16 | lttng-context-cpu-id.c | 2 +- | ||
| 17 | lttng-context-egid.c | 2 +- | ||
| 18 | lttng-context-euid.c | 2 +- | ||
| 19 | lttng-context-gid.c | 2 +- | ||
| 20 | lttng-context-hostname.c | 2 +- | ||
| 21 | lttng-context-interruptible.c | 2 +- | ||
| 22 | lttng-context-ipc-ns.c | 2 +- | ||
| 23 | lttng-context-migratable.c | 2 +- | ||
| 24 | lttng-context-mnt-ns.c | 2 +- | ||
| 25 | lttng-context-need-reschedule.c | 2 +- | ||
| 26 | lttng-context-net-ns.c | 2 +- | ||
| 27 | lttng-context-nice.c | 2 +- | ||
| 28 | lttng-context-perf-counters.c | 2 +- | ||
| 29 | lttng-context-pid-ns.c | 2 +- | ||
| 30 | lttng-context-pid.c | 2 +- | ||
| 31 | lttng-context-ppid.c | 2 +- | ||
| 32 | lttng-context-preemptible.c | 2 +- | ||
| 33 | lttng-context-prio.c | 2 +- | ||
| 34 | lttng-context-procname.c | 2 +- | ||
| 35 | lttng-context-sgid.c | 2 +- | ||
| 36 | lttng-context-suid.c | 2 +- | ||
| 37 | lttng-context-tid.c | 2 +- | ||
| 38 | lttng-context-uid.c | 2 +- | ||
| 39 | lttng-context-user-ns.c | 2 +- | ||
| 40 | lttng-context-uts-ns.c | 2 +- | ||
| 41 | lttng-context-vegid.c | 2 +- | ||
| 42 | lttng-context-veuid.c | 2 +- | ||
| 43 | lttng-context-vgid.c | 2 +- | ||
| 44 | lttng-context-vpid.c | 2 +- | ||
| 45 | lttng-context-vppid.c | 2 +- | ||
| 46 | lttng-context-vsgid.c | 2 +- | ||
| 47 | lttng-context-vsuid.c | 2 +- | ||
| 48 | lttng-context-vtid.c | 2 +- | ||
| 49 | lttng-context-vuid.c | 2 +- | ||
| 50 | lttng-context.c | 2 +- | ||
| 51 | lttng-events.c | 10 +++--- | ||
| 52 | lttng-ring-buffer-client.h | 4 +-- | ||
| 53 | lttng-ring-buffer-metadata-client.h | 4 +-- | ||
| 54 | lttng-syscalls.c | 2 +- | ||
| 55 | probes/lttng-kprobes.c | 2 +- | ||
| 56 | probes/lttng-kretprobes.c | 2 +- | ||
| 57 | probes/lttng-tracepoint-event-impl.h | 4 +-- | ||
| 58 | probes/lttng-uprobes.c | 2 +- | ||
| 59 | probes/lttng.c | 2 +- | ||
| 60 | tests/probes/lttng-test.c | 2 +- | ||
| 61 | wrapper/vmalloc.h | 49 ++++++++++++++++++++++++++-- | ||
| 62 | 50 files changed, 104 insertions(+), 61 deletions(-) | ||
| 63 | |||
| 64 | diff --git a/lib/ringbuffer/ring_buffer_backend.c b/lib/ringbuffer/ring_buffer_backend.c | ||
| 65 | index d4bec25..d232b7f 100644 | ||
| 66 | --- a/lib/ringbuffer/ring_buffer_backend.c | ||
| 67 | +++ b/lib/ringbuffer/ring_buffer_backend.c | ||
| 68 | @@ -17,7 +17,7 @@ | ||
| 69 | #include <linux/vmalloc.h> | ||
| 70 | |||
| 71 | #include <wrapper/mm.h> | ||
| 72 | -#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_all() */ | ||
| 73 | +#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_mappings() */ | ||
| 74 | #include <wrapper/ringbuffer/config.h> | ||
| 75 | #include <wrapper/ringbuffer/backend.h> | ||
| 76 | #include <wrapper/ringbuffer/frontend.h> | ||
| 77 | @@ -156,7 +156,7 @@ int lib_ring_buffer_backend_allocate(const struct lib_ring_buffer_config *config | ||
| 78 | * If kmalloc ever uses vmalloc underneath, make sure the buffer pages | ||
| 79 | * will not fault. | ||
| 80 | */ | ||
| 81 | - wrapper_vmalloc_sync_all(); | ||
| 82 | + wrapper_vmalloc_sync_mappings(); | ||
| 83 | wrapper_clear_current_oom_origin(); | ||
| 84 | vfree(pages); | ||
| 85 | return 0; | ||
| 86 | diff --git a/lttng-abi.c b/lttng-abi.c | ||
| 87 | index b63e376..826ecab 100644 | ||
| 88 | --- a/lttng-abi.c | ||
| 89 | +++ b/lttng-abi.c | ||
| 90 | @@ -30,7 +30,7 @@ | ||
| 91 | #include <linux/uaccess.h> | ||
| 92 | #include <linux/slab.h> | ||
| 93 | #include <linux/err.h> | ||
| 94 | -#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_all() */ | ||
| 95 | +#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_mappings() */ | ||
| 96 | #include <wrapper/ringbuffer/vfs.h> | ||
| 97 | #include <wrapper/ringbuffer/backend.h> | ||
| 98 | #include <wrapper/ringbuffer/frontend.h> | ||
| 99 | @@ -1938,7 +1938,7 @@ int __init lttng_abi_init(void) | ||
| 100 | { | ||
| 101 | int ret = 0; | ||
| 102 | |||
| 103 | - wrapper_vmalloc_sync_all(); | ||
| 104 | + wrapper_vmalloc_sync_mappings(); | ||
| 105 | lttng_clock_ref(); | ||
| 106 | |||
| 107 | ret = lttng_tp_mempool_init(); | ||
| 108 | diff --git a/lttng-context-callstack.c b/lttng-context-callstack.c | ||
| 109 | index 195990a..ba35a39 100644 | ||
| 110 | --- a/lttng-context-callstack.c | ||
| 111 | +++ b/lttng-context-callstack.c | ||
| 112 | @@ -141,7 +141,7 @@ int __lttng_add_callstack_generic(struct lttng_ctx **ctx, | ||
| 113 | field->record = lttng_callstack_record; | ||
| 114 | field->priv = fdata; | ||
| 115 | field->destroy = lttng_callstack_destroy; | ||
| 116 | - wrapper_vmalloc_sync_all(); | ||
| 117 | + wrapper_vmalloc_sync_mappings(); | ||
| 118 | return 0; | ||
| 119 | |||
| 120 | error_create: | ||
| 121 | diff --git a/lttng-context-cgroup-ns.c b/lttng-context-cgroup-ns.c | ||
| 122 | index 81486e5..f324b7e 100644 | ||
| 123 | --- a/lttng-context-cgroup-ns.c | ||
| 124 | +++ b/lttng-context-cgroup-ns.c | ||
| 125 | @@ -97,7 +97,7 @@ int lttng_add_cgroup_ns_to_ctx(struct lttng_ctx **ctx) | ||
| 126 | field->record = cgroup_ns_record; | ||
| 127 | field->get_value = cgroup_ns_get_value; | ||
| 128 | lttng_context_update(*ctx); | ||
| 129 | - wrapper_vmalloc_sync_all(); | ||
| 130 | + wrapper_vmalloc_sync_mappings(); | ||
| 131 | return 0; | ||
| 132 | } | ||
| 133 | EXPORT_SYMBOL_GPL(lttng_add_cgroup_ns_to_ctx); | ||
| 134 | diff --git a/lttng-context-cpu-id.c b/lttng-context-cpu-id.c | ||
| 135 | index 3778225..6e2f3f4 100644 | ||
| 136 | --- a/lttng-context-cpu-id.c | ||
| 137 | +++ b/lttng-context-cpu-id.c | ||
| 138 | @@ -68,7 +68,7 @@ int lttng_add_cpu_id_to_ctx(struct lttng_ctx **ctx) | ||
| 139 | field->record = cpu_id_record; | ||
| 140 | field->get_value = cpu_id_get_value; | ||
| 141 | lttng_context_update(*ctx); | ||
| 142 | - wrapper_vmalloc_sync_all(); | ||
| 143 | + wrapper_vmalloc_sync_mappings(); | ||
| 144 | return 0; | ||
| 145 | } | ||
| 146 | EXPORT_SYMBOL_GPL(lttng_add_cpu_id_to_ctx); | ||
| 147 | diff --git a/lttng-context-egid.c b/lttng-context-egid.c | ||
| 148 | index 51536e2..bdcebb9 100644 | ||
| 149 | --- a/lttng-context-egid.c | ||
| 150 | +++ b/lttng-context-egid.c | ||
| 151 | @@ -70,7 +70,7 @@ int lttng_add_egid_to_ctx(struct lttng_ctx **ctx) | ||
| 152 | field->record = egid_record; | ||
| 153 | field->get_value = egid_get_value; | ||
| 154 | lttng_context_update(*ctx); | ||
| 155 | - wrapper_vmalloc_sync_all(); | ||
| 156 | + wrapper_vmalloc_sync_mappings(); | ||
| 157 | return 0; | ||
| 158 | } | ||
| 159 | EXPORT_SYMBOL_GPL(lttng_add_egid_to_ctx); | ||
| 160 | diff --git a/lttng-context-euid.c b/lttng-context-euid.c | ||
| 161 | index 1bcd53f..c2b8dcd 100644 | ||
| 162 | --- a/lttng-context-euid.c | ||
| 163 | +++ b/lttng-context-euid.c | ||
| 164 | @@ -70,7 +70,7 @@ int lttng_add_euid_to_ctx(struct lttng_ctx **ctx) | ||
| 165 | field->record = euid_record; | ||
| 166 | field->get_value = euid_get_value; | ||
| 167 | lttng_context_update(*ctx); | ||
| 168 | - wrapper_vmalloc_sync_all(); | ||
| 169 | + wrapper_vmalloc_sync_mappings(); | ||
| 170 | return 0; | ||
| 171 | } | ||
| 172 | EXPORT_SYMBOL_GPL(lttng_add_euid_to_ctx); | ||
| 173 | diff --git a/lttng-context-gid.c b/lttng-context-gid.c | ||
| 174 | index da54207..c355e8c 100644 | ||
| 175 | --- a/lttng-context-gid.c | ||
| 176 | +++ b/lttng-context-gid.c | ||
| 177 | @@ -70,7 +70,7 @@ int lttng_add_gid_to_ctx(struct lttng_ctx **ctx) | ||
| 178 | field->record = gid_record; | ||
| 179 | field->get_value = gid_get_value; | ||
| 180 | lttng_context_update(*ctx); | ||
| 181 | - wrapper_vmalloc_sync_all(); | ||
| 182 | + wrapper_vmalloc_sync_mappings(); | ||
| 183 | return 0; | ||
| 184 | } | ||
| 185 | EXPORT_SYMBOL_GPL(lttng_add_gid_to_ctx); | ||
| 186 | diff --git a/lttng-context-hostname.c b/lttng-context-hostname.c | ||
| 187 | index e485aa9..17dbd57 100644 | ||
| 188 | --- a/lttng-context-hostname.c | ||
| 189 | +++ b/lttng-context-hostname.c | ||
| 190 | @@ -101,7 +101,7 @@ int lttng_add_hostname_to_ctx(struct lttng_ctx **ctx) | ||
| 191 | field->record = hostname_record; | ||
| 192 | field->get_value = hostname_get_value; | ||
| 193 | lttng_context_update(*ctx); | ||
| 194 | - wrapper_vmalloc_sync_all(); | ||
| 195 | + wrapper_vmalloc_sync_mappings(); | ||
| 196 | return 0; | ||
| 197 | } | ||
| 198 | EXPORT_SYMBOL_GPL(lttng_add_hostname_to_ctx); | ||
| 199 | diff --git a/lttng-context-interruptible.c b/lttng-context-interruptible.c | ||
| 200 | index f3da199..8bd279a 100644 | ||
| 201 | --- a/lttng-context-interruptible.c | ||
| 202 | +++ b/lttng-context-interruptible.c | ||
| 203 | @@ -75,7 +75,7 @@ int lttng_add_interruptible_to_ctx(struct lttng_ctx **ctx) | ||
| 204 | field->record = interruptible_record; | ||
| 205 | field->get_value = interruptible_get_value; | ||
| 206 | lttng_context_update(*ctx); | ||
| 207 | - wrapper_vmalloc_sync_all(); | ||
| 208 | + wrapper_vmalloc_sync_mappings(); | ||
| 209 | return 0; | ||
| 210 | } | ||
| 211 | EXPORT_SYMBOL_GPL(lttng_add_interruptible_to_ctx); | ||
| 212 | diff --git a/lttng-context-ipc-ns.c b/lttng-context-ipc-ns.c | ||
| 213 | index 78d5966..40b901b 100644 | ||
| 214 | --- a/lttng-context-ipc-ns.c | ||
| 215 | +++ b/lttng-context-ipc-ns.c | ||
| 216 | @@ -96,7 +96,7 @@ int lttng_add_ipc_ns_to_ctx(struct lttng_ctx **ctx) | ||
| 217 | field->record = ipc_ns_record; | ||
| 218 | field->get_value = ipc_ns_get_value; | ||
| 219 | lttng_context_update(*ctx); | ||
| 220 | - wrapper_vmalloc_sync_all(); | ||
| 221 | + wrapper_vmalloc_sync_mappings(); | ||
| 222 | return 0; | ||
| 223 | } | ||
| 224 | EXPORT_SYMBOL_GPL(lttng_add_ipc_ns_to_ctx); | ||
| 225 | diff --git a/lttng-context-migratable.c b/lttng-context-migratable.c | ||
| 226 | index e3d8ede..65154b8 100644 | ||
| 227 | --- a/lttng-context-migratable.c | ||
| 228 | +++ b/lttng-context-migratable.c | ||
| 229 | @@ -68,7 +68,7 @@ int lttng_add_migratable_to_ctx(struct lttng_ctx **ctx) | ||
| 230 | field->record = migratable_record; | ||
| 231 | field->get_value = migratable_get_value; | ||
| 232 | lttng_context_update(*ctx); | ||
| 233 | - wrapper_vmalloc_sync_all(); | ||
| 234 | + wrapper_vmalloc_sync_mappings(); | ||
| 235 | return 0; | ||
| 236 | } | ||
| 237 | EXPORT_SYMBOL_GPL(lttng_add_migratable_to_ctx); | ||
| 238 | diff --git a/lttng-context-mnt-ns.c b/lttng-context-mnt-ns.c | ||
| 239 | index b5bb955..cb59776 100644 | ||
| 240 | --- a/lttng-context-mnt-ns.c | ||
| 241 | +++ b/lttng-context-mnt-ns.c | ||
| 242 | @@ -98,7 +98,7 @@ int lttng_add_mnt_ns_to_ctx(struct lttng_ctx **ctx) | ||
| 243 | field->record = mnt_ns_record; | ||
| 244 | field->get_value = mnt_ns_get_value; | ||
| 245 | lttng_context_update(*ctx); | ||
| 246 | - wrapper_vmalloc_sync_all(); | ||
| 247 | + wrapper_vmalloc_sync_mappings(); | ||
| 248 | return 0; | ||
| 249 | } | ||
| 250 | EXPORT_SYMBOL_GPL(lttng_add_mnt_ns_to_ctx); | ||
| 251 | diff --git a/lttng-context-need-reschedule.c b/lttng-context-need-reschedule.c | ||
| 252 | index f29fb28..94efaa5 100644 | ||
| 253 | --- a/lttng-context-need-reschedule.c | ||
| 254 | +++ b/lttng-context-need-reschedule.c | ||
| 255 | @@ -68,7 +68,7 @@ int lttng_add_need_reschedule_to_ctx(struct lttng_ctx **ctx) | ||
| 256 | field->record = need_reschedule_record; | ||
| 257 | field->get_value = need_reschedule_get_value; | ||
| 258 | lttng_context_update(*ctx); | ||
| 259 | - wrapper_vmalloc_sync_all(); | ||
| 260 | + wrapper_vmalloc_sync_mappings(); | ||
| 261 | return 0; | ||
| 262 | } | ||
| 263 | EXPORT_SYMBOL_GPL(lttng_add_need_reschedule_to_ctx); | ||
| 264 | diff --git a/lttng-context-net-ns.c b/lttng-context-net-ns.c | ||
| 265 | index 6694037..37de09f 100644 | ||
| 266 | --- a/lttng-context-net-ns.c | ||
| 267 | +++ b/lttng-context-net-ns.c | ||
| 268 | @@ -97,7 +97,7 @@ int lttng_add_net_ns_to_ctx(struct lttng_ctx **ctx) | ||
| 269 | field->record = net_ns_record; | ||
| 270 | field->get_value = net_ns_get_value; | ||
| 271 | lttng_context_update(*ctx); | ||
| 272 | - wrapper_vmalloc_sync_all(); | ||
| 273 | + wrapper_vmalloc_sync_mappings(); | ||
| 274 | return 0; | ||
| 275 | } | ||
| 276 | EXPORT_SYMBOL_GPL(lttng_add_net_ns_to_ctx); | ||
| 277 | diff --git a/lttng-context-nice.c b/lttng-context-nice.c | ||
| 278 | index 563e805..acaba85 100644 | ||
| 279 | --- a/lttng-context-nice.c | ||
| 280 | +++ b/lttng-context-nice.c | ||
| 281 | @@ -68,7 +68,7 @@ int lttng_add_nice_to_ctx(struct lttng_ctx **ctx) | ||
| 282 | field->record = nice_record; | ||
| 283 | field->get_value = nice_get_value; | ||
| 284 | lttng_context_update(*ctx); | ||
| 285 | - wrapper_vmalloc_sync_all(); | ||
| 286 | + wrapper_vmalloc_sync_mappings(); | ||
| 287 | return 0; | ||
| 288 | } | ||
| 289 | EXPORT_SYMBOL_GPL(lttng_add_nice_to_ctx); | ||
| 290 | diff --git a/lttng-context-perf-counters.c b/lttng-context-perf-counters.c | ||
| 291 | index 43c4077..6b04d12 100644 | ||
| 292 | --- a/lttng-context-perf-counters.c | ||
| 293 | +++ b/lttng-context-perf-counters.c | ||
| 294 | @@ -321,7 +321,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type, | ||
| 295 | field->u.perf_counter = perf_field; | ||
| 296 | lttng_context_update(*ctx); | ||
| 297 | |||
| 298 | - wrapper_vmalloc_sync_all(); | ||
| 299 | + wrapper_vmalloc_sync_mappings(); | ||
| 300 | return 0; | ||
| 301 | |||
| 302 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) | ||
| 303 | diff --git a/lttng-context-pid-ns.c b/lttng-context-pid-ns.c | ||
| 304 | index f039f26..ccf629d 100644 | ||
| 305 | --- a/lttng-context-pid-ns.c | ||
| 306 | +++ b/lttng-context-pid-ns.c | ||
| 307 | @@ -98,7 +98,7 @@ int lttng_add_pid_ns_to_ctx(struct lttng_ctx **ctx) | ||
| 308 | field->record = pid_ns_record; | ||
| 309 | field->get_value = pid_ns_get_value; | ||
| 310 | lttng_context_update(*ctx); | ||
| 311 | - wrapper_vmalloc_sync_all(); | ||
| 312 | + wrapper_vmalloc_sync_mappings(); | ||
| 313 | return 0; | ||
| 314 | } | ||
| 315 | EXPORT_SYMBOL_GPL(lttng_add_pid_ns_to_ctx); | ||
| 316 | diff --git a/lttng-context-pid.c b/lttng-context-pid.c | ||
| 317 | index b3caabb..326eabe 100644 | ||
| 318 | --- a/lttng-context-pid.c | ||
| 319 | +++ b/lttng-context-pid.c | ||
| 320 | @@ -68,7 +68,7 @@ int lttng_add_pid_to_ctx(struct lttng_ctx **ctx) | ||
| 321 | field->record = pid_record; | ||
| 322 | field->get_value = pid_get_value; | ||
| 323 | lttng_context_update(*ctx); | ||
| 324 | - wrapper_vmalloc_sync_all(); | ||
| 325 | + wrapper_vmalloc_sync_mappings(); | ||
| 326 | return 0; | ||
| 327 | } | ||
| 328 | EXPORT_SYMBOL_GPL(lttng_add_pid_to_ctx); | ||
| 329 | diff --git a/lttng-context-ppid.c b/lttng-context-ppid.c | ||
| 330 | index ef84ad1..ff25288 100644 | ||
| 331 | --- a/lttng-context-ppid.c | ||
| 332 | +++ b/lttng-context-ppid.c | ||
| 333 | @@ -90,7 +90,7 @@ int lttng_add_ppid_to_ctx(struct lttng_ctx **ctx) | ||
| 334 | field->record = ppid_record; | ||
| 335 | field->get_value = ppid_get_value; | ||
| 336 | lttng_context_update(*ctx); | ||
| 337 | - wrapper_vmalloc_sync_all(); | ||
| 338 | + wrapper_vmalloc_sync_mappings(); | ||
| 339 | return 0; | ||
| 340 | } | ||
| 341 | EXPORT_SYMBOL_GPL(lttng_add_ppid_to_ctx); | ||
| 342 | diff --git a/lttng-context-preemptible.c b/lttng-context-preemptible.c | ||
| 343 | index 328f2a4..867805b 100644 | ||
| 344 | --- a/lttng-context-preemptible.c | ||
| 345 | +++ b/lttng-context-preemptible.c | ||
| 346 | @@ -86,7 +86,7 @@ int lttng_add_preemptible_to_ctx(struct lttng_ctx **ctx) | ||
| 347 | field->record = preemptible_record; | ||
| 348 | field->get_value = preemptible_get_value; | ||
| 349 | lttng_context_update(*ctx); | ||
| 350 | - wrapper_vmalloc_sync_all(); | ||
| 351 | + wrapper_vmalloc_sync_mappings(); | ||
| 352 | return 0; | ||
| 353 | } | ||
| 354 | EXPORT_SYMBOL_GPL(lttng_add_preemptible_to_ctx); | ||
| 355 | diff --git a/lttng-context-prio.c b/lttng-context-prio.c | ||
| 356 | index b5d21e7..367f7bd 100644 | ||
| 357 | --- a/lttng-context-prio.c | ||
| 358 | +++ b/lttng-context-prio.c | ||
| 359 | @@ -89,7 +89,7 @@ int lttng_add_prio_to_ctx(struct lttng_ctx **ctx) | ||
| 360 | field->record = prio_record; | ||
| 361 | field->get_value = prio_get_value; | ||
| 362 | lttng_context_update(*ctx); | ||
| 363 | - wrapper_vmalloc_sync_all(); | ||
| 364 | + wrapper_vmalloc_sync_mappings(); | ||
| 365 | return 0; | ||
| 366 | } | ||
| 367 | EXPORT_SYMBOL_GPL(lttng_add_prio_to_ctx); | ||
| 368 | diff --git a/lttng-context-procname.c b/lttng-context-procname.c | ||
| 369 | index 54007d1..8f18ca2 100644 | ||
| 370 | --- a/lttng-context-procname.c | ||
| 371 | +++ b/lttng-context-procname.c | ||
| 372 | @@ -72,7 +72,7 @@ int lttng_add_procname_to_ctx(struct lttng_ctx **ctx) | ||
| 373 | field->record = procname_record; | ||
| 374 | field->get_value = procname_get_value; | ||
| 375 | lttng_context_update(*ctx); | ||
| 376 | - wrapper_vmalloc_sync_all(); | ||
| 377 | + wrapper_vmalloc_sync_mappings(); | ||
| 378 | return 0; | ||
| 379 | } | ||
| 380 | EXPORT_SYMBOL_GPL(lttng_add_procname_to_ctx); | ||
| 381 | diff --git a/lttng-context-sgid.c b/lttng-context-sgid.c | ||
| 382 | index 61c8d53..2a58cbd 100644 | ||
| 383 | --- a/lttng-context-sgid.c | ||
| 384 | +++ b/lttng-context-sgid.c | ||
| 385 | @@ -70,7 +70,7 @@ int lttng_add_sgid_to_ctx(struct lttng_ctx **ctx) | ||
| 386 | field->record = sgid_record; | ||
| 387 | field->get_value = sgid_get_value; | ||
| 388 | lttng_context_update(*ctx); | ||
| 389 | - wrapper_vmalloc_sync_all(); | ||
| 390 | + wrapper_vmalloc_sync_mappings(); | ||
| 391 | return 0; | ||
| 392 | } | ||
| 393 | EXPORT_SYMBOL_GPL(lttng_add_sgid_to_ctx); | ||
| 394 | diff --git a/lttng-context-suid.c b/lttng-context-suid.c | ||
| 395 | index 66d3ef5..ab3e2a9 100644 | ||
| 396 | --- a/lttng-context-suid.c | ||
| 397 | +++ b/lttng-context-suid.c | ||
| 398 | @@ -70,7 +70,7 @@ int lttng_add_suid_to_ctx(struct lttng_ctx **ctx) | ||
| 399 | field->record = suid_record; | ||
| 400 | field->get_value = suid_get_value; | ||
| 401 | lttng_context_update(*ctx); | ||
| 402 | - wrapper_vmalloc_sync_all(); | ||
| 403 | + wrapper_vmalloc_sync_mappings(); | ||
| 404 | return 0; | ||
| 405 | } | ||
| 406 | EXPORT_SYMBOL_GPL(lttng_add_suid_to_ctx); | ||
| 407 | diff --git a/lttng-context-tid.c b/lttng-context-tid.c | ||
| 408 | index d2a20e6..f6defc4 100644 | ||
| 409 | --- a/lttng-context-tid.c | ||
| 410 | +++ b/lttng-context-tid.c | ||
| 411 | @@ -71,7 +71,7 @@ int lttng_add_tid_to_ctx(struct lttng_ctx **ctx) | ||
| 412 | field->record = tid_record; | ||
| 413 | field->get_value = tid_get_value; | ||
| 414 | lttng_context_update(*ctx); | ||
| 415 | - wrapper_vmalloc_sync_all(); | ||
| 416 | + wrapper_vmalloc_sync_mappings(); | ||
| 417 | return 0; | ||
| 418 | } | ||
| 419 | EXPORT_SYMBOL_GPL(lttng_add_tid_to_ctx); | ||
| 420 | diff --git a/lttng-context-uid.c b/lttng-context-uid.c | ||
| 421 | index 5f11de2..5593852 100644 | ||
| 422 | --- a/lttng-context-uid.c | ||
| 423 | +++ b/lttng-context-uid.c | ||
| 424 | @@ -70,7 +70,7 @@ int lttng_add_uid_to_ctx(struct lttng_ctx **ctx) | ||
| 425 | field->record = uid_record; | ||
| 426 | field->get_value = uid_get_value; | ||
| 427 | lttng_context_update(*ctx); | ||
| 428 | - wrapper_vmalloc_sync_all(); | ||
| 429 | + wrapper_vmalloc_sync_mappings(); | ||
| 430 | return 0; | ||
| 431 | } | ||
| 432 | EXPORT_SYMBOL_GPL(lttng_add_uid_to_ctx); | ||
| 433 | diff --git a/lttng-context-user-ns.c b/lttng-context-user-ns.c | ||
| 434 | index 746e4d9..0ed62e3 100644 | ||
| 435 | --- a/lttng-context-user-ns.c | ||
| 436 | +++ b/lttng-context-user-ns.c | ||
| 437 | @@ -82,7 +82,7 @@ int lttng_add_user_ns_to_ctx(struct lttng_ctx **ctx) | ||
| 438 | field->record = user_ns_record; | ||
| 439 | field->get_value = user_ns_get_value; | ||
| 440 | lttng_context_update(*ctx); | ||
| 441 | - wrapper_vmalloc_sync_all(); | ||
| 442 | + wrapper_vmalloc_sync_mappings(); | ||
| 443 | return 0; | ||
| 444 | } | ||
| 445 | EXPORT_SYMBOL_GPL(lttng_add_user_ns_to_ctx); | ||
| 446 | diff --git a/lttng-context-uts-ns.c b/lttng-context-uts-ns.c | ||
| 447 | index 7352a3d..283bc73 100644 | ||
| 448 | --- a/lttng-context-uts-ns.c | ||
| 449 | +++ b/lttng-context-uts-ns.c | ||
| 450 | @@ -96,7 +96,7 @@ int lttng_add_uts_ns_to_ctx(struct lttng_ctx **ctx) | ||
| 451 | field->record = uts_ns_record; | ||
| 452 | field->get_value = uts_ns_get_value; | ||
| 453 | lttng_context_update(*ctx); | ||
| 454 | - wrapper_vmalloc_sync_all(); | ||
| 455 | + wrapper_vmalloc_sync_mappings(); | ||
| 456 | return 0; | ||
| 457 | } | ||
| 458 | EXPORT_SYMBOL_GPL(lttng_add_uts_ns_to_ctx); | ||
| 459 | diff --git a/lttng-context-vegid.c b/lttng-context-vegid.c | ||
| 460 | index 604da2a..1431dac 100644 | ||
| 461 | --- a/lttng-context-vegid.c | ||
| 462 | +++ b/lttng-context-vegid.c | ||
| 463 | @@ -70,7 +70,7 @@ int lttng_add_vegid_to_ctx(struct lttng_ctx **ctx) | ||
| 464 | field->record = vegid_record; | ||
| 465 | field->get_value = vegid_get_value; | ||
| 466 | lttng_context_update(*ctx); | ||
| 467 | - wrapper_vmalloc_sync_all(); | ||
| 468 | + wrapper_vmalloc_sync_mappings(); | ||
| 469 | return 0; | ||
| 470 | } | ||
| 471 | EXPORT_SYMBOL_GPL(lttng_add_vegid_to_ctx); | ||
| 472 | diff --git a/lttng-context-veuid.c b/lttng-context-veuid.c | ||
| 473 | index 983ae6a..a1b5b70 100644 | ||
| 474 | --- a/lttng-context-veuid.c | ||
| 475 | +++ b/lttng-context-veuid.c | ||
| 476 | @@ -70,7 +70,7 @@ int lttng_add_veuid_to_ctx(struct lttng_ctx **ctx) | ||
| 477 | field->record = veuid_record; | ||
| 478 | field->get_value = veuid_get_value; | ||
| 479 | lttng_context_update(*ctx); | ||
| 480 | - wrapper_vmalloc_sync_all(); | ||
| 481 | + wrapper_vmalloc_sync_mappings(); | ||
| 482 | return 0; | ||
| 483 | } | ||
| 484 | EXPORT_SYMBOL_GPL(lttng_add_veuid_to_ctx); | ||
| 485 | diff --git a/lttng-context-vgid.c b/lttng-context-vgid.c | ||
| 486 | index e08c77d..0eed24e 100644 | ||
| 487 | --- a/lttng-context-vgid.c | ||
| 488 | +++ b/lttng-context-vgid.c | ||
| 489 | @@ -70,7 +70,7 @@ int lttng_add_vgid_to_ctx(struct lttng_ctx **ctx) | ||
| 490 | field->record = vgid_record; | ||
| 491 | field->get_value = vgid_get_value; | ||
| 492 | lttng_context_update(*ctx); | ||
| 493 | - wrapper_vmalloc_sync_all(); | ||
| 494 | + wrapper_vmalloc_sync_mappings(); | ||
| 495 | return 0; | ||
| 496 | } | ||
| 497 | EXPORT_SYMBOL_GPL(lttng_add_vgid_to_ctx); | ||
| 498 | diff --git a/lttng-context-vpid.c b/lttng-context-vpid.c | ||
| 499 | index 982ce55..b5b6ce0 100644 | ||
| 500 | --- a/lttng-context-vpid.c | ||
| 501 | +++ b/lttng-context-vpid.c | ||
| 502 | @@ -83,7 +83,7 @@ int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx) | ||
| 503 | field->record = vpid_record; | ||
| 504 | field->get_value = vpid_get_value; | ||
| 505 | lttng_context_update(*ctx); | ||
| 506 | - wrapper_vmalloc_sync_all(); | ||
| 507 | + wrapper_vmalloc_sync_mappings(); | ||
| 508 | return 0; | ||
| 509 | } | ||
| 510 | EXPORT_SYMBOL_GPL(lttng_add_vpid_to_ctx); | ||
| 511 | diff --git a/lttng-context-vppid.c b/lttng-context-vppid.c | ||
| 512 | index 66d6382..347ac63 100644 | ||
| 513 | --- a/lttng-context-vppid.c | ||
| 514 | +++ b/lttng-context-vppid.c | ||
| 515 | @@ -112,7 +112,7 @@ int lttng_add_vppid_to_ctx(struct lttng_ctx **ctx) | ||
| 516 | field->record = vppid_record; | ||
| 517 | field->get_value = vppid_get_value; | ||
| 518 | lttng_context_update(*ctx); | ||
| 519 | - wrapper_vmalloc_sync_all(); | ||
| 520 | + wrapper_vmalloc_sync_mappings(); | ||
| 521 | return 0; | ||
| 522 | } | ||
| 523 | EXPORT_SYMBOL_GPL(lttng_add_vppid_to_ctx); | ||
| 524 | diff --git a/lttng-context-vsgid.c b/lttng-context-vsgid.c | ||
| 525 | index aca5eda..3daf889 100644 | ||
| 526 | --- a/lttng-context-vsgid.c | ||
| 527 | +++ b/lttng-context-vsgid.c | ||
| 528 | @@ -70,7 +70,7 @@ int lttng_add_vsgid_to_ctx(struct lttng_ctx **ctx) | ||
| 529 | field->record = vsgid_record; | ||
| 530 | field->get_value = vsgid_get_value; | ||
| 531 | lttng_context_update(*ctx); | ||
| 532 | - wrapper_vmalloc_sync_all(); | ||
| 533 | + wrapper_vmalloc_sync_mappings(); | ||
| 534 | return 0; | ||
| 535 | } | ||
| 536 | EXPORT_SYMBOL_GPL(lttng_add_vsgid_to_ctx); | ||
| 537 | diff --git a/lttng-context-vsuid.c b/lttng-context-vsuid.c | ||
| 538 | index 66c1300..d7fb0db 100644 | ||
| 539 | --- a/lttng-context-vsuid.c | ||
| 540 | +++ b/lttng-context-vsuid.c | ||
| 541 | @@ -70,7 +70,7 @@ int lttng_add_vsuid_to_ctx(struct lttng_ctx **ctx) | ||
| 542 | field->record = vsuid_record; | ||
| 543 | field->get_value = vsuid_get_value; | ||
| 544 | lttng_context_update(*ctx); | ||
| 545 | - wrapper_vmalloc_sync_all(); | ||
| 546 | + wrapper_vmalloc_sync_mappings(); | ||
| 547 | return 0; | ||
| 548 | } | ||
| 549 | EXPORT_SYMBOL_GPL(lttng_add_vsuid_to_ctx); | ||
| 550 | diff --git a/lttng-context-vtid.c b/lttng-context-vtid.c | ||
| 551 | index 8fd68a8..e81ba0e 100644 | ||
| 552 | --- a/lttng-context-vtid.c | ||
| 553 | +++ b/lttng-context-vtid.c | ||
| 554 | @@ -83,7 +83,7 @@ int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx) | ||
| 555 | field->record = vtid_record; | ||
| 556 | field->get_value = vtid_get_value; | ||
| 557 | lttng_context_update(*ctx); | ||
| 558 | - wrapper_vmalloc_sync_all(); | ||
| 559 | + wrapper_vmalloc_sync_mappings(); | ||
| 560 | return 0; | ||
| 561 | } | ||
| 562 | EXPORT_SYMBOL_GPL(lttng_add_vtid_to_ctx); | ||
| 563 | diff --git a/lttng-context-vuid.c b/lttng-context-vuid.c | ||
| 564 | index 6ae575f..33e22d3 100644 | ||
| 565 | --- a/lttng-context-vuid.c | ||
| 566 | +++ b/lttng-context-vuid.c | ||
| 567 | @@ -70,7 +70,7 @@ int lttng_add_vuid_to_ctx(struct lttng_ctx **ctx) | ||
| 568 | field->record = vuid_record; | ||
| 569 | field->get_value = vuid_get_value; | ||
| 570 | lttng_context_update(*ctx); | ||
| 571 | - wrapper_vmalloc_sync_all(); | ||
| 572 | + wrapper_vmalloc_sync_mappings(); | ||
| 573 | return 0; | ||
| 574 | } | ||
| 575 | EXPORT_SYMBOL_GPL(lttng_add_vuid_to_ctx); | ||
| 576 | diff --git a/lttng-context.c b/lttng-context.c | ||
| 577 | index eb4534c..a6d4ee6 100644 | ||
| 578 | --- a/lttng-context.c | ||
| 579 | +++ b/lttng-context.c | ||
| 580 | @@ -11,7 +11,7 @@ | ||
| 581 | #include <linux/list.h> | ||
| 582 | #include <linux/mutex.h> | ||
| 583 | #include <linux/slab.h> | ||
| 584 | -#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_all() */ | ||
| 585 | +#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_mappings() */ | ||
| 586 | #include <lttng-events.h> | ||
| 587 | #include <lttng-tracer.h> | ||
| 588 | |||
| 589 | diff --git a/lttng-events.c b/lttng-events.c | ||
| 590 | index a1c8445..401f646 100644 | ||
| 591 | --- a/lttng-events.c | ||
| 592 | +++ b/lttng-events.c | ||
| 593 | @@ -30,7 +30,7 @@ | ||
| 594 | #include <linux/uuid.h> | ||
| 595 | #include <linux/dmi.h> | ||
| 596 | |||
| 597 | -#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_all() */ | ||
| 598 | +#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_mappings() */ | ||
| 599 | #include <wrapper/random.h> | ||
| 600 | #include <wrapper/tracepoint.h> | ||
| 601 | #include <wrapper/list.h> | ||
| 602 | @@ -2753,9 +2753,9 @@ end: | ||
| 603 | * Registers a transport which can be used as output to extract the data out of | ||
| 604 | * LTTng. The module calling this registration function must ensure that no | ||
| 605 | * trap-inducing code will be executed by the transport functions. E.g. | ||
| 606 | - * vmalloc_sync_all() must be called between a vmalloc and the moment the memory | ||
| 607 | + * vmalloc_sync_mappings() must be called between a vmalloc and the moment the memory | ||
| 608 | * is made visible to the transport function. This registration acts as a | ||
| 609 | - * vmalloc_sync_all. Therefore, only if the module allocates virtual memory | ||
| 610 | + * vmalloc_sync_mappings. Therefore, only if the module allocates virtual memory | ||
| 611 | * after its registration must it synchronize the TLBs. | ||
| 612 | */ | ||
| 613 | void lttng_transport_register(struct lttng_transport *transport) | ||
| 614 | @@ -2763,9 +2763,9 @@ void lttng_transport_register(struct lttng_transport *transport) | ||
| 615 | /* | ||
| 616 | * Make sure no page fault can be triggered by the module about to be | ||
| 617 | * registered. We deal with this here so we don't have to call | ||
| 618 | - * vmalloc_sync_all() in each module's init. | ||
| 619 | + * vmalloc_sync_mappings() in each module's init. | ||
| 620 | */ | ||
| 621 | - wrapper_vmalloc_sync_all(); | ||
| 622 | + wrapper_vmalloc_sync_mappings(); | ||
| 623 | |||
| 624 | mutex_lock(&sessions_mutex); | ||
| 625 | list_add_tail(&transport->node, <tng_transport_list); | ||
| 626 | diff --git a/lttng-ring-buffer-client.h b/lttng-ring-buffer-client.h | ||
| 627 | index d5c512c..ff62830 100644 | ||
| 628 | --- a/lttng-ring-buffer-client.h | ||
| 629 | +++ b/lttng-ring-buffer-client.h | ||
| 630 | @@ -10,7 +10,7 @@ | ||
| 631 | #include <linux/module.h> | ||
| 632 | #include <linux/types.h> | ||
| 633 | #include <lib/bitfield.h> | ||
| 634 | -#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_all() */ | ||
| 635 | +#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_mappings() */ | ||
| 636 | #include <wrapper/trace-clock.h> | ||
| 637 | #include <lttng-events.h> | ||
| 638 | #include <lttng-tracer.h> | ||
| 639 | @@ -766,7 +766,7 @@ static int __init lttng_ring_buffer_client_init(void) | ||
| 640 | * This vmalloc sync all also takes care of the lib ring buffer | ||
| 641 | * vmalloc'd module pages when it is built as a module into LTTng. | ||
| 642 | */ | ||
| 643 | - wrapper_vmalloc_sync_all(); | ||
| 644 | + wrapper_vmalloc_sync_mappings(); | ||
| 645 | lttng_transport_register(<tng_relay_transport); | ||
| 646 | return 0; | ||
| 647 | } | ||
| 648 | diff --git a/lttng-ring-buffer-metadata-client.h b/lttng-ring-buffer-metadata-client.h | ||
| 649 | index 17ffd75..a098b8d 100644 | ||
| 650 | --- a/lttng-ring-buffer-metadata-client.h | ||
| 651 | +++ b/lttng-ring-buffer-metadata-client.h | ||
| 652 | @@ -9,7 +9,7 @@ | ||
| 653 | |||
| 654 | #include <linux/module.h> | ||
| 655 | #include <linux/types.h> | ||
| 656 | -#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_all() */ | ||
| 657 | +#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_mappings() */ | ||
| 658 | #include <lttng-events.h> | ||
| 659 | #include <lttng-tracer.h> | ||
| 660 | |||
| 661 | @@ -428,7 +428,7 @@ static int __init lttng_ring_buffer_client_init(void) | ||
| 662 | * This vmalloc sync all also takes care of the lib ring buffer | ||
| 663 | * vmalloc'd module pages when it is built as a module into LTTng. | ||
| 664 | */ | ||
| 665 | - wrapper_vmalloc_sync_all(); | ||
| 666 | + wrapper_vmalloc_sync_mappings(); | ||
| 667 | lttng_transport_register(<tng_relay_transport); | ||
| 668 | return 0; | ||
| 669 | } | ||
| 670 | diff --git a/lttng-syscalls.c b/lttng-syscalls.c | ||
| 671 | index fb14f6b..97f1ba9 100644 | ||
| 672 | --- a/lttng-syscalls.c | ||
| 673 | +++ b/lttng-syscalls.c | ||
| 674 | @@ -760,7 +760,7 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter) | ||
| 675 | struct lttng_kernel_event ev; | ||
| 676 | int ret; | ||
| 677 | |||
| 678 | - wrapper_vmalloc_sync_all(); | ||
| 679 | + wrapper_vmalloc_sync_mappings(); | ||
| 680 | |||
| 681 | if (!chan->sc_table) { | ||
| 682 | /* create syscall table mapping syscall to events */ | ||
| 683 | diff --git a/probes/lttng-kprobes.c b/probes/lttng-kprobes.c | ||
| 684 | index c0a15e4..a44eaa1 100644 | ||
| 685 | --- a/probes/lttng-kprobes.c | ||
| 686 | +++ b/probes/lttng-kprobes.c | ||
| 687 | @@ -132,7 +132,7 @@ int lttng_kprobes_register(const char *name, | ||
| 688 | * Well.. kprobes itself puts the page fault handler on the blacklist, | ||
| 689 | * but we can never be too careful. | ||
| 690 | */ | ||
| 691 | - wrapper_vmalloc_sync_all(); | ||
| 692 | + wrapper_vmalloc_sync_mappings(); | ||
| 693 | |||
| 694 | ret = register_kprobe(&event->u.kprobe.kp); | ||
| 695 | if (ret) | ||
| 696 | diff --git a/probes/lttng-kretprobes.c b/probes/lttng-kretprobes.c | ||
| 697 | index 4b18d46..ab98ff2 100644 | ||
| 698 | --- a/probes/lttng-kretprobes.c | ||
| 699 | +++ b/probes/lttng-kretprobes.c | ||
| 700 | @@ -221,7 +221,7 @@ int lttng_kretprobes_register(const char *name, | ||
| 701 | * Well.. kprobes itself puts the page fault handler on the blacklist, | ||
| 702 | * but we can never be too careful. | ||
| 703 | */ | ||
| 704 | - wrapper_vmalloc_sync_all(); | ||
| 705 | + wrapper_vmalloc_sync_mappings(); | ||
| 706 | |||
| 707 | ret = register_kretprobe(<tng_krp->krp); | ||
| 708 | if (ret) | ||
| 709 | diff --git a/probes/lttng-tracepoint-event-impl.h b/probes/lttng-tracepoint-event-impl.h | ||
| 710 | index 321cdfa..77b8638 100644 | ||
| 711 | --- a/probes/lttng-tracepoint-event-impl.h | ||
| 712 | +++ b/probes/lttng-tracepoint-event-impl.h | ||
| 713 | @@ -15,7 +15,7 @@ | ||
| 714 | #include <probes/lttng.h> | ||
| 715 | #include <probes/lttng-types.h> | ||
| 716 | #include <probes/lttng-probe-user.h> | ||
| 717 | -#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_all() */ | ||
| 718 | +#include <wrapper/vmalloc.h> /* for wrapper_vmalloc_sync_mappings() */ | ||
| 719 | #include <wrapper/ringbuffer/frontend_types.h> | ||
| 720 | #include <wrapper/ringbuffer/backend.h> | ||
| 721 | #include <wrapper/rcu.h> | ||
| 722 | @@ -1391,7 +1391,7 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { | ||
| 723 | #ifndef TP_MODULE_NOINIT | ||
| 724 | static int TP_ID(__lttng_events_init__, TRACE_SYSTEM)(void) | ||
| 725 | { | ||
| 726 | - wrapper_vmalloc_sync_all(); | ||
| 727 | + wrapper_vmalloc_sync_mappings(); | ||
| 728 | return lttng_probe_register(&TP_ID(__probe_desc___, TRACE_SYSTEM)); | ||
| 729 | } | ||
| 730 | |||
| 731 | diff --git a/probes/lttng-uprobes.c b/probes/lttng-uprobes.c | ||
| 732 | index 64d8237..bc10128 100644 | ||
| 733 | --- a/probes/lttng-uprobes.c | ||
| 734 | +++ b/probes/lttng-uprobes.c | ||
| 735 | @@ -161,7 +161,7 @@ int lttng_uprobes_add_callsite(struct lttng_event *event, | ||
| 736 | } | ||
| 737 | |||
| 738 | /* Ensure the memory we just allocated don't trigger page faults. */ | ||
| 739 | - wrapper_vmalloc_sync_all(); | ||
| 740 | + wrapper_vmalloc_sync_mappings(); | ||
| 741 | |||
| 742 | uprobe_handler->event = event; | ||
| 743 | uprobe_handler->up_consumer.handler = lttng_uprobes_handler_pre; | ||
| 744 | diff --git a/probes/lttng.c b/probes/lttng.c | ||
| 745 | index 383202c..05bc138 100644 | ||
| 746 | --- a/probes/lttng.c | ||
| 747 | +++ b/probes/lttng.c | ||
| 748 | @@ -116,7 +116,7 @@ int __init lttng_logger_init(void) | ||
| 749 | { | ||
| 750 | int ret = 0; | ||
| 751 | |||
| 752 | - wrapper_vmalloc_sync_all(); | ||
| 753 | + wrapper_vmalloc_sync_mappings(); | ||
| 754 | |||
| 755 | /* /dev/lttng-logger */ | ||
| 756 | ret = misc_register(&logger_dev); | ||
| 757 | diff --git a/tests/probes/lttng-test.c b/tests/probes/lttng-test.c | ||
| 758 | index e347639..b450e7d 100644 | ||
| 759 | --- a/tests/probes/lttng-test.c | ||
| 760 | +++ b/tests/probes/lttng-test.c | ||
| 761 | @@ -97,7 +97,7 @@ int __init lttng_test_init(void) | ||
| 762 | int ret = 0; | ||
| 763 | |||
| 764 | (void) wrapper_lttng_fixup_sig(THIS_MODULE); | ||
| 765 | - wrapper_vmalloc_sync_all(); | ||
| 766 | + wrapper_vmalloc_sync_mappings(); | ||
| 767 | lttng_test_filter_event_dentry = | ||
| 768 | proc_create_data(LTTNG_TEST_FILTER_EVENT_FILE, | ||
| 769 | S_IRUGO | S_IWUGO, NULL, | ||
| 770 | diff --git a/wrapper/vmalloc.h b/wrapper/vmalloc.h | ||
| 771 | index 0c3eb86..54715b5 100644 | ||
| 772 | --- a/wrapper/vmalloc.h | ||
| 773 | +++ b/wrapper/vmalloc.h | ||
| 774 | @@ -21,8 +21,35 @@ | ||
| 775 | #include <linux/kallsyms.h> | ||
| 776 | #include <wrapper/kallsyms.h> | ||
| 777 | |||
| 778 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) | ||
| 779 | + | ||
| 780 | +static inline | ||
| 781 | +void wrapper_vmalloc_sync_mappings(void) | ||
| 782 | +{ | ||
| 783 | + void (*vmalloc_sync_mappings_sym)(void); | ||
| 784 | + | ||
| 785 | + vmalloc_sync_mappings_sym = (void *) kallsyms_lookup_funcptr("vmalloc_sync_mappings"); | ||
| 786 | + if (vmalloc_sync_mappings_sym) { | ||
| 787 | + vmalloc_sync_mappings_sym(); | ||
| 788 | + } else { | ||
| 789 | +#ifdef CONFIG_X86 | ||
| 790 | + /* | ||
| 791 | + * Only x86 needs vmalloc_sync_mappings to make sure LTTng does not | ||
| 792 | + * trigger recursive page faults. | ||
| 793 | + */ | ||
| 794 | + printk_once(KERN_WARNING "LTTng: vmalloc_sync_mappings symbol lookup failed.\n"); | ||
| 795 | + printk_once(KERN_WARNING "Page fault handler and NMI tracing might trigger faults.\n"); | ||
| 796 | +#endif | ||
| 797 | + } | ||
| 798 | +} | ||
| 799 | + | ||
| 800 | +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */ | ||
| 801 | + | ||
| 802 | +/* | ||
| 803 | + * Map vmalloc_sync_mappings to vmalloc_sync_all() on kernels before 5.7. | ||
| 804 | + */ | ||
| 805 | static inline | ||
| 806 | -void wrapper_vmalloc_sync_all(void) | ||
| 807 | +void wrapper_vmalloc_sync_mappings(void) | ||
| 808 | { | ||
| 809 | void (*vmalloc_sync_all_sym)(void); | ||
| 810 | |||
| 811 | @@ -40,13 +67,29 @@ void wrapper_vmalloc_sync_all(void) | ||
| 812 | #endif | ||
| 813 | } | ||
| 814 | } | ||
| 815 | + | ||
| 816 | +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */ | ||
| 817 | + | ||
| 818 | #else | ||
| 819 | |||
| 820 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) | ||
| 821 | + | ||
| 822 | +static inline | ||
| 823 | +void wrapper_vmalloc_sync_mappings(void) | ||
| 824 | +{ | ||
| 825 | + return vmalloc_sync_mappings(); | ||
| 826 | +} | ||
| 827 | + | ||
| 828 | +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */ | ||
| 829 | + | ||
| 830 | static inline | ||
| 831 | -void wrapper_vmalloc_sync_all(void) | ||
| 832 | +void wrapper_vmalloc_sync_mappings(void) | ||
| 833 | { | ||
| 834 | return vmalloc_sync_all(); | ||
| 835 | } | ||
| 836 | + | ||
| 837 | +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */ | ||
| 838 | + | ||
| 839 | #endif | ||
| 840 | |||
| 841 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)) | ||
| 842 | @@ -61,7 +104,7 @@ void *lttng_kvmalloc_node(unsigned long size, gfp_t flags, int node) | ||
| 843 | * Make sure we don't trigger recursive page faults in the | ||
| 844 | * tracing fast path. | ||
| 845 | */ | ||
| 846 | - wrapper_vmalloc_sync_all(); | ||
| 847 | + wrapper_vmalloc_sync_mappings(); | ||
| 848 | } | ||
| 849 | return ret; | ||
| 850 | } | ||
| 851 | -- | ||
| 852 | 2.17.1 | ||
| 853 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-missing-wrapper-rename-to-wrapper_vmalloc_sync_m.patch b/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-missing-wrapper-rename-to-wrapper_vmalloc_sync_m.patch new file mode 100644 index 0000000000..807fe933cd --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0002-Fix-missing-wrapper-rename-to-wrapper_vmalloc_sync_m.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | From 4d1817c129310945bf0b8227ebc0fbb4f6299dc7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Michael Jeanson <mjeanson@efficios.com> | ||
| 3 | Date: Wed, 6 May 2020 11:03:32 -0400 | ||
| 4 | Subject: [PATCH 2/4] Fix: missing wrapper rename to | ||
| 5 | wrapper_vmalloc_sync_mappings | ||
| 6 | |||
| 7 | Upstream-Status: Backport [https://github.com/lttng/lttng-modules/commit/c1ba644f2edf6a5bc030111ce4167a8798cc1053] | ||
| 8 | |||
| 9 | Signed-off-by: Michael Jeanson <mjeanson@efficios.com> | ||
| 10 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
| 11 | Change-Id: Idf7082a980c5a604bfef5c69906678b5083a9bbf | ||
| 12 | Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> | ||
| 13 | --- | ||
| 14 | wrapper/vmalloc.h | 2 +- | ||
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/wrapper/vmalloc.h b/wrapper/vmalloc.h | ||
| 18 | index 54715b5..5d0b389 100644 | ||
| 19 | --- a/wrapper/vmalloc.h | ||
| 20 | +++ b/wrapper/vmalloc.h | ||
| 21 | @@ -216,7 +216,7 @@ void *lttng_kvmalloc_node(unsigned long size, gfp_t flags, int node) | ||
| 22 | * Make sure we don't trigger recursive page faults in the | ||
| 23 | * tracing fast path. | ||
| 24 | */ | ||
| 25 | - wrapper_vmalloc_sync_all(); | ||
| 26 | + wrapper_vmalloc_sync_mappings(); | ||
| 27 | } | ||
| 28 | return ret; | ||
| 29 | } | ||
| 30 | -- | ||
| 31 | 2.17.1 | ||
| 32 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-Use-vmalloc_sync_mappings-on-kernel-5.6-as-well.patch b/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-Use-vmalloc_sync_mappings-on-kernel-5.6-as-well.patch new file mode 100644 index 0000000000..48d7e2f00c --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0003-Fix-Use-vmalloc_sync_mappings-on-kernel-5.6-as-well.patch | |||
| @@ -0,0 +1,88 @@ | |||
| 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 | ||
| 5 | |||
| 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 | ||
| 9 | v5.6 | ||
| 10 | v5.6-rc7 | ||
| 11 | v5.7-rc1 | ||
| 12 | v5.7-rc2 | ||
| 13 | v5.7-rc3 | ||
| 14 | |||
| 15 | Extend the LINUX_VERSION_CODE check to v5.6 to fix the following warnings: | ||
| 16 | ... | ||
| 17 | [ 483.242037] LTTng: vmalloc_sync_all symbol lookup failed. | ||
| 18 | [ 483.257056] Page fault handler and NMI tracing might trigger faults. | ||
| 19 | ... | ||
| 20 | |||
| 21 | [1] https://github.com/torvalds/linux/commit/763802b53a427ed3cbd419dbba255c414fdd9e7c | ||
| 22 | |||
| 23 | Upstream-Status: Backport [https://github.com/lttng/lttng-modules/commit/da356b324dfc160e09b8966b691792037badf455] | ||
| 24 | |||
| 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> | ||
| 28 | --- | ||
| 29 | wrapper/vmalloc.h | 12 ++++++------ | ||
| 30 | 1 file changed, 6 insertions(+), 6 deletions(-) | ||
| 31 | |||
| 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 | ||
| 36 | @@ -21,7 +21,7 @@ | ||
| 37 | #include <linux/kallsyms.h> | ||
| 38 | #include <wrapper/kallsyms.h> | ||
| 39 | |||
| 40 | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) | ||
| 41 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) | ||
| 42 | |||
| 43 | static inline | ||
| 44 | void wrapper_vmalloc_sync_mappings(void) | ||
| 45 | @@ -43,7 +43,7 @@ void wrapper_vmalloc_sync_mappings(void) | ||
| 46 | } | ||
| 47 | } | ||
| 48 | |||
| 49 | -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */ | ||
| 50 | +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) */ | ||
| 51 | |||
| 52 | /* | ||
| 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) | ||
| 55 | } | ||
| 56 | } | ||
| 57 | |||
| 58 | -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */ | ||
| 59 | +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) */ | ||
| 60 | |||
| 61 | #else | ||
| 62 | |||
| 63 | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) | ||
| 64 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) | ||
| 65 | |||
| 66 | static inline | ||
| 67 | void wrapper_vmalloc_sync_mappings(void) | ||
| 68 | @@ -80,7 +80,7 @@ void wrapper_vmalloc_sync_mappings(void) | ||
| 69 | return vmalloc_sync_mappings(); | ||
| 70 | } | ||
| 71 | |||
| 72 | -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */ | ||
| 73 | +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) */ | ||
| 74 | |||
| 75 | static inline | ||
| 76 | void wrapper_vmalloc_sync_mappings(void) | ||
| 77 | @@ -88,7 +88,7 @@ void wrapper_vmalloc_sync_mappings(void) | ||
| 78 | return vmalloc_sync_all(); | ||
| 79 | } | ||
| 80 | |||
| 81 | -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */ | ||
| 82 | +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) */ | ||
| 83 | |||
| 84 | #endif | ||
| 85 | |||
| 86 | -- | ||
| 87 | 2.17.1 | ||
| 88 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules/0004-Update-Use-vmalloc_sync_mappings-for-stable-kernels.patch b/meta/recipes-kernel/lttng/lttng-modules/0004-Update-Use-vmalloc_sync_mappings-for-stable-kernels.patch new file mode 100644 index 0000000000..a0b870486f --- /dev/null +++ b/meta/recipes-kernel/lttng/lttng-modules/0004-Update-Use-vmalloc_sync_mappings-for-stable-kernels.patch | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | From f419315f28a1da656c4faa8a852a2928ce38c72d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ovidiu Panait <ovidiu.panait@windriver.com> | ||
| 3 | Date: Thu, 14 May 2020 14:27:17 +0300 | ||
| 4 | Subject: [PATCH 4/4] Update: Use vmalloc_sync_mappings for stable kernels | ||
| 5 | |||
| 6 | Starting from v5.4.28/v5.2.37/v4.19.113/v4.14.175/v4.9.218/v4.4.218, stable | ||
| 7 | kernel branches backported v5.6 upstream commit [1], causing the following | ||
| 8 | warnings: | ||
| 9 | ... | ||
| 10 | [ 483.242037] LTTng: vmalloc_sync_all symbol lookup failed. | ||
| 11 | [ 483.257056] Page fault handler and NMI tracing might trigger faults. | ||
| 12 | ... | ||
| 13 | |||
| 14 | Extend check for vmalloc_sync_mappings for stable kernels as well. | ||
| 15 | |||
| 16 | [1] https://github.com/torvalds/linux/commit/763802b53a427ed3cbd419dbba255c414fdd9e7c | ||
| 17 | |||
| 18 | [ Edit: minor coding style fix by Mathieu Desnoyers. ] | ||
| 19 | |||
| 20 | Upstream-Status: Backport [https://github.com/lttng/lttng-modules/commit/5939591f87dc291bc858caf72decfb8569d802e3] | ||
| 21 | |||
| 22 | Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> | ||
| 23 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | ||
| 24 | Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> | ||
| 25 | --- | ||
| 26 | wrapper/vmalloc.h | 17 +++++++++++++++-- | ||
| 27 | 1 file changed, 15 insertions(+), 2 deletions(-) | ||
| 28 | |||
| 29 | diff --git a/wrapper/vmalloc.h b/wrapper/vmalloc.h | ||
| 30 | index d905f60..c7538ae 100644 | ||
| 31 | --- a/wrapper/vmalloc.h | ||
| 32 | +++ b/wrapper/vmalloc.h | ||
| 33 | @@ -20,8 +20,15 @@ | ||
| 34 | |||
| 35 | #include <linux/kallsyms.h> | ||
| 36 | #include <wrapper/kallsyms.h> | ||
| 37 | +#include <lttng-kernel-version.h> | ||
| 38 | |||
| 39 | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) | ||
| 40 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) \ | ||
| 41 | + || LTTNG_KERNEL_RANGE(5,4,28, 5,5,0) \ | ||
| 42 | + || LTTNG_KERNEL_RANGE(5,2,37, 5,3,0) \ | ||
| 43 | + || LTTNG_KERNEL_RANGE(4,19,113, 4,20,0) \ | ||
| 44 | + || LTTNG_KERNEL_RANGE(4,14,175, 4,15,0) \ | ||
| 45 | + || LTTNG_KERNEL_RANGE(4,9,218, 4,10,0) \ | ||
| 46 | + || LTTNG_KERNEL_RANGE(4,4,218, 4,5,0)) | ||
| 47 | |||
| 48 | static inline | ||
| 49 | void wrapper_vmalloc_sync_mappings(void) | ||
| 50 | @@ -72,7 +79,13 @@ void wrapper_vmalloc_sync_mappings(void) | ||
| 51 | |||
| 52 | #else | ||
| 53 | |||
| 54 | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)) | ||
| 55 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) \ | ||
| 56 | + || LTTNG_KERNEL_RANGE(5,4,28, 5,5,0) \ | ||
| 57 | + || LTTNG_KERNEL_RANGE(5,2,37, 5,3,0) \ | ||
| 58 | + || LTTNG_KERNEL_RANGE(4,19,113, 4,20,0) \ | ||
| 59 | + || LTTNG_KERNEL_RANGE(4,14,175, 4,15,0) \ | ||
| 60 | + || LTTNG_KERNEL_RANGE(4,9,218, 4,10,0) \ | ||
| 61 | + || LTTNG_KERNEL_RANGE(4,4,218, 4,5,0)) | ||
| 62 | |||
| 63 | static inline | ||
| 64 | void wrapper_vmalloc_sync_mappings(void) | ||
| 65 | -- | ||
| 66 | 2.17.1 | ||
| 67 | |||
diff --git a/meta/recipes-kernel/lttng/lttng-modules_2.12.0.bb b/meta/recipes-kernel/lttng/lttng-modules_2.12.0.bb index f706f89621..4a6c42e3bf 100644 --- a/meta/recipes-kernel/lttng/lttng-modules_2.12.0.bb +++ b/meta/recipes-kernel/lttng/lttng-modules_2.12.0.bb | |||
| @@ -11,6 +11,10 @@ COMPATIBLE_HOST = '(x86_64|i.86|powerpc|aarch64|mips|nios2|arm|riscv).*-linux' | |||
| 11 | SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \ | 11 | SRC_URI = "https://lttng.org/files/${BPN}/${BPN}-${PV}.tar.bz2 \ |
| 12 | file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch \ | 12 | file://Makefile-Do-not-fail-if-CONFIG_TRACEPOINTS-is-not-en.patch \ |
| 13 | file://BUILD_RUNTIME_BUG_ON-vs-gcc7.patch \ | 13 | file://BUILD_RUNTIME_BUG_ON-vs-gcc7.patch \ |
| 14 | file://0001-Update-for-kernel-5.7-use-vmalloc_sync_mappings-on-k.patch \ | ||
| 15 | file://0002-Fix-missing-wrapper-rename-to-wrapper_vmalloc_sync_m.patch \ | ||
| 16 | file://0003-Fix-Use-vmalloc_sync_mappings-on-kernel-5.6-as-well.patch \ | ||
| 17 | file://0004-Update-Use-vmalloc_sync_mappings-for-stable-kernels.patch \ | ||
| 14 | " | 18 | " |
| 15 | 19 | ||
| 16 | SRC_URI[md5sum] = "be252df5013ea03894921d0b493c7b6c" | 20 | SRC_URI[md5sum] = "be252df5013ea03894921d0b493c7b6c" |
