Re: [patch V2 5/5] x86/kaiser: Add boottime disable switch

2017-11-27 Thread Peter Zijlstra
On Mon, Nov 27, 2017 at 11:22:41AM +0100, Peter Zijlstra wrote: > Could be a simple as this.. but I've not tested. > > > diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c > index f4f4ab8525bd..1be393a97421 100644 > --- a/arch/x86/kernel/cpu/common.c > +++ b/arch/x86/kernel

Re: [patch V2 5/5] x86/kaiser: Add boottime disable switch

2017-11-27 Thread Thomas Gleixner
On Mon, 27 Nov 2017, Josh Poimboeuf wrote: > On Mon, Nov 27, 2017 at 08:00:19PM +0100, Thomas Gleixner wrote: > > On Mon, 27 Nov 2017, Dave Hansen wrote: > > > > > On 11/26/2017 03:14 PM, Thomas Gleixner wrote: > > > > --- a/security/Kconfig > > > > +++ b/security/Kconfig > > > > @@ -56,7 +56,7 @

Re: [patch V2 5/5] x86/kaiser: Add boottime disable switch

2017-11-27 Thread Josh Poimboeuf
On Mon, Nov 27, 2017 at 08:00:19PM +0100, Thomas Gleixner wrote: > On Mon, 27 Nov 2017, Dave Hansen wrote: > > > On 11/26/2017 03:14 PM, Thomas Gleixner wrote: > > > --- a/security/Kconfig > > > +++ b/security/Kconfig > > > @@ -56,7 +56,7 @@ config SECURITY_NETWORK > > > > > > config KAISER > >

Re: [patch V2 5/5] x86/kaiser: Add boottime disable switch

2017-11-27 Thread Thomas Gleixner
On Mon, 27 Nov 2017, Dave Hansen wrote: > On 11/26/2017 03:14 PM, Thomas Gleixner wrote: > > --- a/security/Kconfig > > +++ b/security/Kconfig > > @@ -56,7 +56,7 @@ config SECURITY_NETWORK > > > > config KAISER > > bool "Remove the kernel mapping in user mode" > > - depends on X86_64 && S

Re: [patch V2 5/5] x86/kaiser: Add boottime disable switch

2017-11-27 Thread Dave Hansen
On 11/26/2017 03:14 PM, Thomas Gleixner wrote: > --- a/security/Kconfig > +++ b/security/Kconfig > @@ -56,7 +56,7 @@ config SECURITY_NETWORK > > config KAISER > bool "Remove the kernel mapping in user mode" > - depends on X86_64 && SMP && !PARAVIRT > + depends on X86_64 && SMP && !

Re: [patch V2 5/5] x86/kaiser: Add boottime disable switch

2017-11-27 Thread Peter Zijlstra
On Mon, Nov 27, 2017 at 12:50:45PM +0100, Thomas Gleixner wrote: > On Mon, 27 Nov 2017, Peter Zijlstra wrote: > > On Mon, Nov 27, 2017 at 10:48:46AM +0100, Peter Zijlstra wrote: > > > So in patch 15 Andy notes that we should probably also disable the > > > SYSCALL trampoline when we disable KAISER

Re: [patch V2 5/5] x86/kaiser: Add boottime disable switch

2017-11-27 Thread Thomas Gleixner
On Mon, 27 Nov 2017, Peter Zijlstra wrote: > On Mon, Nov 27, 2017 at 10:48:46AM +0100, Peter Zijlstra wrote: > > On Mon, Nov 27, 2017 at 12:14:08AM +0100, Thomas Gleixner wrote: > > > KAISER comes with overhead. The most expensive part is the CR3 switching > > > in > > > the entry code. > > > > >

Re: [patch V2 5/5] x86/kaiser: Add boottime disable switch

2017-11-27 Thread Peter Zijlstra
On Mon, Nov 27, 2017 at 10:48:46AM +0100, Peter Zijlstra wrote: > On Mon, Nov 27, 2017 at 12:14:08AM +0100, Thomas Gleixner wrote: > > KAISER comes with overhead. The most expensive part is the CR3 switching in > > the entry code. > > > > Add a command line parameter which allows to disable KAISER

Re: [patch V2 5/5] x86/kaiser: Add boottime disable switch

2017-11-27 Thread Peter Zijlstra
On Mon, Nov 27, 2017 at 12:14:08AM +0100, Thomas Gleixner wrote: > KAISER comes with overhead. The most expensive part is the CR3 switching in > the entry code. > > Add a command line parameter which allows to disable KAISER at boot time. > > Most code pathes simply check a variable, but the entr

[patch V2 5/5] x86/kaiser: Add boottime disable switch

2017-11-26 Thread Thomas Gleixner
KAISER comes with overhead. The most expensive part is the CR3 switching in the entry code. Add a command line parameter which allows to disable KAISER at boot time. Most code pathes simply check a variable, but the entry code uses a static branch. The other code pathes cannot use a static branch