[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190710161137.026cdd47@gandalf.local.home>
Date: Wed, 10 Jul 2019 16:11:37 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: tglx@...utronix.de, bp@...en8.de, mingo@...nel.org,
luto@...nel.org, torvalds@...ux-foundation.org, hpa@...or.com,
dave.hansen@...ux.intel.com, jgross@...e.com,
linux-kernel@...r.kernel.org, zhe.he@...driver.com,
joel@...lfernandes.org, devel@...ukata.com
Subject: Re: [PATCH v2 2/7] x86/entry/32: Simplify common_exception
On Thu, 04 Jul 2019 21:55:57 +0200
Peter Zijlstra <peterz@...radead.org> wrote:
> --- a/arch/x86/entry/entry_32.S
> +++ b/arch/x86/entry/entry_32.S
> @@ -294,9 +294,11 @@
> .Lfinished_frame_\@:
> .endm
>
> -.macro SAVE_ALL pt_regs_ax=%eax switch_stacks=0
> +.macro SAVE_ALL pt_regs_ax=%eax switch_stacks=0 skip_gs=0
> cld
> +.if \skip_gs == 0
> PUSH_GS
> +.endif
> FIXUP_FRAME
> pushl %fs
> pushl %es
> @@ -313,13 +315,13 @@
> movl %edx, %es
> movl $(__KERNEL_PERCPU), %edx
> movl %edx, %fs
> +.if \skip_gs == 0
> SET_KERNEL_GS %edx
> -
> +.endif
> /* Switch to kernel stack if necessary */
> .if \switch_stacks > 0
> SWITCH_TO_KERNEL_STACK
> .endif
> -
> .endm
>
> .macro SAVE_ALL_NMI cr3_reg:req
> @@ -1448,32 +1450,20 @@ END(page_fault)
>
> common_exception:
> /* the function address is in %gs's slot on the stack */
> - FIXUP_FRAME
> - pushl %fs
> - pushl %es
> - pushl %ds
> - pushl %eax
> - movl $(__USER_DS), %eax
> - movl %eax, %ds
> - movl %eax, %es
> - movl $(__KERNEL_PERCPU), %eax
> - movl %eax, %fs
> - pushl %ebp
> - pushl %edi
> - pushl %esi
> - pushl %edx
> - pushl %ecx
> - pushl %ebx
> - SWITCH_TO_KERNEL_STACK
> + SAVE_ALL switch_stacks=1 skip_gs=1
> ENCODE_FRAME_POINTER
> - cld
The only code change of this is that cld moved from the end to the
beginning. As this appears to match other SAVE_ALL users with respect
to ENCODE_FRAME_POINTER, this shouldn't be an issue.
Reviewed-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
-- Steve
> UNWIND_ESPFIX_STACK
> +
Powered by blists - more mailing lists