Update for kernel 5.7: use vmalloc_sync_mappings on kernels >= 5.7
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 5 May 2020 17:38:31 +0000 (13:38 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 5 May 2020 17:39:32 +0000 (13:39 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
50 files changed:
lib/ringbuffer/ring_buffer_backend.c
lttng-abi.c
lttng-context-callstack.c
lttng-context-cgroup-ns.c
lttng-context-cpu-id.c
lttng-context-egid.c
lttng-context-euid.c
lttng-context-gid.c
lttng-context-hostname.c
lttng-context-interruptible.c
lttng-context-ipc-ns.c
lttng-context-migratable.c
lttng-context-mnt-ns.c
lttng-context-need-reschedule.c
lttng-context-net-ns.c
lttng-context-nice.c
lttng-context-perf-counters.c
lttng-context-pid-ns.c
lttng-context-pid.c
lttng-context-ppid.c
lttng-context-preemptible.c
lttng-context-prio.c
lttng-context-procname.c
lttng-context-sgid.c
lttng-context-suid.c
lttng-context-tid.c
lttng-context-uid.c
lttng-context-user-ns.c
lttng-context-uts-ns.c
lttng-context-vegid.c
lttng-context-veuid.c
lttng-context-vgid.c
lttng-context-vpid.c
lttng-context-vppid.c
lttng-context-vsgid.c
lttng-context-vsuid.c
lttng-context-vtid.c
lttng-context-vuid.c
lttng-context.c
lttng-events.c
lttng-ring-buffer-client.h
lttng-ring-buffer-metadata-client.h
lttng-syscalls.c
probes/lttng-kprobes.c
probes/lttng-kretprobes.c
probes/lttng-tracepoint-event-impl.h
probes/lttng-uprobes.c
probes/lttng.c
tests/probes/lttng-test.c
wrapper/vmalloc.h

index 468b0e9b86715809dbb7876c64a246a00f401cf0..2a47948e3efa6597d12018364e58c0c7e739d9d9 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/vmalloc.h>
 
 #include <wrapper/mm.h>
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
+#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_mappings() */
 #include <wrapper/ringbuffer/config.h>
 #include <wrapper/ringbuffer/backend.h>
 #include <wrapper/ringbuffer/frontend.h>
@@ -156,7 +156,7 @@ int lib_ring_buffer_backend_allocate(const struct lib_ring_buffer_config *config
         * If kmalloc ever uses vmalloc underneath, make sure the buffer pages
         * will not fault.
         */
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        wrapper_clear_current_oom_origin();
        vfree(pages);
        return 0;
index 590945c4e8ee146dd52184b0413e6cdd1a326ee1..4051264e5e908fddd8c98e1ec13607dec63dc67f 100644 (file)
@@ -30,7 +30,7 @@
 #include <linux/uaccess.h>
 #include <linux/slab.h>
 #include <linux/err.h>
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
+#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_mappings() */
 #include <wrapper/ringbuffer/vfs.h>
 #include <wrapper/ringbuffer/backend.h>
 #include <wrapper/ringbuffer/frontend.h>
@@ -1938,7 +1938,7 @@ int __init lttng_abi_init(void)
 {
        int ret = 0;
 
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        lttng_clock_ref();
 
        ret = lttng_tp_mempool_init();
index 317efdf4f7eeb9b438f0679e8f46f2610fe6e8c3..1e791f9c5b24eaa62bad40fe079d5432be5c095c 100644 (file)
@@ -152,7 +152,7 @@ int __lttng_add_callstack_generic(struct lttng_ctx **ctx,
        sequence_field->priv = fdata;
        sequence_field->destroy = lttng_callstack_sequence_destroy;
 
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 
 error_create:
index a7f4e80f6565068b824efc0a526a7864a81689b5..ced8c1246528e0d3ea8c0f347b0e2b61020b4e82 100644 (file)
@@ -97,7 +97,7 @@ int lttng_add_cgroup_ns_to_ctx(struct lttng_ctx **ctx)
        field->record = cgroup_ns_record;
        field->get_value = cgroup_ns_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_cgroup_ns_to_ctx);
index d3d55b8891a8516eccc670bd125541e8216563ae..20c186a43bd54c63967e2039b9286182ff0c26dc 100644 (file)
@@ -68,7 +68,7 @@ int lttng_add_cpu_id_to_ctx(struct lttng_ctx **ctx)
        field->record = cpu_id_record;
        field->get_value = cpu_id_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_cpu_id_to_ctx);
index fcd01461fdbacf5aa21aaf89fb8c7f2ece377617..6ec3922443e6a296cd3ce5a17abdab84754d546b 100644 (file)
@@ -70,7 +70,7 @@ int lttng_add_egid_to_ctx(struct lttng_ctx **ctx)
        field->record = egid_record;
        field->get_value = egid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_egid_to_ctx);
index b4b72184ea18c3a9b50fb42c3c2607f2b6010065..2895cef94186eb023b62149394bde503553a71b2 100644 (file)
@@ -70,7 +70,7 @@ int lttng_add_euid_to_ctx(struct lttng_ctx **ctx)
        field->record = euid_record;
        field->get_value = euid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_euid_to_ctx);
index 586934ed5b960a1b57cb7478c1621170f5cae4d1..ebdbc737ec5f5aec2eb5cf0b33e46b35fb1ae721 100644 (file)
@@ -70,7 +70,7 @@ int lttng_add_gid_to_ctx(struct lttng_ctx **ctx)
        field->record = gid_record;
        field->get_value = gid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_gid_to_ctx);
