[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190321210350.GF2490@worktop.programming.kicks-ass.net>
Date: Thu, 21 Mar 2019 22:03:50 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: hpa@...or.com
Cc: Denys Vlasenko <dvlasenk@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Julien Thierry <julien.thierry@....com>,
Will Deacon <will.deacon@....com>,
Andy Lutomirski <luto@...capital.net>,
Ingo Molnar <mingo@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
James Morse <james.morse@....com>, valentin.schneider@....com,
Brian Gerst <brgerst@...il.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Andrew Lutomirski <luto@...nel.org>,
Borislav Petkov <bp@...en8.de>,
Linux List Kernel Mailing <linux-kernel@...r.kernel.org>,
Dmitry Vyukov <dvyukov@...gle.com>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH 01/25] x86: Make SMAP 64-bit only
On Thu, Mar 21, 2019 at 11:18:05AM -0700, hpa@...or.com wrote:
> On March 21, 2019 10:25:05 AM PDT, Denys Vlasenko <dvlasenk@...hat.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.
Powered by blists - more mailing lists