2020-02-25 23:30:24

by Thomas Gleixner

[permalink] [raw]
Subject: [patch 02/24] x86/entry/64: Avoid pointless code when CONTEXT_TRACKING=n

GAS cannot optimize out the test and conditional jump when context tracking
is disabled and CALL_enter_from_user_mode is an empty macro.

Wrap it in #ifdeffery. Will go away once all this is moved to C.

Signed-off-by: Thomas Gleixner <[email protected]>
---
arch/x86/entry/entry_64.S | 2 ++
1 file changed, 2 insertions(+)

--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -884,12 +884,14 @@ apicinterrupt IRQ_WORK_VECTOR irq_work
TRACE_IRQS_OFF
.endif

+#ifdef CONFIG_CONTEXT_TRACKING
.if \paranoid == 0
testb $3, CS(%rsp)
jz .Lfrom_kernel_no_context_tracking_\@
CALL_enter_from_user_mode
.Lfrom_kernel_no_context_tracking_\@:
.endif
+#endif

movq %rsp, %rdi /* pt_regs pointer */



2020-02-26 05:53:48

by Andy Lutomirski

[permalink] [raw]
Subject: Re: [patch 02/24] x86/entry/64: Avoid pointless code when CONTEXT_TRACKING=n

On 2/25/20 2:16 PM, Thomas Gleixner wrote:
> GAS cannot optimize out the test and conditional jump when context tracking
> is disabled and CALL_enter_from_user_mode is an empty macro.
>
> Wrap it in #ifdeffery. Will go away once all this is moved to C.

Acked-by: Andy Lutomirski <[email protected]>

2020-02-28 09:41:45

by Alexandre Chartre

[permalink] [raw]
Subject: Re: [patch 02/24] x86/entry/64: Avoid pointless code when CONTEXT_TRACKING=n



On 2/25/20 11:16 PM, Thomas Gleixner wrote:
> GAS cannot optimize out the test and conditional jump when context tracking
> is disabled and CALL_enter_from_user_mode is an empty macro.
>
> Wrap it in #ifdeffery. Will go away once all this is moved to C.
>
> Signed-off-by: Thomas Gleixner <[email protected]>
> ---
> arch/x86/entry/entry_64.S | 2 ++
> 1 file changed, 2 insertions(+)
>

Reviewed-by: Alexandre Chartre <[email protected]>

alex.

2020-03-02 22:25:29

by Frederic Weisbecker

[permalink] [raw]
Subject: Re: [patch 02/24] x86/entry/64: Avoid pointless code when CONTEXT_TRACKING=n

On Tue, Feb 25, 2020 at 11:16:08PM +0100, Thomas Gleixner wrote:
> GAS cannot optimize out the test and conditional jump when context tracking
> is disabled and CALL_enter_from_user_mode is an empty macro.
>
> Wrap it in #ifdeffery. Will go away once all this is moved to C.
>
> Signed-off-by: Thomas Gleixner <[email protected]>

Acked-by: Frederic Weisbecker <[email protected]>