[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200527073107.2127-1-laijs@linux.alibaba.com>
Date: Wed, 27 May 2020 07:31:02 +0000
From: Lai Jiangshan <laijs@...ux.alibaba.com>
To: linux-kernel@...r.kernel.org
Cc: Lai Jiangshan <laijs@...ux.alibaba.com>,
Andy Lutomirski <luto@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
Peter Zijlstra <peterz@...radead.org>,
Alexandre Chartre <alexandre.chartre@...cle.com>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Jann Horn <jannh@...gle.com>,
Dave Hansen <dave.hansen@...ux.intel.com>
Subject: [PATCH 0/5] x86/entry: simply stack switching when exception on userspace
7f2590a110b8("x86/entry/64: Use a per-CPU trampoline stack for IDT entries")
has resulted that when exception on userspace, the kernel (error_entry)
always push the pt_regs to entry stack(sp0), and then copy them to the
kernel stack.
This is a hot path (for example page fault) and interrupt_entry
directly switches to kernel stack and pushes pt_regs to kernel stack.
We should do it for error_entry. This is the job of patch1,2.
Patch 3-5 simply stack switching for .Lerror_bad_iret by just doing
all the work in one function (fixup_bad_iret()).
The patch set is based on tip/master (c021d3d8fe45) (Mon May 25).
The diffstat is "66 insertions(+), 66 deletions(-)", but actually
it mainly adds comments and deletes code.
Cc: Andy Lutomirski <luto@...nel.org>,
Cc: Thomas Gleixner <tglx@...utronix.de>,
Cc: Ingo Molnar <mingo@...hat.com>,
Cc: Borislav Petkov <bp@...en8.de>,
Cc: x86@...nel.org,
Cc: "H. Peter Anvin" <hpa@...or.com>,
Cc: Peter Zijlstra <peterz@...radead.org>,
Cc: Alexandre Chartre <alexandre.chartre@...cle.com>,
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>,
Cc: Jann Horn <jannh@...gle.com>,
Cc: Dave Hansen <dave.hansen@...ux.intel.com>
Lai Jiangshan (5):
x86/entry: introduce macro idtentry_swapgs_and_switch_to_kernel_stack
x86/entry: avoid calling into sync_regs() when entering from userspace
x86/entry: directly switch to kernel stack when .Lerror_bad_iret
x86/entry: remove unused sync_regs()
x86/entry: don't copy to tmp in fixup_bad_iret
arch/x86/entry/entry_64.S | 89 ++++++++++++++++++++----------------
arch/x86/include/asm/traps.h | 1 -
arch/x86/kernel/traps.c | 42 +++++++----------
3 files changed, 66 insertions(+), 66 deletions(-)
--
2.20.1
Powered by blists - more mailing lists