When built with -O0, gcc (rightfully) generates function prologue, which results in writing %rbp to the stack, causing premature KVM_EXIT_MMIO. It could be possible to avoid such problems by "naked" attribute but, unfortunately, the latter is not available on x86 with older GCC. A trick suggested in [1] is used instead: assembly is moved to the global scope. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50242#c3 * tests/ioctl_kvm_run.c (code): Remove function. Add globally scoped __asm__ with the function code and its size. (code, code_size): New extern symbols declarations. (run_kvm): Remove code_size definition and initialization. Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
strace - the linux syscall tracer
This is strace -- a diagnostic, debugging and instructional userspace utility with a traditional command-line interface for Linux. It is used to monitor and tamper with interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state. The operation of strace is made possible by the kernel feature known as ptrace.
strace is released under a Berkeley-style license at the request of Paul Kranenburg; see the file COPYING for details.
See the file NEWS for information on what has changed in recent versions.
Please read the file INSTALL-git for installation instructions.
The user discussion and development of strace take place on the strace mailing list -- everyone is welcome to post bug reports, feature requests, comments and patches to strace-devel@lists.sourceforge.net. The mailing list archives are available at https://sourceforge.net/p/strace/mailman/strace-devel/ and other archival sites.
The GIT repository of strace is available at SourceForge, GitHub, and GitLab.