Re: [PATCH 17/23] x86/fpu: Eager switch PKRU state
On 2018-11-08 12:12:52 [+0100], Paolo Bonzini wrote: > On 07/11/2018 20:48, Sebastian Andrzej Siewior wrote: > > index 375226055a413..5b33985d9f475 100644 > > --- a/arch/x86/kernel/fpu/xstate.c > > +++ b/arch/x86/kernel/fpu/xstate.c > > @@ -811,7 +811,7 @@ void fpu__resume_cpu(void) > > * > > * Note: does not work for compacted buffers. > > */ > > The comment is wrong, which was already the case before but it becomes a > bit more important if the function is used outside its module. let me fix it. > However, why not use get_xsave_addr? I don't see why it is important to > skip the checks, and if it is it probably deserves a comment. "Raw" and > double underscores in the function name is scary... yeah, it is scary and only those that can face baba jaga may use it. I though it is a fast path and it would be okay to skip those checks. However. Let me fix the comment and use the normal function like everyone else. If it is too slow then we can still short circuit it later. > Paolo Sebastian
Re: [PATCH 17/23] x86/fpu: Eager switch PKRU state
On 2018-11-08 12:12:52 [+0100], Paolo Bonzini wrote: > On 07/11/2018 20:48, Sebastian Andrzej Siewior wrote: > > index 375226055a413..5b33985d9f475 100644 > > --- a/arch/x86/kernel/fpu/xstate.c > > +++ b/arch/x86/kernel/fpu/xstate.c > > @@ -811,7 +811,7 @@ void fpu__resume_cpu(void) > > * > > * Note: does not work for compacted buffers. > > */ > > The comment is wrong, which was already the case before but it becomes a > bit more important if the function is used outside its module. let me fix it. > However, why not use get_xsave_addr? I don't see why it is important to > skip the checks, and if it is it probably deserves a comment. "Raw" and > double underscores in the function name is scary... yeah, it is scary and only those that can face baba jaga may use it. I though it is a fast path and it would be okay to skip those checks. However. Let me fix the comment and use the normal function like everyone else. If it is too slow then we can still short circuit it later. > Paolo Sebastian
Re: [PATCH 17/23] x86/fpu: Eager switch PKRU state
On 07/11/2018 20:48, Sebastian Andrzej Siewior wrote: > index 375226055a413..5b33985d9f475 100644 > --- a/arch/x86/kernel/fpu/xstate.c > +++ b/arch/x86/kernel/fpu/xstate.c > @@ -811,7 +811,7 @@ void fpu__resume_cpu(void) > * > * Note: does not work for compacted buffers. > */ The comment is wrong, which was already the case before but it becomes a bit more important if the function is used outside its module. However, why not use get_xsave_addr? I don't see why it is important to skip the checks, and if it is it probably deserves a comment. "Raw" and double underscores in the function name is scary... Paolo > -static void *__raw_xsave_addr(struct xregs_state *xsave, int xfeature_nr) > +void *__raw_xsave_addr(struct xregs_state *xsave, int xfeature_nr) > { > if (!xfeature_enabled(xfeature_nr)) { > WARN_ON_FPU(1);
Re: [PATCH 17/23] x86/fpu: Eager switch PKRU state
On 07/11/2018 20:48, Sebastian Andrzej Siewior wrote: > index 375226055a413..5b33985d9f475 100644 > --- a/arch/x86/kernel/fpu/xstate.c > +++ b/arch/x86/kernel/fpu/xstate.c > @@ -811,7 +811,7 @@ void fpu__resume_cpu(void) > * > * Note: does not work for compacted buffers. > */ The comment is wrong, which was already the case before but it becomes a bit more important if the function is used outside its module. However, why not use get_xsave_addr? I don't see why it is important to skip the checks, and if it is it probably deserves a comment. "Raw" and double underscores in the function name is scary... Paolo > -static void *__raw_xsave_addr(struct xregs_state *xsave, int xfeature_nr) > +void *__raw_xsave_addr(struct xregs_state *xsave, int xfeature_nr) > { > if (!xfeature_enabled(xfeature_nr)) { > WARN_ON_FPU(1);