-
Notifications
You must be signed in to change notification settings - Fork 43
'struct pt_regs' has no member named 'ip' #11
Comments
thanks for reporting this! as you can probably tell thus far we've been a bit x86_64-centric, but ARM support is something we'd definitely like to add. i'll try and resolve this asap; would you be able to verify a fix at your end? thanks! Alan |
No problem to test a fix when you're ready. Pascal |
thanks Pascal! Knut pushed an update I made today which will (I hope) solve this specific issue; I tried adding arm[64] support in general but some things may well still be broken. If you could retry compilation, and if you're feeling particularly brave (and have a setup which can tolerate panics!) it would be great to try the selftests. "insmod kernel/ktf.ko ; insmod selftest/selftest.ko ; ktfrun". As I say don't do this if you're running in an environment in which panics are a problem! In the meantime I'm going to try and setup arm64 emulation so I can test things locally here. |
Hi alan, Making all in kernel For the first dereferenced pointer issue, i think adding the good header file to self.c may solve the problem. |
hi Pascal, latest ktf should resolve the compilation issues with registers - I've tested it in a KVM-emulated ARM64 environment and build works okay. WRT the struct page issues; do you have an equivalent to the "kernel-devel" package in Red Hat distros installed? We rely on some kernel headers when building KTF, but I don't think a full kernel headers package should be needed. There are still some issues with behaviour of coverage, probe entry/return and override support on ARM64; I'm going to investigate them next. Thanks! Alan |
Hi, [==========] Running 15 tests from 1 test case. [----------] Global test environment tear-down 4 FAILED TESTS |
hi Pascal, I just updated my ARM64 kernel to 4.18 and ran into the issue with "struct page". The latest KTF has a fix for that. With the updated KTF I see 2 selftest failures; the symbol and override tests fail. The reason for both failures is that the kernel I'm testing on was compiled with CONFIG_KALLSYMS_ALL not set, so we don't have kernel-internal symbols in kallsyms. Both the override and symbol tests rely on that. As it stands, I'm building a custom kernel with these facilities enabled and will update on progress. But I'd suggest trying 4.18 or later (ideally 4.19) at your end if possible and let me know how you get on. I ran into failures in the probeentry/return tests on 4.9 but AFAICT kprobe support on ARM64 was pretty new then so there could have been issues on the kernel side. |
Hi,
I'm having some issues building ktf.
I'm cross-compiling ktf for arm64 architecture.
Everything was fine until i updated my local ktf repository to test the function override feature.
Currently, building fails in the "Making all in kernel" phase:
make[1] : on entre dans le répertoire « /home/pfourguet/sigfox/dev/ktf/build/ktf/kernel » make -C /home/pfourguet/sigfox/dev/linux-kernel M=/home/pfourguet/sigfox/dev/ktf/build/ktf/kernel make[2] : on entre dans le répertoire « /home/pfourguet/sigfox/dev/linux-kernel » arch/arm64/Makefile:48: Detected assembler with broken .inst; disassembly will be unreliable AR /home/pfourguet/sigfox/dev/ktf/build/ktf/kernel/built-in.o CC [M] /home/pfourguet/sigfox/dev/ktf/build/ktf/kernel/kbase.o CC [M] /home/pfourguet/sigfox/dev/ktf/build/ktf/kernel/nl.o CC [M] /home/pfourguet/sigfox/dev/ktf/build/ktf/kernel/ktf_map.o CC [M] /home/pfourguet/sigfox/dev/ktf/build/ktf/kernel/kcheck.o CC [M] /home/pfourguet/sigfox/dev/ktf/build/ktf/kernel/ktf_debugfs.o CC [M] /home/pfourguet/sigfox/dev/ktf/build/ktf/kernel/ktf_cov.o CC [M] /home/pfourguet/sigfox/dev/ktf/build/ktf/kernel/ktf_override.o /home/pfourguet/sigfox/dev/ktf/build/ktf/kernel/ktf_override.c: In function 'ktf_override_function_with_return': /home/pfourguet/sigfox/dev/ktf/build/ktf/kernel/ktf_override.c:46:6: error: 'struct pt_regs' has no member named 'ip' regs->ip = (unsigned long)&ktf_just_return_func; ^
The pt_regs structure is highly architecture dependent and the ip field is not a member of pt_regs structure on arm64.
Thanks a lot.
The text was updated successfully, but these errors were encountered: