Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations

2018-06-05 Thread Joe Perches
On Tue, 2018-06-05 at 12:50 -0700, Nick Desaulniers wrote: > On Tue, Jun 5, 2018 at 12:14 PM Joe Perches wrote: > > > > On Tue, 2018-06-05 at 10:23 -0700, Joe Perches wrote: > > > Perhaps these are simpler as > > > > > > #define __inline__inline > > > #define __inline inline > > > >

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

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

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: [PATCH v6 2/5] efi: Add embedded peripheral firmware support

2018-06-05 Thread Luis R. Rodriguez
On Fri, Jun 01, 2018 at 02:53:27PM +0200, Hans de Goede wrote: > Just like with PCI options ROMs, which we save in the setup_efi_pci* > functions from arch/x86/boot/compressed/eboot.c, the EFI code / ROM itself > sometimes may contain data which is useful/necessary for peripheral drivers > to have

Re: [PATCH v6 0/5] efi/firmware/platform-x86: Add EFI embedded fw support

2018-06-05 Thread Luis R. Rodriguez
On Fri, Jun 01, 2018 at 02:53:25PM +0200, Hans de Goede wrote: > Hi All, > > Here is v6 of my patch-set to add support for EFI embedded fw to the kernel. > > This patch-set applies on top of the "[PATCH v7 00/14] firmware_loader > changes for v4.18" series from mcgrof. > > It now also depends

RE: [PATCH V5 3/3] efi: Use efi_rts_wq to invoke EFI Runtime Services

2018-06-05 Thread Prakhya, Sai Praneeth
> >> I noticed that -unsurprisingly- reboot no longer works with these changes. > >> > >> I will fix up the patch, and revert the efi_reset_system() change, > >> both here and below. > > > > Could you please let me know what the bug is here? I am unable to see > > it right away :( I have tested

Re: [PATCH V5 3/3] efi: Use efi_rts_wq to invoke EFI Runtime Services

2018-06-05 Thread Ard Biesheuvel
On 5 June 2018 at 21:29, Prakhya, Sai Praneeth wrote: >> > + case RESET_SYSTEM: >> > + __efi_call_virt(reset_system, *(int *)arg1, >> > + *(efi_status_t *)arg2, >> > + *(unsigned long *)arg3, >> > +

Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations

2018-06-05 Thread Nick Desaulniers
On Tue, Jun 5, 2018 at 12:14 PM Joe Perches wrote: > > On Tue, 2018-06-05 at 10:23 -0700, Joe Perches wrote: > > Perhaps these are simpler as > > > > #define __inline__inline > > #define __inline inline > > Currently, there are these uses of inline variants in the kernel > > $ git grep

RE: [PATCH V5 3/3] efi: Use efi_rts_wq to invoke EFI Runtime Services

2018-06-05 Thread Prakhya, Sai Praneeth
> > + case RESET_SYSTEM: > > + __efi_call_virt(reset_system, *(int *)arg1, > > + *(efi_status_t *)arg2, > > + *(unsigned long *)arg3, > > + (efi_char16_t *)arg4); > > +

Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations

2018-06-05 Thread Joe Perches
On Tue, 2018-06-05 at 10:23 -0700, Joe Perches wrote: > Perhaps these are simpler as > > #define __inline__inline > #define __inline inline Currently, there are these uses of inline variants in the kernel $ git grep -w inline | wc -l 68410 $ git grep -w __inline__ | wc -l 503 $ git

Re: [PATCH V5 3/3] efi: Use efi_rts_wq to invoke EFI Runtime Services

2018-06-05 Thread Ard Biesheuvel
On 29 May 2018 at 04:21, Sai Praneeth Prakhya wrote: > From: Sai Praneeth > > Presently, when a user process requests the kernel to execute any > efi_runtime_service(), kernel switches the page directory (%cr3) from > swapper_pgd to efi_pgd. Other subsystems in the kernel aren't aware of > this

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

Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations

2018-06-05 Thread Nick Desaulniers
On Tue, Jun 5, 2018 at 10:23 AM Joe Perches wrote: > On Tue, 2018-06-05 at 10:05 -0700, Nick Desaulniers wrote: > > #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ > > !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) > > -#define inline inline

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) >>

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) >>

Re: [PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations

2018-06-05 Thread Joe Perches
On Tue, 2018-06-05 at 10:05 -0700, Nick Desaulniers wrote: > Functions marked extern inline do not emit an externally visible > function when the gnu89 C standard is used. Some KBUILD Makefiles > overwrite KBUILD_CFLAGS. This is an issue for GCC 5.1+ users as without > an explicit C standard

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

[PATCH v2 0/2] extern inline native_save_fl for paravirt

2018-06-05 Thread Nick Desaulniers
paravirt depends on a custom calling convention (callee saved), but expects this from a static inline function that it then forces to be outlined. This is problematic because different compilers or flags can then add a stack guard that violates the calling conventions. Uses extern inline with the

[PATCH v2 1/2] compiler-gcc.h: add gnu_inline to all inline declarations

2018-06-05 Thread Nick Desaulniers
Functions marked extern inline do not emit an externally visible function when the gnu89 C standard is used. Some KBUILD Makefiles overwrite KBUILD_CFLAGS. This is an issue for GCC 5.1+ users as without an explicit C standard specified, the default is gnu11. Since c99, the semantics of extern

[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