index 0bbb1c78d78f3479000d1672585187408e3dbccf..a16da3507de719e7a8468f96aa268018103de916 100644 (file)
@@ -100,7 +100,7 @@ int lttng_add_hostname_to_ctx(struct lttng_ctx **ctx)
        field->record = hostname_record;
        field->get_value = hostname_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_hostname_to_ctx);
index c07cba18f984ce30cc5e23c57fbb2928269940b1..c9faaa7f66330a1f9d0c4f330cb38936470bdf41 100644 (file)
@@ -75,7 +75,7 @@ int lttng_add_interruptible_to_ctx(struct lttng_ctx **ctx)
        field->record = interruptible_record;
        field->get_value = interruptible_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_interruptible_to_ctx);
index cccd976602b7ec97118d50d959eae28731aa878d..7171928c706138ace4f8f4f8fd77250225ad3acc 100644 (file)
@@ -96,7 +96,7 @@ int lttng_add_ipc_ns_to_ctx(struct lttng_ctx **ctx)
        field->record = ipc_ns_record;
        field->get_value = ipc_ns_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_ipc_ns_to_ctx);
index 1a0dc4a13bd15d7de53a7bdee8e58ead9dd9bc48..08a55f4b59b7de14345d377a4595c03819477b86 100644 (file)
@@ -68,7 +68,7 @@ int lttng_add_migratable_to_ctx(struct lttng_ctx **ctx)
        field->record = migratable_record;
        field->get_value = migratable_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_migratable_to_ctx);
index 029401396cf24a73122be447a549e31b078caefc..539b043bd37e3d4d486caa4efb640e02a5e131eb 100644 (file)
@@ -98,7 +98,7 @@ int lttng_add_mnt_ns_to_ctx(struct lttng_ctx **ctx)
        field->record = mnt_ns_record;
        field->get_value = mnt_ns_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_mnt_ns_to_ctx);
index 9a51f0c60714df4a47f05dd1b56be406f6c17a06..dc404076452d490b45477d7fdd1904e7aa20b72d 100644 (file)
@@ -68,7 +68,7 @@ int lttng_add_need_reschedule_to_ctx(struct lttng_ctx **ctx)
        field->record = need_reschedule_record;
        field->get_value = need_reschedule_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_need_reschedule_to_ctx);
index 4584991f2e0b582e077f2769e9976d09c43f2325..06088a51e94c725662088ae54272e79c6c77344a 100644 (file)
@@ -97,7 +97,7 @@ int lttng_add_net_ns_to_ctx(struct lttng_ctx **ctx)
        field->record = net_ns_record;
        field->get_value = net_ns_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_net_ns_to_ctx);
index 89283d0f82472f4434ddaff91df029ed30ce4186..271f2049ab2452a4d0aaced774c5a0b4988fcc27 100644 (file)
@@ -68,7 +68,7 @@ int lttng_add_nice_to_ctx(struct lttng_ctx **ctx)
        field->record = nice_record;
        field->get_value = nice_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_nice_to_ctx);
index 1c5ab9fbc99e67b6a455aad9c1cf19693b3eadde..be26e4955fef58b533a16ff335669b205ea2d28f 100644 (file)
@@ -321,7 +321,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type,
        field->u.perf_counter = perf_field;
        lttng_context_update(*ctx);
 
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
index e4d3a3a3a5331840a15b7bad6392390cb9e20613..90c21dead4bea48513f8204e3bb0202a11467e97 100644 (file)
@@ -98,7 +98,7 @@ int lttng_add_pid_ns_to_ctx(struct lttng_ctx **ctx)
        field->record = pid_ns_record;
        field->get_value = pid_ns_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_pid_ns_to_ctx);
index 3cdc51284588994a164c38bbdc72b7dfe5d4ed6d..b8155ea8dbb1456300fa8645a026bd5eae60ab33 100644 (file)
@@ -68,7 +68,7 @@ int lttng_add_pid_to_ctx(struct lttng_ctx **ctx)
        field->record = pid_record;
        field->get_value = pid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_pid_to_ctx);
index 8935fad019256b5aeef441a6fcec2afeeee2c1cc..13a521bdfc3a1efcfecb2647480b9501e6caa88f 100644 (file)
@@ -90,7 +90,7 @@ int lttng_add_ppid_to_ctx(struct lttng_ctx **ctx)
        field->record = ppid_record;
        field->get_value = ppid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_ppid_to_ctx);
index 6a40f03a266bf44d66fa474c8ef84db26ec9a515..95a385478c759faf4b9010c56203901423f8298f 100644 (file)
@@ -86,7 +86,7 @@ int lttng_add_preemptible_to_ctx(struct lttng_ctx **ctx)
        field->record = preemptible_record;
        field->get_value = preemptible_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_preemptible_to_ctx);
index 9cd843d5437e45af1a2afe9fd924cff247dcc254..6441b5f1f4c38726bdd25ce57ae09b8b24271c5a 100644 (file)
@@ -89,7 +89,7 @@ int lttng_add_prio_to_ctx(struct lttng_ctx **ctx)
        field->record = prio_record;
        field->get_value = prio_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_prio_to_ctx);
index 8e4bbf97b52bb8485cc2f7b99c252a247bdb0f5a..fc40f6cf8f55f798d4452c231562724786a67c18 100644 (file)
@@ -71,7 +71,7 @@ int lttng_add_procname_to_ctx(struct lttng_ctx **ctx)
        field->record = procname_record;
        field->get_value = procname_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_procname_to_ctx);
index 4f58a14f680e4332d33420529a52c1a5f942bf62..81fa3f1070fd2f38fdf0c47b53a440a48554be74 100644 (file)
@@ -70,7 +70,7 @@ int lttng_add_sgid_to_ctx(struct lttng_ctx **ctx)
        field->record = sgid_record;
        field->get_value = sgid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_sgid_to_ctx);
index 4b8477e50a9655613daf664ebe488d988d4e083f..5f1ce3cd175daf26befe7730a09567ffb4334035 100644 (file)
@@ -70,7 +70,7 @@ int lttng_add_suid_to_ctx(struct lttng_ctx **ctx)
        field->record = suid_record;
        field->get_value = suid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_suid_to_ctx);
index 5f8e68fac7e6fa4386fce87fc2006923e7973ff6..efeca439010c603256dc5cc8e2c82ef94c5d2bc7 100644 (file)
@@ -71,7 +71,7 @@ int lttng_add_tid_to_ctx(struct lttng_ctx **ctx)
        field->record = tid_record;
        field->get_value = tid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_tid_to_ctx);
index c7a2bb180bad663b60737e346e04059dcee4b28b..3942e94afa1636c048118de82662452e2e74643e 100644 (file)
@@ -70,7 +70,7 @@ int lttng_add_uid_to_ctx(struct lttng_ctx **ctx)
        field->record = uid_record;
        field->get_value = uid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_uid_to_ctx);
index ff56f551ae5e1ac4aaccabeccbdc45f8863e0b47..45db066d9025f9ccfcee5ded0223373eb368de2c 100644 (file)
@@ -82,7 +82,7 @@ int lttng_add_user_ns_to_ctx(struct lttng_ctx **ctx)
        field->record = user_ns_record;
        field->get_value = user_ns_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_user_ns_to_ctx);
index 67c42764fcc84cce391050639e120d495657a7dc..26bdfa8354300a11a31d4a6d8f0f3fd655f62296 100644 (file)
@@ -96,7 +96,7 @@ int lttng_add_uts_ns_to_ctx(struct lttng_ctx **ctx)
        field->record = uts_ns_record;
        field->get_value = uts_ns_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_uts_ns_to_ctx);
index 501b01e6eb425411e5924e24dd7d6c0db06f3e75..029658b6465e0ddbe4a138efbc860005a7fbc6dd 100644 (file)
@@ -70,7 +70,7 @@ int lttng_add_vegid_to_ctx(struct lttng_ctx **ctx)
        field->record = vegid_record;
        field->get_value = vegid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vegid_to_ctx);
index a8810a770f7c0fda9b0d94f71cd6175bab0e1a61..211a16514e53d000357107ba2a9c3d5c721b62fa 100644 (file)
@@ -70,7 +70,7 @@ int lttng_add_veuid_to_ctx(struct lttng_ctx **ctx)
        field->record = veuid_record;
        field->get_value = veuid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_veuid_to_ctx);
index 92ac567b828b1a8f8ec615252d647696e400c5a7..a7b70d847192a983a15d407f466710a3ecbf3429 100644 (file)
@@ -70,7 +70,7 @@ int lttng_add_vgid_to_ctx(struct lttng_ctx **ctx)
        field->record = vgid_record;
        field->get_value = vgid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vgid_to_ctx);
index 31a2c15e48dee190e08ca1120205521d01b5c89b..544215cb9f1f575cc64cb7f07cde41b7f24c3d5a 100644 (file)
@@ -83,7 +83,7 @@ int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx)
        field->record = vpid_record;
        field->get_value = vpid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vpid_to_ctx);
index 43bfcc1249e10d8901ed7e264ffbbd24d659aad7..87dd3d0d6e1745e5c6548cbfcc7c1fa43dbdbae3 100644 (file)
@@ -112,7 +112,7 @@ int lttng_add_vppid_to_ctx(struct lttng_ctx **ctx)
        field->record = vppid_record;
        field->get_value = vppid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vppid_to_ctx);
index 20987ddec5fc1dec255f7a83dd91636bb91177e2..b82e4eab6d5b5b71d13e413a352e36ab1c73e433 100644 (file)
@@ -70,7 +70,7 @@ int lttng_add_vsgid_to_ctx(struct lttng_ctx **ctx)
        field->record = vsgid_record;
        field->get_value = vsgid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vsgid_to_ctx);
index 7cefd53532f95387e574ec15b8f69f25f11ce0fc..71a40d59b10f54762c3cb48da75512e30db0f23f 100644 (file)
@@ -70,7 +70,7 @@ int lttng_add_vsuid_to_ctx(struct lttng_ctx **ctx)
        field->record = vsuid_record;
        field->get_value = vsuid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vsuid_to_ctx);
index a7da7d2efa320e23c70a1871aa70e6a867efd90c..a2d90bb9fc7737de67f31b298929f2e9dff7df56 100644 (file)
@@ -83,7 +83,7 @@ int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx)
        field->record = vtid_record;
        field->get_value = vtid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vtid_to_ctx);
index 427ada715c1f9db437d5e538084f85c7feed570b..dd8eab89aaaf0da9d6d1aa431bc734ccfc5747bc 100644 (file)
@@ -70,7 +70,7 @@ int lttng_add_vuid_to_ctx(struct lttng_ctx **ctx)
        field->record = vuid_record;
        field->get_value = vuid_get_value;
        lttng_context_update(*ctx);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 }
 EXPORT_SYMBOL_GPL(lttng_add_vuid_to_ctx);
index 54fa447848177770d47e309d6eb52e60477cabb5..b4a60038ecc320672c9fc9198d687332fcae1b6a 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/list.h>
 #include <linux/mutex.h>
 #include <linux/slab.h>
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
+#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_mappings() */
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 
index da949e970e3cd34c39a4ae63fd4def7ae8beedd5..49a181b6a5d09aba4c5279ae8fb73c59d5f25049 100644 (file)
@@ -30,7 +30,7 @@
 #include <linux/dmi.h>
 
 #include <wrapper/uuid.h>
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
+#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_mappings() */
 #include <wrapper/random.h>
 #include <wrapper/tracepoint.h>
 #include <wrapper/list.h>
@@ -2795,9 +2795,9 @@ end:
  * Registers a transport which can be used as output to extract the data out of
  * LTTng. The module calling this registration function must ensure that no
  * trap-inducing code will be executed by the transport functions. E.g.
- * vmalloc_sync_all() must be called between a vmalloc and the moment the memory
+ * vmalloc_sync_mappings() must be called between a vmalloc and the moment the memory
  * is made visible to the transport function. This registration acts as a
- * vmalloc_sync_all. Therefore, only if the module allocates virtual memory
+ * vmalloc_sync_mappings. Therefore, only if the module allocates virtual memory
  * after its registration must it synchronize the TLBs.
  */
 void lttng_transport_register(struct lttng_transport *transport)
@@ -2805,9 +2805,9 @@ void lttng_transport_register(struct lttng_transport *transport)
        /*
         * Make sure no page fault can be triggered by the module about to be
         * registered. We deal with this here so we don't have to call
-        * vmalloc_sync_all() in each module's init.
+        * vmalloc_sync_mappings() in each module's init.
         */
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
 
        mutex_lock(&sessions_mutex);
        list_add_tail(&transport->node, &lttng_transport_list);
index f11c606b4eb07a5e24da081df8dda718278419d0..ecdc4adf60ede2e9138f8deac4679d0398d3c05b 100644 (file)
@@ -10,7 +10,7 @@
 #include <linux/module.h>
 #include <linux/types.h>
 #include <lib/bitfield.h>
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
+#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_mappings() */
 #include <wrapper/trace-clock.h>
 #include <lttng-events.h>
 #include <lttng-tracer.h>
@@ -766,7 +766,7 @@ static int __init lttng_ring_buffer_client_init(void)
         * This vmalloc sync all also takes care of the lib ring buffer
         * vmalloc'd module pages when it is built as a module into LTTng.
         */
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        lttng_transport_register(&lttng_relay_transport);
        return 0;
 }
index 4c10297509d13fe11e49dff8e618c050b36f95c3..fb71ad2248d7dcf70f07f6bed24865f135223207 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <linux/module.h>
 #include <linux/types.h>
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
+#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_mappings() */
 #include <lttng-events.h>
 #include <lttng-tracer.h>
 
@@ -427,7 +427,7 @@ static int __init lttng_ring_buffer_client_init(void)
         * This vmalloc sync all also takes care of the lib ring buffer
         * vmalloc'd module pages when it is built as a module into LTTng.
         */
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        lttng_transport_register(&lttng_relay_transport);
        return 0;
 }
