[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-8b376fae0514dc7ee04786e2327169e39d12e51b@git.kernel.org>
Date: Thu, 19 Jul 2018 16:23:03 -0700
From: tip-bot for Joerg Roedel <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: David.Laight@...lab.com, peterz@...radead.org, hpa@...or.com,
llong@...hat.com, dhgutteridge@...patico.ca, luto@...nel.org,
dvlasenk@...hat.com, jroedel@...e.de, mingo@...nel.org,
eduval@...zon.com, will.deacon@....com, dave.hansen@...el.com,
jpoimboe@...hat.com, pavel@....cz, aarcange@...hat.com,
bp@...en8.de, jgross@...e.com, boris.ostrovsky@...cle.com,
jkosina@...e.cz, gregkh@...uxfoundation.org, tglx@...utronix.de,
brgerst@...il.com, linux-kernel@...r.kernel.org,
torvalds@...ux-foundation.org
Subject: [tip:x86/pti] x86/entry/32: Introduce SAVE_ALL_NMI and
RESTORE_ALL_NMI
Commit-ID: 8b376fae0514dc7ee04786e2327169e39d12e51b
Gitweb: https://git.kernel.org/tip/8b376fae0514dc7ee04786e2327169e39d12e51b
Author: Joerg Roedel <jroedel@...e.de>
AuthorDate: Wed, 18 Jul 2018 11:40:46 +0200
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Fri, 20 Jul 2018 01:11:38 +0200
x86/entry/32: Introduce SAVE_ALL_NMI and RESTORE_ALL_NMI
These macros will be used in the NMI handler code and replace plain
SAVE_ALL and RESTORE_REGS there.
The NMI-specific CR3-switch will be added to these macros later.
Signed-off-by: Joerg Roedel <jroedel@...e.de>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Tested-by: Pavel Machek <pavel@....cz>
Cc: "H . Peter Anvin" <hpa@...or.com>
Cc: linux-mm@...ck.org
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Dave Hansen <dave.hansen@...el.com>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Juergen Gross <jgross@...e.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Jiri Kosina <jkosina@...e.cz>
Cc: Boris Ostrovsky <boris.ostrovsky@...cle.com>
Cc: Brian Gerst <brgerst@...il.com>
Cc: David Laight <David.Laight@...lab.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: Eduardo Valentin <eduval@...zon.com>
Cc: Greg KH <gregkh@...uxfoundation.org>
Cc: Will Deacon <will.deacon@....com>
Cc: aliguori@...zon.com
Cc: daniel.gruss@...k.tugraz.at
Cc: hughd@...gle.com
Cc: keescook@...gle.com
Cc: Andrea Arcangeli <aarcange@...hat.com>
Cc: Waiman Long <llong@...hat.com>
Cc: "David H . Gutteridge" <dhgutteridge@...patico.ca>
Cc: joro@...tes.org
Link: https://lkml.kernel.org/r/1531906876-13451-10-git-send-email-joro@8bytes.org
---
arch/x86/entry/entry_32.S | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index a905e6215ea9..763592596727 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -181,6 +181,9 @@
.endm
+.macro SAVE_ALL_NMI
+ SAVE_ALL
+.endm
/*
* This is a sneaky trick to help the unwinder find pt_regs on the stack. The
* frame pointer is replaced with an encoded pointer to pt_regs. The encoding
@@ -227,6 +230,10 @@
POP_GS_EX
.endm
+.macro RESTORE_ALL_NMI pop=0
+ RESTORE_REGS pop=\pop
+.endm
+
.macro CHECK_AND_APPLY_ESPFIX
#ifdef CONFIG_X86_ESPFIX32
#define GDT_ESPFIX_SS PER_CPU_VAR(gdt_page) + (GDT_ENTRY_ESPFIX_SS * 8)
@@ -1161,7 +1168,7 @@ ENTRY(nmi)
#endif
pushl %eax # pt_regs->orig_ax
- SAVE_ALL
+ SAVE_ALL_NMI
ENCODE_FRAME_POINTER
xorl %edx, %edx # zero error code
movl %esp, %eax # pt_regs pointer
@@ -1189,7 +1196,7 @@ ENTRY(nmi)
.Lnmi_return:
CHECK_AND_APPLY_ESPFIX
- RESTORE_REGS 4
+ RESTORE_ALL_NMI pop=4
jmp .Lirq_return
#ifdef CONFIG_X86_ESPFIX32
@@ -1205,12 +1212,12 @@ ENTRY(nmi)
pushl 16(%esp)
.endr
pushl %eax
- SAVE_ALL
+ SAVE_ALL_NMI
ENCODE_FRAME_POINTER
FIXUP_ESPFIX_STACK # %eax == %esp
xorl %edx, %edx # zero error code
call do_nmi
- RESTORE_REGS
+ RESTORE_ALL_NMI
lss 12+4(%esp), %esp # back to espfix stack
jmp .Lirq_return
#endif
Powered by blists - more mailing lists