On 12.08.2018 18:07, Christos Zoulas wrote: > Module Name: src > Committed By: christos > Date: Sun Aug 12 16:07:27 UTC 2018 > > Modified Files: > src/external/cddl/osnet/dev/dtrace/amd64: dtrace_isa.c > > Log Message: > handle variable kernel vm min address > > > To generate a diff of this commit: > cvs rdiff -u -r1.8 -r1.9 \ > src/external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c > > Please note that diffs are not public domain; they are subject to the > copyright notices on the relevant files. > > > > Modified files: > > Index: src/external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c > diff -u src/external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c:1.8 src/external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c:1.9 > --- src/external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c:1.8 Fri Jul 27 03:32:59 2018 > +++ src/external/cddl/osnet/dev/dtrace/amd64/dtrace_isa.c Sun Aug 12 12:07:27 2018 > @@ -1,4 +1,4 @@ > -/* $NetBSD: dtrace_isa.c,v 1.8 2018/07/27 07:32:59 maxv Exp $ */ > +/* $NetBSD: dtrace_isa.c,v 1.9 2018/08/12 16:07:27 christos Exp $ */ > > /* > * CDDL HEADER START > @@ -45,7 +45,11 @@ uint16_t dtrace_fuword16_nocheck(void *) > uint32_t dtrace_fuword32_nocheck(void *); > uint64_t dtrace_fuword64_nocheck(void *); > > +#ifdef VM_MIN_KERNEL_ADDRESS_DEFAULT > +__strong_alias(kernelbase, vm_min_kernel_address) > +#else > uintptr_t kernelbase = (uintptr_t)VM_MIN_KERNEL_ADDRESS; > +#endif > > #define INKERNEL(va) ((intptr_t)(va) < 0) /* XXX horror */ > > This broke dtrace and produced missing symbol for the kernel module: [ 4.934652] kern.module.path=/stand/amd64/8.99.24/modules [ 6.065073] kobj_checksyms, 988: [dtrace]: linker error: symbol `kernelbase' not found [ 6.065073] WARNING: module error: unable to affix module `dtrace', error 8 [ 6.155107] kobj_checksyms, 988: [dtrace]: linker error: symbol `kernelbase' not found [ 6.155107] WARNING: module error: unable to affix module `dtrace', error 8 [ 6.155107] WARNING: module error: recursive load failed for `dtrace_sdt' (`dtrace' required), error 8 [ 6.165111] kobj_checksyms, 988: [dtrace]: linker error: symbol `kernelbase' not found [ 6.165111] WARNING: module error: unable to affix module `dtrace', error 8 [ 6.165111] WARNING: module error: recursive load failed for `dtrace_fbt' (`dtrace' required), error 8 etc This probably comes from external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c which uses extern symbol to kernelbase. Adding more context: $ for w in *dtrace*/*.kmod; do echo $w; nm $w| grep kernelbase; done dtrace/dtrace.kmod U kernelbase dtrace_fbt/dtrace_fbt.kmod dtrace_lockstat/dtrace_lockstat.kmod dtrace_profile/dtrace_profile.kmod dtrace_sdt/dtrace_sdt.kmod dtrace_syscall/dtrace_syscall.kmod dtrace_syscall_linux/dtrace_syscall_linux.kmod dtrace_syscall_linux32/dtrace_syscall_linux32.kmod dtrace_syscall_netbsd32/dtrace_syscall_netbsd32.kmod Adding a weak or strong symbol in dtrace_subr.c didn't help. diff -u -r1.10 dtrace_subr.c --- external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c 5 Jun 2018 12:04:19 -0000 1.10 +++ external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c 16 Aug 2018 12:17:22 -0000 @@ -48,7 +48,11 @@ #include <machine/cpu_counter.h> #include <machine/cpufunc.h> +#ifdef VM_MIN_KERNEL_ADDRESS_DEFAULT +__weak_alias(kernelbase, vm_min_kernel_address) +#else extern uintptr_t kernelbase; +#endif int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); Produces: /usr/src/external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c: In function 'dtrace_toxic_ranges': /usr/src/external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c:124:13: error: 'kernelbase' undeclared (first use in this function) (*func)(0, kernelbase); ^~~~~~~~~~ /usr/src/external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c:124:13: note: each undeclared identifier is reported only once for each function it appears in On the other hand this seems to build and produce insertable kernel modules: Index: external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c =================================================================== RCS file: /cvsroot/src/external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c,v retrieving revision 1.10 diff -u -r1.10 dtrace_subr.c --- external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c 5 Jun 2018 12:04:19 -0000 1.10 +++ external/cddl/osnet/dev/dtrace/amd64/dtrace_subr.c 16 Aug 2018 12:20:54 -0000 @@ -48,7 +48,11 @@ #include <machine/cpu_counter.h> #include <machine/cpufunc.h> +#ifdef VM_MIN_KERNEL_ADDRESS_DEFAULT +#define kernelbase vm_min_kernel_address +#else extern uintptr_t kernelbase; +#endif int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t);
Attachment:
signature.asc
Description: OpenPGP digital signature