From 611d4c716db0141cfc436994dc5aff1d69c924ad Mon Sep 17 00:00:00 2001 From: "Guilherme G. Piccoli" Date: Wed, 12 Apr 2023 16:49:41 -0700 Subject: x86/hyperv: Mark hv_ghcb_terminate() as noreturn Annotate the function prototype and definition as noreturn to prevent objtool warnings like: vmlinux.o: warning: objtool: hyperv_init+0x55c: unreachable instruction Also, as per Josh's suggestion, add it to the global_noreturns list. As a comparison, an objdump output without the annotation: [...] 1b63: mov $0x1,%esi 1b68: xor %edi,%edi 1b6a: callq ffffffff8102f680 1b6f: jmpq ffffffff82f217ec # unreachable 1b74: cmpq $0xffffffffffffffff,-0x702a24(%rip) [...] Now, after adding the __noreturn to the function prototype: [...] 17df: callq ffffffff8102f6d0 17e4: test %al,%al 17e6: je ffffffff82f21bb9 [...] 1bb9: mov $0x1,%esi 1bbe: xor %edi,%edi 1bc0: callq ffffffff8102f680 1bc5: nopw %cs:0x0(%rax,%rax,1) # end of function Reported-by: Arnd Bergmann Signed-off-by: Guilherme G. Piccoli Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/32453a703dfcf0d007b473c9acbf70718222b74b.1681342859.git.jpoimboe@kernel.org --- tools/objtool/check.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/objtool/check.c') diff --git a/tools/objtool/check.c b/tools/objtool/check.c index e1b01ea6ad1b..5b600bbf2389 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -213,6 +213,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func, "ex_handler_msr_mce", "fortify_panic", "hlt_play_dead", + "hv_ghcb_terminate", "kthread_complete_and_exit", "kthread_exit", "kunit_try_catch_throw", -- cgit v1.2.3