The allocation of the SDT trampolines was done previously using vmalloc
which may cause the trampolines to be too far away from the code that
they provide a call to dtrace_probe() for, making it impossible to put
a jump to the trampoline in a single instruction at the probe location.
By using module_alloc on SPARC, the trampolines are allocated in the
memory region where modules live, which is by design within the jump
range.
The allocated memory is known to be of sufficient size for trampolines,
yet its actual use is not determined at the kernel level. It is simply
provided as a chunk of memory in the appropriate range.
Orabug:
21220344
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Acked-by: Nick Alcock <nick.alcock@oracle.com>
Acked-by: Allen Pais <allen.pais@oracle.com>
__asm__ __volatile__("flush %g6");
}
+#ifdef CONFIG_DTRACE
+ me->pdata = module_alloc(me->sdt_probec * SDT_TRAMP_SIZE *
+ sizeof(sdt_instr_t));
+#endif
+
return 0;
}
+
+#ifdef CONFIG_DTRACE
+void module_arch_cleanup(struct module *me)
+{
+ module_free(me->pdata);
+}
+#endif
#endif /* CONFIG_SPARC64 */