2022-03-08 18:23:46

by Peter Zijlstra

[permalink] [raw]
Subject: [PATCH v4 04/45] objtool,efi: Update __efi64_thunk annotation

The current annotation relies on not running objtool on the file; this
won't work when running objtool on vmlinux.o. Instead explicitly mark
__efi64_thunk() to be ignored.

This preserves the status quo, which is somewhat unfortunate. Luckily
this code is hardly ever used.

Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
---
arch/x86/platform/efi/Makefile | 1 -
arch/x86/platform/efi/efi_thunk_64.S | 6 ++++--
2 files changed, 4 insertions(+), 3 deletions(-)

--- a/arch/x86/platform/efi/Makefile
+++ b/arch/x86/platform/efi/Makefile
@@ -1,5 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
-OBJECT_FILES_NON_STANDARD_efi_thunk_$(BITS).o := y
KASAN_SANITIZE := n
GCOV_PROFILE := n

--- a/arch/x86/platform/efi/efi_thunk_64.S
+++ b/arch/x86/platform/efi/efi_thunk_64.S
@@ -20,12 +20,14 @@
*/

#include <linux/linkage.h>
+#include <linux/objtool.h>
#include <asm/page_types.h>
#include <asm/segment.h>

.text
.code64
-SYM_CODE_START(__efi64_thunk)
+SYM_FUNC_START(__efi64_thunk)
+STACK_FRAME_NON_STANDARD __efi64_thunk
push %rbp
push %rbx

@@ -79,7 +81,7 @@ SYM_CODE_START(__efi64_thunk)
2: pushl $__KERNEL_CS
pushl %ebp
lret
-SYM_CODE_END(__efi64_thunk)
+SYM_FUNC_END(__efi64_thunk)

.bss
.balign 8



2022-03-09 07:59:58

by tip-bot2 for Boqun Feng

[permalink] [raw]
Subject: [tip: x86/core] objtool,efi: Update __efi64_thunk annotation

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

Commit-ID: f99b84d14feba2ac011b1a21ceae4aa9e3fe49e8
Gitweb: https://git.kernel.org/tip/f99b84d14feba2ac011b1a21ceae4aa9e3fe49e8
Author: Peter Zijlstra <[email protected]>
AuthorDate: Tue, 08 Mar 2022 16:30:15 +01:00
Committer: Peter Zijlstra <[email protected]>
CommitterDate: Tue, 08 Mar 2022 23:53:27 +01:00

objtool,efi: Update __efi64_thunk annotation

The current annotation relies on not running objtool on the file; this
won't work when running objtool on vmlinux.o. Instead explicitly mark
__efi64_thunk() to be ignored.

This preserves the status quo, which is somewhat unfortunate. Luckily
this code is hardly ever used.

Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Josh Poimboeuf <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
arch/x86/platform/efi/Makefile | 1 -
arch/x86/platform/efi/efi_thunk_64.S | 6 ++++--
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/platform/efi/Makefile b/arch/x86/platform/efi/Makefile
index 84b09c2..a502451 100644
--- a/arch/x86/platform/efi/Makefile
+++ b/arch/x86/platform/efi/Makefile
@@ -1,5 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
-OBJECT_FILES_NON_STANDARD_efi_thunk_$(BITS).o := y
KASAN_SANITIZE := n
GCOV_PROFILE := n

diff --git a/arch/x86/platform/efi/efi_thunk_64.S b/arch/x86/platform/efi/efi_thunk_64.S
index 25799d7..854dd81 100644
--- a/arch/x86/platform/efi/efi_thunk_64.S
+++ b/arch/x86/platform/efi/efi_thunk_64.S
@@ -20,12 +20,14 @@
*/

#include <linux/linkage.h>
+#include <linux/objtool.h>
#include <asm/page_types.h>
#include <asm/segment.h>

.text
.code64
-SYM_CODE_START(__efi64_thunk)
+SYM_FUNC_START(__efi64_thunk)
+STACK_FRAME_NON_STANDARD __efi64_thunk
push %rbp
push %rbx

@@ -79,7 +81,7 @@ SYM_CODE_START(__efi64_thunk)
2: pushl $__KERNEL_CS
pushl %ebp
lret
-SYM_CODE_END(__efi64_thunk)
+SYM_FUNC_END(__efi64_thunk)

.bss
.balign 8

2022-03-09 09:12:47

by Miroslav Benes

[permalink] [raw]
Subject: Re: [PATCH v4 04/45] objtool,efi: Update __efi64_thunk annotation

> --- a/arch/x86/platform/efi/efi_thunk_64.S
> +++ b/arch/x86/platform/efi/efi_thunk_64.S
> @@ -20,12 +20,14 @@
> */
>
> #include <linux/linkage.h>
> +#include <linux/objtool.h>
> #include <asm/page_types.h>
> #include <asm/segment.h>
>
> .text
> .code64
> -SYM_CODE_START(__efi64_thunk)
> +SYM_FUNC_START(__efi64_thunk)
> +STACK_FRAME_NON_STANDARD __efi64_thunk

I would prefer if STACK_FRAME_NON_STANDARD annotation...

> push %rbp
> push %rbx
>
> @@ -79,7 +81,7 @@ SYM_CODE_START(__efi64_thunk)
> 2: pushl $__KERNEL_CS
> pushl %ebp
> lret
> -SYM_CODE_END(__efi64_thunk)
> +SYM_FUNC_END(__efi64_thunk)

went here after SYM_FUNC_END(), but that is just a cosmetic nit.

Miroslav

2022-03-17 04:03:37

by tip-bot2 for Boqun Feng

[permalink] [raw]
Subject: [tip: x86/core] objtool,efi: Update __efi64_thunk annotation

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

Commit-ID: 537da1ed54658e916141e50923a7f5b20c728856
Gitweb: https://git.kernel.org/tip/537da1ed54658e916141e50923a7f5b20c728856
Author: Peter Zijlstra <[email protected]>
AuthorDate: Tue, 08 Mar 2022 16:30:15 +01:00
Committer: Peter Zijlstra <[email protected]>
CommitterDate: Tue, 15 Mar 2022 10:32:32 +01:00

objtool,efi: Update __efi64_thunk annotation

The current annotation relies on not running objtool on the file; this
won't work when running objtool on vmlinux.o. Instead explicitly mark
__efi64_thunk() to be ignored.

This preserves the status quo, which is somewhat unfortunate. Luckily
this code is hardly ever used.

Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Josh Poimboeuf <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
arch/x86/platform/efi/Makefile | 1 -
arch/x86/platform/efi/efi_thunk_64.S | 6 ++++--
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/platform/efi/Makefile b/arch/x86/platform/efi/Makefile
index 84b09c2..a502451 100644
--- a/arch/x86/platform/efi/Makefile
+++ b/arch/x86/platform/efi/Makefile
@@ -1,5 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
-OBJECT_FILES_NON_STANDARD_efi_thunk_$(BITS).o := y
KASAN_SANITIZE := n
GCOV_PROFILE := n

diff --git a/arch/x86/platform/efi/efi_thunk_64.S b/arch/x86/platform/efi/efi_thunk_64.S
index 25799d7..854dd81 100644
--- a/arch/x86/platform/efi/efi_thunk_64.S
+++ b/arch/x86/platform/efi/efi_thunk_64.S
@@ -20,12 +20,14 @@
*/

#include <linux/linkage.h>
+#include <linux/objtool.h>
#include <asm/page_types.h>
#include <asm/segment.h>

.text
.code64
-SYM_CODE_START(__efi64_thunk)
+SYM_FUNC_START(__efi64_thunk)
+STACK_FRAME_NON_STANDARD __efi64_thunk
push %rbp
push %rbx

@@ -79,7 +81,7 @@ SYM_CODE_START(__efi64_thunk)
2: pushl $__KERNEL_CS
pushl %ebp
lret
-SYM_CODE_END(__efi64_thunk)
+SYM_FUNC_END(__efi64_thunk)

.bss
.balign 8