index a43c475e7b7f1f744018fd77f6ea179177ac7290..7720f4ea77a1c22e7f879a69c7f75fbc791ad89a 100644 (file)
@@ -761,7 +761,7 @@ int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
        struct lttng_kernel_event ev;
        int ret;
 
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
 
        if (!chan->sc_table) {
                /* create syscall table mapping syscall to events */
index 40fe0f68d54e41e8d032ece226ef117cbf06a416..d0a48d2894db0e321af1b4b8ea32240a0f729471 100644 (file)
@@ -132,7 +132,7 @@ int lttng_kprobes_register(const char *name,
         * Well.. kprobes itself puts the page fault handler on the blacklist,
         * but we can never be too careful.
         */
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
 
        ret = register_kprobe(&event->u.kprobe.kp);
        if (ret)
index 40938f2b7110bd5506862d982ee8deca997bc614..133158fe44f0bdc12bd6d4c7bfcf5af793d83b04 100644 (file)
@@ -221,7 +221,7 @@ int lttng_kretprobes_register(const char *name,
         * Well.. kprobes itself puts the page fault handler on the blacklist,
         * but we can never be too careful.
         */
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
 
        ret = register_kretprobe(&lttng_krp->krp);
        if (ret)
index 5f77bf4d5405f6c8c50bc06f99e5a166869f4765..48639152a3e1cc02839c85f348e4cbb3f78529c7 100644 (file)
@@ -15,7 +15,7 @@
 #include <probes/lttng.h>
 #include <probes/lttng-types.h>
 #include <probes/lttng-probe-user.h>
-#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_all() */
+#include <wrapper/vmalloc.h>   /* for wrapper_vmalloc_sync_mappings() */
 #include <wrapper/ringbuffer/frontend_types.h>
 #include <wrapper/ringbuffer/backend.h>
 #include <wrapper/rcu.h>
@@ -1414,7 +1414,7 @@ static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = {
 #ifndef TP_MODULE_NOINIT
 static int TP_ID(__lttng_events_init__, TRACE_SYSTEM)(void)
 {
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return lttng_probe_register(&TP_ID(__probe_desc___, TRACE_SYSTEM));
 }
 
index 175c0dd9d5993ddcfb63865a6971715b6f94e504..82bd4fd4991ba08925d0437f347937815836b804 100644 (file)
@@ -161,7 +161,7 @@ int lttng_uprobes_add_callsite(struct lttng_event *event,
        }
 
        /* Ensure the memory we just allocated don't trigger page faults. */
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
 
        uprobe_handler->event = event;
        uprobe_handler->up_consumer.handler = lttng_uprobes_handler_pre;
index 160e0bcdfcd8f0bea737b17fbe40f5d08250126c..e571ceea6795433324d35c6f18fa00846b98439e 100644 (file)
@@ -116,7 +116,7 @@ int __init lttng_logger_init(void)
 {
        int ret = 0;
 
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
 
        /* /dev/lttng-logger */
        ret = misc_register(&logger_dev);
index cfdacc9404df9428541348edc7b6418abb5ff9ce..79743b80b2a6c9d35eac437769412c401d30aa09 100644 (file)
@@ -97,7 +97,7 @@ int __init lttng_test_init(void)
        int ret = 0;
 
        (void) wrapper_lttng_fixup_sig(THIS_MODULE);
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        lttng_test_filter_event_dentry =
                        proc_create_data(LTTNG_TEST_FILTER_EVENT_FILE,
                                S_IRUGO | S_IWUGO, NULL,
index 80deacfe0cf6feb52bf416c5aae19c47233bd91d..4000fc9cca0fc17be1e155b263eba3cdccdbc8ab 100644 (file)
 #include <linux/kallsyms.h>
 #include <wrapper/kallsyms.h>
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0))
+
+static inline
+void wrapper_vmalloc_sync_mappings(void)
+{
+       void (*vmalloc_sync_mappings_sym)(void);
+
+       vmalloc_sync_mappings_sym = (void *) kallsyms_lookup_funcptr("vmalloc_sync_mappings");
+       if (vmalloc_sync_mappings_sym) {
+               vmalloc_sync_mappings_sym();
+       } else {
+#ifdef CONFIG_X86
+               /*
+                * Only x86 needs vmalloc_sync_mappings to make sure LTTng does not
+                * trigger recursive page faults.
+                */
+               printk_once(KERN_WARNING "LTTng: vmalloc_sync_mappings symbol lookup failed.\n");
+               printk_once(KERN_WARNING "Page fault handler and NMI tracing might trigger faults.\n");
+#endif
+       }
+}
+
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */
+
+/*
+ * Map vmalloc_sync_mappings to vmalloc_sync_all() on kernels before 5.7.
+ */
 static inline
-void wrapper_vmalloc_sync_all(void)
+void wrapper_vmalloc_sync_mappings(void)
 {
        void (*vmalloc_sync_all_sym)(void);
 
@@ -40,13 +67,29 @@ void wrapper_vmalloc_sync_all(void)
 #endif
        }
 }
+
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */
+
 #else
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0))
+
+static inline
+void wrapper_vmalloc_sync_mappings(void)
+{
+       return vmalloc_sync_mappings();
+}
+
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */
+
 static inline
-void wrapper_vmalloc_sync_all(void)
+void wrapper_vmalloc_sync_mappings(void)
 {
        return vmalloc_sync_all();
 }
+
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)) */
+
 #endif
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
@@ -61,7 +104,7 @@ void *lttng_kvmalloc_node(unsigned long size, gfp_t flags, int node)
                 * Make sure we don't trigger recursive page faults in the
                 * tracing fast path.
                 */
-               wrapper_vmalloc_sync_all();
+               wrapper_vmalloc_sync_mappings();
        }
        return ret;
 }
This page took 0.047893 seconds and 4 git commands to generate.