Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warnings from objtool on new kernels #190

Closed
okt-sergeyn opened this issue Dec 1, 2023 · 1 comment
Closed

warnings from objtool on new kernels #190

okt-sergeyn opened this issue Dec 1, 2023 · 1 comment

Comments

@okt-sergeyn
Copy link
Contributor

There are warnings from objtool when building onload modules on some kernels:

warning: objtool: __ci_fail() falls through to next function ci_backtrace()
warning: objtool: my_stop_fn() falls through to next function ci_log_buffer_till_fail()

and

warning: objtool: ci_tcp_tmpl_handle_nic_reset+0x4ae: __ci_sys_fail() is missing a __noreturn annotation
warning: objtool: ci_netif_state_init+0x348: __oo_shmbuf_ptr2off() is missing a __noreturn annotation
warning: objtool: ci_tcp_connect_lo_samestack+0x1a3f: __ci_sys_fail() is missing a __noreturn annotation

I see it on Fedora 38 with kernel 6.5.6-200.fc38.x86_64 on onload master 106c23f

Although objtool has already been turned off in onload - https://github.com/Xilinx-CNS/onload/blob/master/mk/linux_kbuild.mk#L100
it still works on the mentioned kernel (I suppose CONFIG_X86_KERNEL_IBT=y config option is related).

The warnings seem sensible, I'll prepare PR.

okt-sergeyn added a commit to okt-sergeyn/onload that referenced this issue Dec 1, 2023
Despite of 'objtool' is disabled for Onload, it still may run
during the build on some kernels and generate warnings like:
"<func1> falls through to next function <func2>".
Mark related functions __ci_fail() and my_stop_fn() with
STACK_FRAME_NON_STANDARD macro to tell objtool to ignore them.

Signed-off-by: Sergey Nikitin <sergey.nikitin@oktet.tech>
okt-sergeyn added a commit to okt-sergeyn/onload that referenced this issue Dec 1, 2023
Mark __ci_sys_fail() as noreturn to stop objtool generating
"__ci_sys_fail() is missing a __noreturn annotation" warning.

Signed-off-by: Sergey Nikitin <sergey.nikitin@oktet.tech>
okt-sergeyn added a commit to okt-sergeyn/onload that referenced this issue Dec 1, 2023
__oo_shmbuf_ptr2off() triggers objtool warning:
"__oo_shmbuf_ptr2off() is missing a __noreturn annotation".

The function's only purpose now is to crash with ci_assert(0).
There's no reason to keep it.
The patch moves the assertion to the caller (oo_shmbuf_ptr2off)
and removes __oo_shmbuf_ptr2off().

Signed-off-by: Sergey Nikitin <sergey.nikitin@oktet.tech>
@ivatet-amd
Copy link
Contributor

Closing as #191 is merged, thanks!

cns-ci-onload-xilinx pushed a commit that referenced this issue Dec 6, 2023
Despite of 'objtool' is disabled for Onload, it still may run
during the build on some kernels and generate warnings like:
"<func1> falls through to next function <func2>".
Mark related functions __ci_fail() and my_stop_fn() with
STACK_FRAME_NON_STANDARD macro to tell objtool to ignore them.

Signed-off-by: Sergey Nikitin <sergey.nikitin@oktet.tech>
(cherry picked from commit af6a8b9)
cns-ci-onload-xilinx pushed a commit that referenced this issue Dec 6, 2023
Mark __ci_sys_fail() as noreturn to stop objtool generating
"__ci_sys_fail() is missing a __noreturn annotation" warning.

Signed-off-by: Sergey Nikitin <sergey.nikitin@oktet.tech>
(cherry picked from commit 9f936e4)
cns-ci-onload-xilinx pushed a commit that referenced this issue Dec 6, 2023
__oo_shmbuf_ptr2off() triggers objtool warning:
"__oo_shmbuf_ptr2off() is missing a __noreturn annotation".

The function's only purpose now is to crash with ci_assert(0).
There's no reason to keep it.
The patch moves the assertion to the caller (oo_shmbuf_ptr2off)
and removes __oo_shmbuf_ptr2off().

Signed-off-by: Sergey Nikitin <sergey.nikitin@oktet.tech>
(cherry picked from commit 01516d2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants