diff mbox series

[01/11] x86/entry: Use swapgs and native_iret directly in swapgs_restore_regs_and_return_to_usermode

Message ID 20211208110833.65366-2-jiangshanlai@gmail.com (mailing list archive)
State New, archived
Headers show
Series x86/entry: Clean up entry code | expand

Commit Message

Lai Jiangshan Dec. 8, 2021, 11:08 a.m. UTC
From: Lai Jiangshan <laijs@linux.alibaba.com>

swapgs_restore_regs_and_return_to_usermode() is used in native code
(non-xenpv) only now, so it doesn't need the PV-aware SWAPGS and
INTERRUPT_RETURN.

Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
---
 arch/x86/entry/entry_64.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jürgen Groß Dec. 13, 2021, 12:13 p.m. UTC | #1
On 08.12.21 12:08, Lai Jiangshan wrote:
> From: Lai Jiangshan <laijs@linux.alibaba.com>
> 
> swapgs_restore_regs_and_return_to_usermode() is used in native code
> (non-xenpv) only now, so it doesn't need the PV-aware SWAPGS and
> INTERRUPT_RETURN.
> 
> Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen
diff mbox series

Patch

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 97b1f84bb53f..d95a02ecee16 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -608,8 +608,8 @@  SYM_INNER_LABEL(swapgs_restore_regs_and_return_to_usermode, SYM_L_GLOBAL)
 
 	/* Restore RDI. */
 	popq	%rdi
-	SWAPGS
-	INTERRUPT_RETURN
+	swapgs
+	jmp	native_iret
 
 
 SYM_INNER_LABEL(restore_regs_and_return_to_kernel, SYM_L_GLOBAL)