[BUG] objtool complains about missing __noreturn__ on x64_sys_call() and ia32_sys_call()

From: Paul E. McKenney
Date: Thu Apr 18 2024 - 20:22:36 EST


Hello!

Recent -next kernels, including next-20240418, get the following objtool
build errors:

vmlinux.o: warning: objtool: x64_sys_call+0x2804: __x64_sys_exit() is missing a __noreturn annotation
vmlinux.o: warning: objtool: ia32_sys_call+0x29b6: __ia32_sys_exit_group() is missing a __noreturn annotation

These functions appear to have been added to -next and mainline by
commit 1e3ad78334a6 ("x86/syscall: Don't force use of indirect calls
for system calls"). But the diagnostic does not make much sense because
both functions always return unless the system call itself doesn't return.

Adding annotate_unreachable() to the end of each function did not help,
header comment notwithstanding. On the other hand, these objtool errors
were from Ubuntu clang version 14.0.0-1ubuntu1.1 rather than GCC.
I also freely confess that I don't understand the "};" at the end of
both functions.

Thoughts?

Thanx, Paul