I should clarify that the sysycall argument problem in
is not LTO specific. It's a general problem that the 32bit kernel violates the ABI. It uses some stack arguments for syscalls inside the kernel. The actual syscall interface is defined with registers, but the interface between the syscall entry code and the actual syscall has stack arguments.
The kernel entry code saves all registers on the stack. The same area also doubles as the stack arguments for syscalls.
According to the ABI it's legal for the compiler to change arguments on the stack. But the 32bit kernel cannot tolerate this because it corrupts the saved user space registers.
My 32bit LTO kernel just happened to hit this and the "noinline" is just a workaround to change the register allocation. But there's nothing wrong with inlining in LTO.
The problem could happen without LTO too.
64bit kernel don't have this problem because they pass all 6 syscall arguments in registers even inside the kernel.
It was also not fun to debug.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds