Skip to contentSkip to conversation

x86/tdx: Annotate a noreturn function

PATCH Applied Borislav Petkov 3 participants 3 messages Apr 20, 2022 – Apr 22, 2022

Subsystems (2)
lore
Share & tools
lore

Borislav Petkov

author maintainer
#0 lore raw

PATCH 1/1 x86/tdx: Annotate a noreturn function

From: Borislav Petkov <[email protected]>

objdump complains:

vmlinux.o: warning: objtool: __tdx_hypercall()+0x74: unreachable instruction

because __tdx_hypercall_failed() won't return but panic the guest. Annotate that that is ok and desired.

Fixes eb94f1b6a70a ("x86/tdx: Add __tdx_module_call() and __tdx_hypercall() helper functions")
---
 arch/x86/coco/tdx/tdcall.S | 1 +
 1 file changed, 1 insertion(+)
arch/x86/coco/tdx/tdcall.S +1 -0
index 245888290bb6..eeb4511dc414 100644
@@ -200,5 +200,6 @@ SYM_FUNC_START(__tdx_hypercall)
 .Lpanic:
 	call __tdx_hypercall_failed
 	/* __tdx_hypercall_failed never returns */
+	REACHABLE
 	jmp .Lpanic
 SYM_FUNC_END(__tdx_hypercall)
Signature · 1 line
2.35.1
#1 lore raw
The following commit has been merged into the x86/tdx branch of tip:

The following commit has been merged into the x86/tdx branch of tip:

Commit-ID:     5af14c29f7a0e6d1fcee44c4ed4a2d12a49c4a43
Gitweb:        https://git.kernel.org/tip/5af14c29f7a0e6d1fcee44c4ed4a2d12a49c4a43
Author:        Borislav Petkov <[email protected]>
AuthorDate:    Wed, 20 Apr 2022 13:45:49 +02:00
Committer:     Borislav Petkov <[email protected]>
CommitterDate: Thu, 21 Apr 2022 12:54:08 +02:00

x86/tdx: Annotate a noreturn function

objdump complains:

vmlinux.o: warning: objtool: __tdx_hypercall()+0x74: unreachable instruction

because __tdx_hypercall_failed() won't return but panic the guest. Annotate that that is ok and desired.

Fixes eb94f1b6a70a ("x86/tdx: Add __tdx_module_call() and __tdx_hypercall() helper functions")
---
 arch/x86/coco/tdx/tdcall.S | 1 +
 1 file changed, 1 insertion(+)
arch/x86/coco/tdx/tdcall.S +1 -0
index 2458882..eeb4511 100644
@@ -200,5 +200,6 @@ SYM_FUNC_START(__tdx_hypercall)
 .Lpanic:
 	call __tdx_hypercall_failed
 	/* __tdx_hypercall_failed never returns */
+	REACHABLE
 	jmp .Lpanic
 SYM_FUNC_END(__tdx_hypercall)
Acked-by on v1 1/1
#2 lore raw
In reply to Borislav Petkov
Quoted 11 lines · Borislav Petkov

From: Borislav Petkov <[email protected]>

objdump complains:

vmlinux.o: warning: objtool: __tdx_hypercall()+0x74: unreachable instruction

because __tdx_hypercall_failed() won't return but panic the guest. Annotate that that is ok and desired.

Fixes eb94f1b6a70a ("x86/tdx: Add __tdx_module_call() and __tdx_hypercall() helper functions")

Have not seen REACHABLE before.

Signature · 1 line
 Kirill A. Shutemov