linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/tdx: Annotate a noreturn function
@ 2022-04-20 11:50 Borislav Petkov
  2022-04-21 11:01 ` [tip: x86/tdx] " tip-bot2 for Borislav Petkov
  2022-04-22  2:13 ` [PATCH] " Kirill A. Shutemov
  0 siblings, 2 replies; 3+ messages in thread
From: Borislav Petkov @ 2022-04-20 11:50 UTC (permalink / raw)
  To: Kuppuswamy Sathyanarayanan, Kirill A . Shutemov; +Cc: X86 ML, LKML

From: Borislav Petkov <bp@suse.de>

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")
Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/coco/tdx/tdcall.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/coco/tdx/tdcall.S b/arch/x86/coco/tdx/tdcall.S
index 245888290bb6..eeb4511dc414 100644
--- a/arch/x86/coco/tdx/tdcall.S
+++ b/arch/x86/coco/tdx/tdcall.S
@@ -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)
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [tip: x86/tdx] x86/tdx: Annotate a noreturn function
  2022-04-20 11:50 [PATCH] x86/tdx: Annotate a noreturn function Borislav Petkov
@ 2022-04-21 11:01 ` tip-bot2 for Borislav Petkov
  2022-04-22  2:13 ` [PATCH] " Kirill A. Shutemov
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Borislav Petkov @ 2022-04-21 11:01 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Borislav Petkov, x86, linux-kernel

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 <bp@suse.de>
AuthorDate:    Wed, 20 Apr 2022 13:45:49 +02:00
Committer:     Borislav Petkov <bp@suse.de>
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")
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20220420115025.5448-1-bp@alien8.de
---
 arch/x86/coco/tdx/tdcall.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/coco/tdx/tdcall.S b/arch/x86/coco/tdx/tdcall.S
index 2458882..eeb4511 100644
--- a/arch/x86/coco/tdx/tdcall.S
+++ b/arch/x86/coco/tdx/tdcall.S
@@ -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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/tdx: Annotate a noreturn function
  2022-04-20 11:50 [PATCH] x86/tdx: Annotate a noreturn function Borislav Petkov
  2022-04-21 11:01 ` [tip: x86/tdx] " tip-bot2 for Borislav Petkov
@ 2022-04-22  2:13 ` Kirill A. Shutemov
  1 sibling, 0 replies; 3+ messages in thread
From: Kirill A. Shutemov @ 2022-04-22  2:13 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Kuppuswamy Sathyanarayanan, X86 ML, LKML

On Wed, Apr 20, 2022 at 01:50:25PM +0200, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
> 
> 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")
> Signed-off-by: Borislav Petkov <bp@suse.de>

Have not seen REACHABLE before.

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

-- 
 Kirill A. Shutemov

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-22  2:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 11:50 [PATCH] x86/tdx: Annotate a noreturn function Borislav Petkov
2022-04-21 11:01 ` [tip: x86/tdx] " tip-bot2 for Borislav Petkov
2022-04-22  2:13 ` [PATCH] " Kirill A. Shutemov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).