All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lai Jiangshan <laijs@linux.alibaba.com>
To: Lai Jiangshan <jiangshanlai@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Alexandre Chartre <alexandre.chartre@oracle.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Jann Horn <jannh@google.com>,
	Dave Hansen <dave.hansen@linux.intel.com>
Subject: Re: [PATCH V3 0/3] x86/entry: simply stack switching when exception on userspace
Date: Mon, 17 Aug 2020 13:31:18 +0800	[thread overview]
Message-ID: <879c4480-9629-9a9c-ce93-f72118f068db@linux.alibaba.com> (raw)
In-Reply-To: <20200817062355.2884-1-jiangshanlai@gmail.com>


Deeply sorry, the cover-letter was forgotten to send to LKML.

Here it is:

On 2020/8/17 14:23, Lai Jiangshan wrote:
> From: Lai Jiangshan <laijs@linux.alibaba.com>
> 
> 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.
> 
> And recent x86/entry work makes interrupt also use idtentry
> and makes all the interrupt code save the pt_regs on the sp0 stack
> and then copy it to the thread stack like exception.
> 
> This is hot path (page fault, ipi), such overhead should be avoided.
> And the original 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.
> 
> Patch 2-3 simplify stack switching for .Lerror_bad_iret by just doing
> all the work in one function (fixup_bad_iret()).
> 
> The patch set is based on v5.9-rc1
> 
> Changed from V1:
> 	based on tip/master -> based on tip/x86/entry
> 
> 	patch 1 replaces the patch1,2 of V1, it borrows the
> 	original interrupt_entry's code into error_entry.
> 
> 	patch2-4 is V1's patch3-5, unchanged (but rebased)
> 
> Changed from V2:
> 	(re-)based on v5.9-rc1
> 	drop the patch4 of V2 patchset
> 
> Cc: Andy Lutomirski <luto@kernel.org>,
> Cc: Thomas Gleixner <tglx@linutronix.de>,
> Cc: Ingo Molnar <mingo@redhat.com>,
> Cc: Borislav Petkov <bp@alien8.de>,
> Cc: x86@kernel.org,
> Cc: "H. Peter Anvin" <hpa@zytor.com>,
> Cc: Peter Zijlstra <peterz@infradead.org>,
> Cc: Alexandre Chartre <alexandre.chartre@oracle.com>,
> Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
> Cc: Jann Horn <jannh@google.com>,
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> 
> 
> Lai Jiangshan (3):
>    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()
> 
>   arch/x86/entry/entry_64.S    | 52 +++++++++++++++++++++++-------------
>   arch/x86/include/asm/traps.h |  1 -
>   arch/x86/kernel/traps.c      | 22 +++------------
>   3 files changed, 38 insertions(+), 37 deletions(-)
> 

  parent reply	other threads:[~2020-08-17  5:31 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27  7:31 [PATCH 0/5] x86/entry: simply stack switching when exception on userspace Lai Jiangshan
2020-05-27  7:31 ` [PATCH 1/5] x86/entry: introduce macro idtentry_swapgs_and_switch_to_kernel_stack Lai Jiangshan
2020-05-28 19:12   ` Thomas Gleixner
2020-05-29  8:26     ` [PATCH V2 0/4] x86/entry: simply stack switching when exception on userspace Lai Jiangshan
2020-05-29  8:26       ` [PATCH V2 1/4] x86/entry: avoid calling into sync_regs() when entering from userspace Lai Jiangshan
2020-05-29  8:26       ` [PATCH V2 2/4] x86/entry: directly switch to kernel stack when .Lerror_bad_iret Lai Jiangshan
2020-05-29  8:26       ` [PATCH V2 3/4] x86/entry: remove unused sync_regs() Lai Jiangshan
2020-05-29  8:26       ` [PATCH V2 4/4] x86/entry: don't copy to tmp in fixup_bad_iret Lai Jiangshan
2020-05-29 18:32       ` [PATCH V2 0/4] x86/entry: simply stack switching when exception on userspace Andy Lutomirski
2020-06-16  1:56         ` Lai Jiangshan
2020-06-18 13:52           ` Lai Jiangshan
2020-06-18 14:10             ` Thomas Gleixner
2020-06-27 21:03               ` Andy Lutomirski
     [not found]                 ` <20200817062355.2884-1-jiangshanlai@gmail.com>
2020-08-17  5:31                   ` Lai Jiangshan [this message]
2020-09-10 10:12                     ` [PATCH V3 0/3] " Lai Jiangshan
2020-08-17  6:23                   ` [PATCH V3 1/3] x86/entry: avoid calling into sync_regs() when entering from userspace Lai Jiangshan
2020-09-11 21:24                     ` Jann Horn
2020-09-15  7:55                       ` Lai Jiangshan
2020-08-17  6:23                   ` [PATCH V3 2/3] x86/entry: directly switch to kernel stack when .Lerror_bad_iret Lai Jiangshan
2020-08-17  6:23                   ` [PATCH V3 3/3] x86/entry: remove unused sync_regs() Lai Jiangshan
2020-05-27  7:31 ` [PATCH 2/5] x86/entry: avoid calling into sync_regs() when entering from userspace Lai Jiangshan
2020-05-27  7:31 ` [PATCH 3/5] x86/entry: directly switch to kernel stack when .Lerror_bad_iret Lai Jiangshan
2020-05-27  7:31 ` [PATCH 4/5] x86/entry: remove unused sync_regs() Lai Jiangshan
2020-05-27  7:31 ` [PATCH 5/5] x86/entry: don't copy to tmp in fixup_bad_iret Lai Jiangshan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=879c4480-9629-9a9c-ce93-f72118f068db@linux.alibaba.com \
    --to=laijs@linux.alibaba.com \
    --cc=alexandre.chartre@oracle.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --cc=jannh@google.com \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.