Re: [4.4 STABLE BACKPORT] x86: paravirt: make native_save_fl extern inline
On Fri, Jul 20, 2018 at 03:36:41PM -0700, Nick Desaulniers wrote: > 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 > code, the emittance of which can break paravirt's callee saved assumption > by clobbering %rcx. > > Marking a function definition extern inline means that if this version > cannot be inlined, then the out-of-line version will be preferred. By > having the out-of-line version be implemented in assembly, it cannot be > instrumented with a stack protector, which might violate custom calling > conventions that code like paravirt rely on. > > 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) regardless of this patch. This has been cleaned up > earlier in the patch set, but is left as a note in the commit message > for future travelers. > > Reports: > https://lkml.org/lkml/2018/5/7/534 > https://github.com/ClangBuiltLinux/linux/issues/16 > > Discussion: > https://bugs.llvm.org/show_bug.cgi?id=37512 > https://lkml.org/lkml/2018/5/24/1371 > > Thanks to the many folks that participated in the discussion. > > Acked-by: Juergen Gross > Debugged-by: Alistair Strachan > Debugged-by: Matthias Kaehlcke > Reported-by: Sedat Dilek > Signed-off-by: Nick Desaulniers > Suggested-by: Arnd Bergmann > Suggested-by: H. Peter Anvin > Suggested-by: Tom Stellar > Tested-by: Sedat Dilek > --- > Backport for 4.4. 4.4 is missing commit 784d5699eddc "x86: move exports to > actual definitions" which doesn't apply cleanly, and not really worth > backporting IMO. It's simpler to change this patch from upstream: > + #include > rather than > + #include Now applied, thanks. greg k-h
Re: [4.4 STABLE BACKPORT] x86: paravirt: make native_save_fl extern inline
On Fri, Jul 20, 2018 at 03:36:41PM -0700, Nick Desaulniers wrote: > 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 > code, the emittance of which can break paravirt's callee saved assumption > by clobbering %rcx. > > Marking a function definition extern inline means that if this version > cannot be inlined, then the out-of-line version will be preferred. By > having the out-of-line version be implemented in assembly, it cannot be > instrumented with a stack protector, which might violate custom calling > conventions that code like paravirt rely on. > > 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) regardless of this patch. This has been cleaned up > earlier in the patch set, but is left as a note in the commit message > for future travelers. > > Reports: > https://lkml.org/lkml/2018/5/7/534 > https://github.com/ClangBuiltLinux/linux/issues/16 > > Discussion: > https://bugs.llvm.org/show_bug.cgi?id=37512 > https://lkml.org/lkml/2018/5/24/1371 > > Thanks to the many folks that participated in the discussion. > > Acked-by: Juergen Gross > Debugged-by: Alistair Strachan > Debugged-by: Matthias Kaehlcke > Reported-by: Sedat Dilek > Signed-off-by: Nick Desaulniers > Suggested-by: Arnd Bergmann > Suggested-by: H. Peter Anvin > Suggested-by: Tom Stellar > Tested-by: Sedat Dilek > --- > Backport for 4.4. 4.4 is missing commit 784d5699eddc "x86: move exports to > actual definitions" which doesn't apply cleanly, and not really worth > backporting IMO. It's simpler to change this patch from upstream: > + #include > rather than > + #include Now applied, thanks. greg k-h
Re: [4.4 STABLE BACKPORT] x86: paravirt: make native_save_fl extern inline
On Fri, Jul 20, 2018 at 03:36:41PM -0700, Nick Desaulniers wrote: > 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 > code, the emittance of which can break paravirt's callee saved assumption > by clobbering %rcx. > > Marking a function definition extern inline means that if this version > cannot be inlined, then the out-of-line version will be preferred. By > having the out-of-line version be implemented in assembly, it cannot be > instrumented with a stack protector, which might violate custom calling > conventions that code like paravirt rely on. > > 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) regardless of this patch. This has been cleaned up > earlier in the patch set, but is left as a note in the commit message > for future travelers. > > Reports: > https://lkml.org/lkml/2018/5/7/534 > https://github.com/ClangBuiltLinux/linux/issues/16 > > Discussion: > https://bugs.llvm.org/show_bug.cgi?id=37512 > https://lkml.org/lkml/2018/5/24/1371 > > Thanks to the many folks that participated in the discussion. > > Acked-by: Juergen Gross > Debugged-by: Alistair Strachan > Debugged-by: Matthias Kaehlcke > Reported-by: Sedat Dilek > Signed-off-by: Nick Desaulniers > Suggested-by: Arnd Bergmann > Suggested-by: H. Peter Anvin > Suggested-by: Tom Stellar > Tested-by: Sedat Dilek > --- > Backport for 4.4. 4.4 is missing commit 784d5699eddc "x86: move exports to > actual definitions" which doesn't apply cleanly, and not really worth > backporting IMO. It's simpler to change this patch from upstream: > + #include > rather than > + #include Yeah, that makes sense, thanks for the backport. I'll queue it up after the next round of stable kernels comes out in a few days. greg k-h
Re: [4.4 STABLE BACKPORT] x86: paravirt: make native_save_fl extern inline
On Fri, Jul 20, 2018 at 03:36:41PM -0700, Nick Desaulniers wrote: > 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 > code, the emittance of which can break paravirt's callee saved assumption > by clobbering %rcx. > > Marking a function definition extern inline means that if this version > cannot be inlined, then the out-of-line version will be preferred. By > having the out-of-line version be implemented in assembly, it cannot be > instrumented with a stack protector, which might violate custom calling > conventions that code like paravirt rely on. > > 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) regardless of this patch. This has been cleaned up > earlier in the patch set, but is left as a note in the commit message > for future travelers. > > Reports: > https://lkml.org/lkml/2018/5/7/534 > https://github.com/ClangBuiltLinux/linux/issues/16 > > Discussion: > https://bugs.llvm.org/show_bug.cgi?id=37512 > https://lkml.org/lkml/2018/5/24/1371 > > Thanks to the many folks that participated in the discussion. > > Acked-by: Juergen Gross > Debugged-by: Alistair Strachan > Debugged-by: Matthias Kaehlcke > Reported-by: Sedat Dilek > Signed-off-by: Nick Desaulniers > Suggested-by: Arnd Bergmann > Suggested-by: H. Peter Anvin > Suggested-by: Tom Stellar > Tested-by: Sedat Dilek > --- > Backport for 4.4. 4.4 is missing commit 784d5699eddc "x86: move exports to > actual definitions" which doesn't apply cleanly, and not really worth > backporting IMO. It's simpler to change this patch from upstream: > + #include > rather than > + #include Yeah, that makes sense, thanks for the backport. I'll queue it up after the next round of stable kernels comes out in a few days. greg k-h
Re: [4.4 STABLE BACKPORT] x86: paravirt: make native_save_fl extern inline
On Fri, Jul 20, 2018 at 05:06:07PM -0700, Nick Desaulniers wrote: > On Fri, Jul 20, 2018 at 5:04 PM kbuild test robot wrote: > > > > Hi Nick, > > > > Thank you for the patch! Yet something to improve: > > > > [auto build test ERROR on tip/x86/core] > > [cannot apply to v4.18-rc5 next-20180720] > > [if your patch is applied to the wrong git tree, please drop us a note to > > help improve the system] > > > > url: > > https://github.com/0day-ci/linux/commits/Nick-Desaulniers/x86-paravirt-make-native_save_fl-extern-inline/20180721-073112 > > config: i386-tinyconfig (attached as .config) > > compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 > > reproduce: > > # save the attached .config to linux build tree > > make ARCH=i386 > > > > All errors (new ones prefixed by >>): > > > >arch/x86/kernel/irqflags.S: Assembler messages: > > >> arch/x86/kernel/irqflags.S:22: Error: bad register name `%_ASM_ARG1' > > > > vim +22 arch/x86/kernel/irqflags.S > > > > 16 > > 17 /* > > 18 * void native_restore_fl(unsigned long flags) > > 19 * %eax/%rdi: flags > > 20 */ > > 21 ENTRY(native_restore_fl) > > > 22 push %_ASM_ARG1 > > > > --- > > 0-DAY kernel test infrastructureOpen Source Technology > > Center > > https://lists.01.org/pipermail/kbuild-all Intel > > Corporation > > oops, probably should not have cc'ed vger.kernel.org for a patch meant > for stable. sta...@vger.kernel.org is the right address, you did it correct. I think 0-day just got a bit trigger-happy on this one for some reason, don't worry about it. thanks, greg k-h
Re: [4.4 STABLE BACKPORT] x86: paravirt: make native_save_fl extern inline
On Fri, Jul 20, 2018 at 05:06:07PM -0700, Nick Desaulniers wrote: > On Fri, Jul 20, 2018 at 5:04 PM kbuild test robot wrote: > > > > Hi Nick, > > > > Thank you for the patch! Yet something to improve: > > > > [auto build test ERROR on tip/x86/core] > > [cannot apply to v4.18-rc5 next-20180720] > > [if your patch is applied to the wrong git tree, please drop us a note to > > help improve the system] > > > > url: > > https://github.com/0day-ci/linux/commits/Nick-Desaulniers/x86-paravirt-make-native_save_fl-extern-inline/20180721-073112 > > config: i386-tinyconfig (attached as .config) > > compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 > > reproduce: > > # save the attached .config to linux build tree > > make ARCH=i386 > > > > All errors (new ones prefixed by >>): > > > >arch/x86/kernel/irqflags.S: Assembler messages: > > >> arch/x86/kernel/irqflags.S:22: Error: bad register name `%_ASM_ARG1' > > > > vim +22 arch/x86/kernel/irqflags.S > > > > 16 > > 17 /* > > 18 * void native_restore_fl(unsigned long flags) > > 19 * %eax/%rdi: flags > > 20 */ > > 21 ENTRY(native_restore_fl) > > > 22 push %_ASM_ARG1 > > > > --- > > 0-DAY kernel test infrastructureOpen Source Technology > > Center > > https://lists.01.org/pipermail/kbuild-all Intel > > Corporation > > oops, probably should not have cc'ed vger.kernel.org for a patch meant > for stable. sta...@vger.kernel.org is the right address, you did it correct. I think 0-day just got a bit trigger-happy on this one for some reason, don't worry about it. thanks, greg k-h
Re: [4.4 STABLE BACKPORT] x86: paravirt: make native_save_fl extern inline
On Fri, Jul 20, 2018 at 5:04 PM kbuild test robot wrote: > > Hi Nick, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on tip/x86/core] > [cannot apply to v4.18-rc5 next-20180720] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Nick-Desaulniers/x86-paravirt-make-native_save_fl-extern-inline/20180721-073112 > config: i386-tinyconfig (attached as .config) > compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 > reproduce: > # save the attached .config to linux build tree > make ARCH=i386 > > All errors (new ones prefixed by >>): > >arch/x86/kernel/irqflags.S: Assembler messages: > >> arch/x86/kernel/irqflags.S:22: Error: bad register name `%_ASM_ARG1' > > vim +22 arch/x86/kernel/irqflags.S > > 16 > 17 /* > 18 * void native_restore_fl(unsigned long flags) > 19 * %eax/%rdi: flags > 20 */ > 21 ENTRY(native_restore_fl) > > 22 push %_ASM_ARG1 > > --- > 0-DAY kernel test infrastructureOpen Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation oops, probably should not have cc'ed vger.kernel.org for a patch meant for stable. -- Thanks, ~Nick Desaulniers
Re: [4.4 STABLE BACKPORT] x86: paravirt: make native_save_fl extern inline
On Fri, Jul 20, 2018 at 5:04 PM kbuild test robot wrote: > > Hi Nick, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on tip/x86/core] > [cannot apply to v4.18-rc5 next-20180720] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Nick-Desaulniers/x86-paravirt-make-native_save_fl-extern-inline/20180721-073112 > config: i386-tinyconfig (attached as .config) > compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 > reproduce: > # save the attached .config to linux build tree > make ARCH=i386 > > All errors (new ones prefixed by >>): > >arch/x86/kernel/irqflags.S: Assembler messages: > >> arch/x86/kernel/irqflags.S:22: Error: bad register name `%_ASM_ARG1' > > vim +22 arch/x86/kernel/irqflags.S > > 16 > 17 /* > 18 * void native_restore_fl(unsigned long flags) > 19 * %eax/%rdi: flags > 20 */ > 21 ENTRY(native_restore_fl) > > 22 push %_ASM_ARG1 > > --- > 0-DAY kernel test infrastructureOpen Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation oops, probably should not have cc'ed vger.kernel.org for a patch meant for stable. -- Thanks, ~Nick Desaulniers
Re: [4.4 STABLE BACKPORT] x86: paravirt: make native_save_fl extern inline
Hi Nick, Thank you for the patch! Yet something to improve: [auto build test ERROR on tip/x86/core] [cannot apply to v4.18-rc5 next-20180720] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Nick-Desaulniers/x86-paravirt-make-native_save_fl-extern-inline/20180721-073112 config: i386-tinyconfig (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=i386 All errors (new ones prefixed by >>): arch/x86/kernel/irqflags.S: Assembler messages: >> arch/x86/kernel/irqflags.S:22: Error: bad register name `%_ASM_ARG1' vim +22 arch/x86/kernel/irqflags.S 16 17 /* 18 * void native_restore_fl(unsigned long flags) 19 * %eax/%rdi: flags 20 */ 21 ENTRY(native_restore_fl) > 22 push %_ASM_ARG1 --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [4.4 STABLE BACKPORT] x86: paravirt: make native_save_fl extern inline
Hi Nick, Thank you for the patch! Yet something to improve: [auto build test ERROR on tip/x86/core] [cannot apply to v4.18-rc5 next-20180720] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Nick-Desaulniers/x86-paravirt-make-native_save_fl-extern-inline/20180721-073112 config: i386-tinyconfig (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=i386 All errors (new ones prefixed by >>): arch/x86/kernel/irqflags.S: Assembler messages: >> arch/x86/kernel/irqflags.S:22: Error: bad register name `%_ASM_ARG1' vim +22 arch/x86/kernel/irqflags.S 16 17 /* 18 * void native_restore_fl(unsigned long flags) 19 * %eax/%rdi: flags 20 */ 21 ENTRY(native_restore_fl) > 22 push %_ASM_ARG1 --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip