2020-03-08 23:27:32

by Thomas Gleixner

[permalink] [raw]
Subject: [patch part-II V2 04/13] x86/entry/64: Trace irqflags unconditionally as ON when returning to user space

User space cannot longer disable interrupts so trace return to user space
unconditionally as IRQS_ON.

Signed-off-by: Thomas Gleixner <[email protected]>
---
V2: Cover 32bit as well
---
arch/x86/entry/entry_32.S | 2 +-
arch/x86/entry/entry_64.S | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -1088,7 +1088,7 @@ SYM_FUNC_START(entry_INT80_32)
STACKLEAK_ERASE

restore_all:
- TRACE_IRQS_IRET
+ TRACE_IRQS_ON
SWITCH_TO_ENTRY_STACK
CHECK_AND_APPLY_ESPFIX

--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -174,7 +174,7 @@ SYM_INNER_LABEL(entry_SYSCALL_64_after_h
movq %rsp, %rsi
call do_syscall_64 /* returns with IRQs disabled */

- TRACE_IRQS_IRETQ /* we're about to change IF */
+ TRACE_IRQS_ON /* return enables interrupts */

/*
* Try to use SYSRET instead of IRET if we're returning to
@@ -619,7 +619,7 @@ SYM_CODE_START_LOCAL(common_interrupt)
.Lretint_user:
mov %rsp,%rdi
call prepare_exit_to_usermode
- TRACE_IRQS_IRETQ
+ TRACE_IRQS_ON

SYM_INNER_LABEL(swapgs_restore_regs_and_return_to_usermode, SYM_L_GLOBAL)
#ifdef CONFIG_DEBUG_ENTRY


2020-03-10 10:28:21

by Alexandre Chartre

[permalink] [raw]
Subject: Re: [patch part-II V2 04/13] x86/entry/64: Trace irqflags unconditionally as ON when returning to user space


On 3/8/20 11:24 PM, Thomas Gleixner wrote:
> User space cannot longer disable interrupts so trace return to user space
> unconditionally as IRQS_ON.
>
> Signed-off-by: Thomas Gleixner <[email protected]>
> ---
> V2: Cover 32bit as well
> ---
> arch/x86/entry/entry_32.S | 2 +-
> arch/x86/entry/entry_64.S | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>

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

alex.

> --- a/arch/x86/entry/entry_32.S
> +++ b/arch/x86/entry/entry_32.S
> @@ -1088,7 +1088,7 @@ SYM_FUNC_START(entry_INT80_32)
> STACKLEAK_ERASE
>
> restore_all:
> - TRACE_IRQS_IRET
> + TRACE_IRQS_ON
> SWITCH_TO_ENTRY_STACK
> CHECK_AND_APPLY_ESPFIX
>
> --- a/arch/x86/entry/entry_64.S
> +++ b/arch/x86/entry/entry_64.S
> @@ -174,7 +174,7 @@ SYM_INNER_LABEL(entry_SYSCALL_64_after_h
> movq %rsp, %rsi
> call do_syscall_64 /* returns with IRQs disabled */
>
> - TRACE_IRQS_IRETQ /* we're about to change IF */
> + TRACE_IRQS_ON /* return enables interrupts */
>
> /*
> * Try to use SYSRET instead of IRET if we're returning to
> @@ -619,7 +619,7 @@ SYM_CODE_START_LOCAL(common_interrupt)
> .Lretint_user:
> mov %rsp,%rdi
> call prepare_exit_to_usermode
> - TRACE_IRQS_IRETQ
> + TRACE_IRQS_ON
>
> SYM_INNER_LABEL(swapgs_restore_regs_and_return_to_usermode, SYM_L_GLOBAL)
> #ifdef CONFIG_DEBUG_ENTRY
>

Subject: [tip: x86/entry] x86/entry/64: Trace irqflags unconditionally as ON when returning to user space

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

Commit-ID: 810f80a61be8c1d4a574082737f7a18c7459fa7b
Gitweb: https://git.kernel.org/tip/810f80a61be8c1d4a574082737f7a18c7459fa7b
Author: Thomas Gleixner <[email protected]>
AuthorDate: Sun, 08 Mar 2020 23:24:03 +01:00
Committer: Thomas Gleixner <[email protected]>
CommitterDate: Tue, 10 Mar 2020 13:56:32 +01:00

x86/entry/64: Trace irqflags unconditionally as ON when returning to user space

User space cannot disable interrupts any longer so trace return to user space
unconditionally as IRQS_ON.

Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Alexandre Chartre <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
---
arch/x86/entry/entry_32.S | 2 +-
arch/x86/entry/entry_64.S | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index 80df781..b67bae7 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -1088,7 +1088,7 @@ SYM_FUNC_START(entry_INT80_32)
STACKLEAK_ERASE

restore_all:
- TRACE_IRQS_IRET
+ TRACE_IRQS_ON
SWITCH_TO_ENTRY_STACK
CHECK_AND_APPLY_ESPFIX

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index f2bb91e..0e9504f 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -174,7 +174,7 @@ SYM_INNER_LABEL(entry_SYSCALL_64_after_hwframe, SYM_L_GLOBAL)
movq %rsp, %rsi
call do_syscall_64 /* returns with IRQs disabled */

- TRACE_IRQS_IRETQ /* we're about to change IF */
+ TRACE_IRQS_ON /* return enables interrupts */

/*
* Try to use SYSRET instead of IRET if we're returning to
@@ -619,7 +619,7 @@ ret_from_intr:
.Lretint_user:
mov %rsp,%rdi
call prepare_exit_to_usermode
- TRACE_IRQS_IRETQ
+ TRACE_IRQS_ON

SYM_INNER_LABEL(swapgs_restore_regs_and_return_to_usermode, SYM_L_GLOBAL)
#ifdef CONFIG_DEBUG_ENTRY