lkml.org 
[lkml]   [2019]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 01/25] x86: Make SMAP 64-bit only
On Thu, Mar 21, 2019 at 11:18:05AM -0700, hpa@zytor.com wrote:
> On March 21, 2019 10:25:05 AM PDT, Denys Vlasenko <dvlasenk@redhat.com> wrote:

> >I did not see evidence of this. In my testing,
> >POPF is always ~20 cycles, even if popped flags are identical to
> >current state of flags.
>
> I think you will find that if you change system flags it is much slower.

So with all the patches in this series applied, only x86_32 will suffer
this, and I don't think anybody still considers that a performance
critical platform.

That said, we could do something terrible like:

--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -673,7 +673,8 @@ ENTRY(__switch_to_asm)
#endif

/* restore callee-saved registers */
- popfl
+ ALTERNATIVE "popl %esi", \
+ "popfl", X86_FEATURE_SMAP
popl %esi
popl %edi
popl %ebx
And then you only pay the POPF penalty when you run a 32bit kernel on a
SMAP enabled CPU, and we have a very good solution in that code: run a
64bit kernel.

\
 
 \ /
  Last update: 2022-09-17 16:05    [W:0.294 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site