Re: [PATCH 2/7] x86/enter: MACROS to set/clear IBRS

2018-01-05 Thread Thomas Gleixner
On Thu, 4 Jan 2018, Tim Chen wrote: > On 01/04/2018 02:16 PM, Peter Zijlstra wrote: > >> + movl\save_reg, %eax > >> + wrmsr > >> +10: > >> +.endm > > > > Should not all those 10 things look like .Ldone_\@ or something ? > > > > They are removed in patch 6 with .Ldone_\@ So we need to

Re: [PATCH 2/7] x86/enter: MACROS to set/clear IBRS

2018-01-05 Thread Thomas Gleixner
On Thu, 4 Jan 2018, Tim Chen wrote: > On 01/04/2018 02:16 PM, Peter Zijlstra wrote: > >> + movl\save_reg, %eax > >> + wrmsr > >> +10: > >> +.endm > > > > Should not all those 10 things look like .Ldone_\@ or something ? > > > > They are removed in patch 6 with .Ldone_\@ So we need to

Re: [PATCH 2/7] x86/enter: MACROS to set/clear IBRS

2018-01-04 Thread Dave Hansen
On 01/04/2018 08:54 PM, Andy Lutomirski wrote: > On Thu, Jan 4, 2018 at 2:23 PM, Dave Hansen wrote: >> On 01/04/2018 02:21 PM, Tim Chen wrote: Does this really have to live outside of arch/x86/entry/ ? >>> There are some inline C routines later in this file >>>

Re: [PATCH 2/7] x86/enter: MACROS to set/clear IBRS

2018-01-04 Thread Dave Hansen
On 01/04/2018 08:54 PM, Andy Lutomirski wrote: > On Thu, Jan 4, 2018 at 2:23 PM, Dave Hansen wrote: >> On 01/04/2018 02:21 PM, Tim Chen wrote: Does this really have to live outside of arch/x86/entry/ ? >>> There are some inline C routines later in this file >>> that will be needed by

Re: [PATCH 2/7] x86/enter: MACROS to set/clear IBRS

2018-01-04 Thread Andy Lutomirski
On Thu, Jan 4, 2018 at 2:23 PM, Dave Hansen wrote: > On 01/04/2018 02:21 PM, Tim Chen wrote: >>> Does this really have to live outside of arch/x86/entry/ ? >>> >> There are some inline C routines later in this file >> that will be needed by other functions. Want to

Re: [PATCH 2/7] x86/enter: MACROS to set/clear IBRS

2018-01-04 Thread Andy Lutomirski
On Thu, Jan 4, 2018 at 2:23 PM, Dave Hansen wrote: > On 01/04/2018 02:21 PM, Tim Chen wrote: >>> Does this really have to live outside of arch/x86/entry/ ? >>> >> There are some inline C routines later in this file >> that will be needed by other functions. Want to consolidate >> them in the

Re: [PATCH 2/7] x86/enter: MACROS to set/clear IBRS

2018-01-04 Thread Dave Hansen
On 01/04/2018 02:21 PM, Tim Chen wrote: >> Does this really have to live outside of arch/x86/entry/ ? >> > There are some inline C routines later in this file > that will be needed by other functions. Want to consolidate > them in the same file. We could put all of the assembly into calling.h

Re: [PATCH 2/7] x86/enter: MACROS to set/clear IBRS

2018-01-04 Thread Dave Hansen
On 01/04/2018 02:21 PM, Tim Chen wrote: >> Does this really have to live outside of arch/x86/entry/ ? >> > There are some inline C routines later in this file > that will be needed by other functions. Want to consolidate > them in the same file. We could put all of the assembly into calling.h

Re: [PATCH 2/7] x86/enter: MACROS to set/clear IBRS

2018-01-04 Thread Tim Chen
On 01/04/2018 02:16 PM, Peter Zijlstra wrote: > On Thu, Jan 04, 2018 at 09:56:43AM -0800, Tim Chen wrote: >> diff --git a/arch/x86/include/asm/spec_ctrl.h >> b/arch/x86/include/asm/spec_ctrl.h >> new file mode 100644 >> index 000..16fc4f58 >> --- /dev/null >> +++

Re: [PATCH 2/7] x86/enter: MACROS to set/clear IBRS

2018-01-04 Thread Tim Chen
On 01/04/2018 02:16 PM, Peter Zijlstra wrote: > On Thu, Jan 04, 2018 at 09:56:43AM -0800, Tim Chen wrote: >> diff --git a/arch/x86/include/asm/spec_ctrl.h >> b/arch/x86/include/asm/spec_ctrl.h >> new file mode 100644 >> index 000..16fc4f58 >> --- /dev/null >> +++

Re: [PATCH 2/7] x86/enter: MACROS to set/clear IBRS

2018-01-04 Thread Peter Zijlstra
On Thu, Jan 04, 2018 at 09:56:43AM -0800, Tim Chen wrote: > diff --git a/arch/x86/include/asm/spec_ctrl.h > b/arch/x86/include/asm/spec_ctrl.h > new file mode 100644 > index 000..16fc4f58 > --- /dev/null > +++ b/arch/x86/include/asm/spec_ctrl.h Does this really have to live outside of

Re: [PATCH 2/7] x86/enter: MACROS to set/clear IBRS

2018-01-04 Thread Peter Zijlstra
On Thu, Jan 04, 2018 at 09:56:43AM -0800, Tim Chen wrote: > diff --git a/arch/x86/include/asm/spec_ctrl.h > b/arch/x86/include/asm/spec_ctrl.h > new file mode 100644 > index 000..16fc4f58 > --- /dev/null > +++ b/arch/x86/include/asm/spec_ctrl.h Does this really have to live outside of

[PATCH 2/7] x86/enter: MACROS to set/clear IBRS

2018-01-04 Thread Tim Chen
Create macros to control IBRS. Use these macros to enable IBRS on kernel entry paths and disable IBRS on kernel exit paths. The registers rax, rcx and rdx are touched when controlling IBRS so they need to be saved when they can't be clobbered. Signed-off-by: Tim Chen

[PATCH 2/7] x86/enter: MACROS to set/clear IBRS

2018-01-04 Thread Tim Chen
Create macros to control IBRS. Use these macros to enable IBRS on kernel entry paths and disable IBRS on kernel exit paths. The registers rax, rcx and rdx are touched when controlling IBRS so they need to be saved when they can't be clobbered. Signed-off-by: Tim Chen ---