Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline

2018-06-05 Thread Nick Desaulniers
On Tue, Jun 5, 2018 at 2:31 PM Arnd Bergmann wrote: > > On Tue, Jun 5, 2018 at 11:28 PM, Arnd Bergmann wrote: > > On Tue, Jun 5, 2018 at 7:05 PM, Nick Desaulniers > > wrote: > >> > >> The semantics of extern inline has changed since gnu89. This means that > >> folks using GCC versions >= 5.1 may

Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline

2018-06-05 Thread Arnd Bergmann
On Tue, Jun 5, 2018 at 11:28 PM, Arnd Bergmann wrote: > On Tue, Jun 5, 2018 at 7:05 PM, Nick Desaulniers > wrote: >> >> The semantics of extern inline has changed since gnu89. This means that >> folks using GCC versions >= 5.1 may see symbol redefinition errors at >> link time for subdirs that ov

Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline

2018-06-05 Thread Arnd Bergmann
On Tue, Jun 5, 2018 at 7:05 PM, Nick Desaulniers wrote: > > The semantics of extern inline has changed since gnu89. This means that > folks using GCC versions >= 5.1 may see symbol redefinition errors at > link time for subdirs that override KBUILD_CFLAGS (making the C standard > used implicit) re

Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline

2018-06-05 Thread H. Peter Anvin
On 06/05/18 10:52, Nick Desaulniers wrote: > > Does the kernel have a different calling convention for 32b x86? How > does that work? regparm=3? Does that need to be added to the > declaration? > Yes, -mregparm=3. No, doesn't need to be added to the declaration. >> Something like this added t

Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline

2018-06-05 Thread Nick Desaulniers
On 06/05/18 10:28, H. Peter Anvin wrote: > On 06/05/18 10:05, Nick Desaulniers wrote: >> + >> +/* >> + * void native_restore_fl(unsigned long flags) >> + * %rdi: flags >> + */ >> +ENTRY(native_restore_fl) >> +push %_ASM_DI >> +popf >> +ret >> +ENDPROC(native_restore_fl) >> +EXPORT_SYMBO

Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline

2018-06-05 Thread Sedat Dilek
On Tue, Jun 5, 2018 at 7:31 PM, H. Peter Anvin wrote: > On 06/05/18 10:28, H. Peter Anvin wrote: >> On 06/05/18 10:05, Nick Desaulniers wrote: >>> + >>> +/* >>> + * void native_restore_fl(unsigned long flags) >>> + * %rdi: flags >>> + */ >>> +ENTRY(native_restore_fl) >>> +push %_ASM_DI >>> +

Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline

2018-06-05 Thread H. Peter Anvin
On 06/05/18 10:28, H. Peter Anvin wrote: > On 06/05/18 10:05, Nick Desaulniers wrote: >> + >> +/* >> + * void native_restore_fl(unsigned long flags) >> + * %rdi: flags >> + */ >> +ENTRY(native_restore_fl) >> +push %_ASM_DI >> +popf >> +ret >> +ENDPROC(native_restore_fl) >> +EXPORT_SYMBO

Re: [PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline

2018-06-05 Thread H. Peter Anvin
On 06/05/18 10:05, Nick Desaulniers wrote: > + > +/* > + * void native_restore_fl(unsigned long flags) > + * %rdi: flags > + */ > +ENTRY(native_restore_fl) > + push %_ASM_DI > + popf > + ret > +ENDPROC(native_restore_fl) > +EXPORT_SYMBOL(native_restore_fl) > To work on i386, this woul

[PATCH v2 2/2] x86: paravirt: make native_save_fl extern inline

2018-06-05 Thread Nick Desaulniers
native_save_fl() is marked static inline, but by using it as a function pointer in arch/x86/kernel/paravirt.c, it MUST be outlined. paravirt's use of native_save_fl() also requires that no GPRs other than %rax are clobbered. Compilers have different heuristics which they use to emit stack guard c