> > With that all architectures using the generic syscall entry code follow the > same scheme, apply stack randomization at the correct and earliest possible > place and skip syscall processing depending on the boolean return value of > syscall_enter_from_user_mode[_work](). > > There should be no functional changes, at least there are none intended. > > The resulting text size for the syscall entry code on x8664 is slightly > smaller than before these changes. > > Testing syscall heavy workloads and micro benchmarks shows a small > performance gain for the general rework, but the last patch, which changes > the logic to be more understandable has no measurable impact in either > direction. > > The series applies on Linus tree and is also available from git: > > git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git > entry-rework-v1 >
Hi Thomas, I did another round of testing of this series on Alpha, this time with my Alpha GENERIC_ENTRY conversion rebased on top of this series. For this test I also manually applied the seccomp fixup discussed earlier in this thread, i.e. fixing the recheck-after-trace logic in __seccomp_filter() along the lines suggested by Jinjie/Oleg. With that in place, the kernel boots on Alpha and I do not see any regressions in the seccomp_bpf kernel selftest or in the strace testsuite. One note: the seccomp_bpf selftest run on Alpha uses this not-yet-upstream Alpha selftest enablement patch: https://lore.kernel.org/linux-alpha/[email protected]/ One Alpha-specific wrinkle I hit while rebasing the GENERIC_ENTRY patch is that Alpha cannot unconditionally pre-seed the normal -ENOSYS return state before calling into the generic entry code: syscall_set_return_value() also updates r19/a3, which is still syscall argument 4 on the normal entry path. Doing that too early broke early userspace mmap() during boot. The Alpha conversion therefore handles this on the no-dispatch path instead: after the generic entry helper returns, if the syscall is not to be invoked or the resulting syscall number is invalid, Alpha skips the call, preserves any ptrace/seccomp/BPF-provided return value, and only synthesizes -ENOSYS if the return state was otherwise unchanged. That was needed for the TRACE_syscall.ptrace.syscall_faked and syscall_errno seccomp_bpf cases to pass. So from the Alpha side, with the seccomp fixup applied: Tested-by: Magnus Lindholm [email protected] Are you planning to send a v2 with the seccomp recheck fix and any other review fixups folded in? Is the intention to route this upstream during the next merge window? Thanks, Magnus
