2021-11-10 10:18:36

by Peter Zijlstra

[permalink] [raw]
Subject: [PATCH v2 05/23] x86,entry_64: Remove .fixup usage

Place the anonymous .fixup code at the tail of the regular functions.

Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
---
arch/x86/entry/entry_64.S | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -735,13 +735,9 @@ SYM_FUNC_START(asm_load_gs_index)
swapgs
FRAME_END
ret
-SYM_FUNC_END(asm_load_gs_index)
-EXPORT_SYMBOL(asm_load_gs_index)

- _ASM_EXTABLE(.Lgs_change, .Lbad_gs)
- .section .fixup, "ax"
/* running with kernelgs */
-SYM_CODE_START_LOCAL_NOALIGN(.Lbad_gs)
+.Lbad_gs:
swapgs /* switch back to user gs */
.macro ZAP_GS
/* This can't be a string because the preprocessor needs to see it. */
@@ -752,8 +748,11 @@ SYM_CODE_START_LOCAL_NOALIGN(.Lbad_gs)
xorl %eax, %eax
movl %eax, %gs
jmp 2b
-SYM_CODE_END(.Lbad_gs)
- .previous
+
+ _ASM_EXTABLE(.Lgs_change, .Lbad_gs)
+
+SYM_FUNC_END(asm_load_gs_index)
+EXPORT_SYMBOL(asm_load_gs_index)

#ifdef CONFIG_XEN_PV
/*



2021-11-17 16:29:20

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH v2 05/23] x86,entry_64: Remove .fixup usage

On Wed, Nov 10, 2021 at 11:01:07AM +0100, Peter Zijlstra wrote:
> Place the anonymous .fixup code at the tail of the regular functions.
>
> Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
> ---
> arch/x86/entry/entry_64.S | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> --- a/arch/x86/entry/entry_64.S
> +++ b/arch/x86/entry/entry_64.S
> @@ -735,13 +735,9 @@ SYM_FUNC_START(asm_load_gs_index)
> swapgs
> FRAME_END
> ret
> -SYM_FUNC_END(asm_load_gs_index)
> -EXPORT_SYMBOL(asm_load_gs_index)
>
> - _ASM_EXTABLE(.Lgs_change, .Lbad_gs)
> - .section .fixup, "ax"
> /* running with kernelgs */
> -SYM_CODE_START_LOCAL_NOALIGN(.Lbad_gs)
> +.Lbad_gs:
> swapgs /* switch back to user gs */
> .macro ZAP_GS
> /* This can't be a string because the preprocessor needs to see it. */
> @@ -752,8 +748,11 @@ SYM_CODE_START_LOCAL_NOALIGN(.Lbad_gs)
> xorl %eax, %eax
> movl %eax, %gs
> jmp 2b
> -SYM_CODE_END(.Lbad_gs)
> - .previous
> +
> + _ASM_EXTABLE(.Lgs_change, .Lbad_gs)
> +
> +SYM_FUNC_END(asm_load_gs_index)
> +EXPORT_SYMBOL(asm_load_gs_index)
>
> #ifdef CONFIG_XEN_PV
> /*

Reviewed-by: Borislav Petkov <[email protected]>

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette

2021-11-19 08:00:49

by Lai Jiangshan

[permalink] [raw]
Subject: Re: [PATCH v2 05/23] x86,entry_64: Remove .fixup usage

On Wed, Nov 10, 2021 at 6:19 PM Peter Zijlstra <[email protected]> wrote:
>
> Place the anonymous .fixup code at the tail of the regular functions.
>
> Signed-off-by: Peter Zijlstra (Intel) <[email protected]>

Reviewed-by: Lai Jiangshan <[email protected]>

> ---
> arch/x86/entry/entry_64.S | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> --- a/arch/x86/entry/entry_64.S
> +++ b/arch/x86/entry/entry_64.S
> @@ -735,13 +735,9 @@ SYM_FUNC_START(asm_load_gs_index)
> swapgs
> FRAME_END
> ret
> -SYM_FUNC_END(asm_load_gs_index)
> -EXPORT_SYMBOL(asm_load_gs_index)
>
> - _ASM_EXTABLE(.Lgs_change, .Lbad_gs)
> - .section .fixup, "ax"
> /* running with kernelgs */
> -SYM_CODE_START_LOCAL_NOALIGN(.Lbad_gs)
> +.Lbad_gs:
> swapgs /* switch back to user gs */
> .macro ZAP_GS
> /* This can't be a string because the preprocessor needs to see it. */
> @@ -752,8 +748,11 @@ SYM_CODE_START_LOCAL_NOALIGN(.Lbad_gs)
> xorl %eax, %eax
> movl %eax, %gs
> jmp 2b
> -SYM_CODE_END(.Lbad_gs)
> - .previous
> +
> + _ASM_EXTABLE(.Lgs_change, .Lbad_gs)
> +
> +SYM_FUNC_END(asm_load_gs_index)
> +EXPORT_SYMBOL(asm_load_gs_index)
>
> #ifdef CONFIG_XEN_PV
> /*
>
>

2021-12-13 10:15:15

by tip-bot2 for Jacob Pan

[permalink] [raw]
Subject: [tip: x86/core] x86/entry_64: Remove .fixup usage

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

Commit-ID: 16e617d05ef0c521d000c989796412ce713f28c9
Gitweb: https://git.kernel.org/tip/16e617d05ef0c521d000c989796412ce713f28c9
Author: Peter Zijlstra <[email protected]>
AuthorDate: Wed, 10 Nov 2021 11:01:07 +01:00
Committer: Peter Zijlstra <[email protected]>
CommitterDate: Sat, 11 Dec 2021 09:09:46 +01:00

x86/entry_64: Remove .fixup usage

Place the anonymous .fixup code at the tail of the regular functions.

Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Josh Poimboeuf <[email protected]>
Reviewed-by: Borislav Petkov <[email protected]>
Reviewed-by: Lai Jiangshan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
arch/x86/entry/entry_64.S | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index e23319a..1ffdbfa 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -739,13 +739,9 @@ SYM_FUNC_START(asm_load_gs_index)
swapgs
FRAME_END
RET
-SYM_FUNC_END(asm_load_gs_index)
-EXPORT_SYMBOL(asm_load_gs_index)

- _ASM_EXTABLE(.Lgs_change, .Lbad_gs)
- .section .fixup, "ax"
/* running with kernelgs */
-SYM_CODE_START_LOCAL_NOALIGN(.Lbad_gs)
+.Lbad_gs:
swapgs /* switch back to user gs */
.macro ZAP_GS
/* This can't be a string because the preprocessor needs to see it. */
@@ -756,8 +752,11 @@ SYM_CODE_START_LOCAL_NOALIGN(.Lbad_gs)
xorl %eax, %eax
movl %eax, %gs
jmp 2b
-SYM_CODE_END(.Lbad_gs)
- .previous
+
+ _ASM_EXTABLE(.Lgs_change, .Lbad_gs)
+
+SYM_FUNC_END(asm_load_gs_index)
+EXPORT_SYMBOL(asm_load_gs_index)

#ifdef CONFIG_XEN_PV
/*