Re: [PATCH 14/22] x86/fpu: Eager switch PKRU state

2019-03-21 Thread Sebastian Andrzej Siewior
On 2019-03-12 17:06:18 [-0700], Dave Hansen wrote: > Thanks for doing this. I'll see if I can dig into the test case and > figure out why it's not doing what I expected. It might be that the CPU > _could_ go back to the init state but chooses not to, or that something > else is taking us out of t

Re: [PATCH 14/22] x86/fpu: Eager switch PKRU state

2019-03-11 Thread Sebastian Andrzej Siewior
On 2019-03-11 12:06:05 [+0100], To Dave Hansen wrote: > On 2019-03-08 11:01:25 [-0800], Dave Hansen wrote: > > On 3/8/19 10:08 AM, Sebastian Andrzej Siewior wrote: > > > On 2019-02-25 10:16:24 [-0800], Dave Hansen wrote: > > >>> + if (!cpu_feature_enabled(X86_FEATURE_OSPKE)) > > >>> +

Re: [PATCH 14/22] x86/fpu: Eager switch PKRU state

2019-03-11 Thread Sebastian Andrzej Siewior
On 2019-03-08 11:01:25 [-0800], Dave Hansen wrote: > On 3/8/19 10:08 AM, Sebastian Andrzej Siewior wrote: > > On 2019-02-25 10:16:24 [-0800], Dave Hansen wrote: > >>> + if (!cpu_feature_enabled(X86_FEATURE_OSPKE)) > >>> + return; > >>> + > >>> + if (current->mm) { > >>> + pk = get_x

Re: [PATCH 14/22] x86/fpu: Eager switch PKRU state

2019-03-08 Thread Dave Hansen
On 3/8/19 10:08 AM, Sebastian Andrzej Siewior wrote: > On 2019-02-25 10:16:24 [-0800], Dave Hansen wrote: >>> + if (!cpu_feature_enabled(X86_FEATURE_OSPKE)) >>> + return; >>> + >>> + if (current->mm) { >>> + pk = get_xsave_addr(&new_fpu->state.xsave, XFEATURE_PKRU); >>> +

Re: [PATCH 14/22] x86/fpu: Eager switch PKRU state

2019-03-08 Thread Sebastian Andrzej Siewior
On 2019-02-25 10:16:24 [-0800], Dave Hansen wrote: > On 2/21/19 3:50 AM, Sebastian Andrzej Siewior wrote: > > diff --git a/arch/x86/include/asm/fpu/internal.h > > b/arch/x86/include/asm/fpu/internal.h > > index 67e4805bccb6f..05f6fce62e9f1 100644 > > --- a/arch/x86/include/asm/fpu/internal.h > > +

Re: [PATCH 14/22] x86/fpu: Eager switch PKRU state

2019-02-25 Thread Dave Hansen
On 2/21/19 3:50 AM, Sebastian Andrzej Siewior wrote: > diff --git a/arch/x86/include/asm/fpu/internal.h > b/arch/x86/include/asm/fpu/internal.h > index 67e4805bccb6f..05f6fce62e9f1 100644 > --- a/arch/x86/include/asm/fpu/internal.h > +++ b/arch/x86/include/asm/fpu/internal.h > @@ -562,8 +562,24 @@

[PATCH 14/22] x86/fpu: Eager switch PKRU state

2019-02-21 Thread Sebastian Andrzej Siewior
From: Rik van Riel While most of a task's FPU state is only needed in user space, the protection keys need to be in place immediately after a context switch. The reason is that any access to userspace memory while running in kernel mode also need to abide by the memory permissions specified in t

[PATCH 14/22] x86/fpu: Eager switch PKRU state

2019-01-09 Thread Sebastian Andrzej Siewior
From: Rik van Riel While most of a task's FPU state is only needed in user space, the protection keys need to be in place immediately after a context switch. The reason is that any access to userspace memory while running in kernel mode also need to abide by the memory permissions specified in t