Re: [PATCH] treewide: Convert macro and uses of __section(foo) to __section("foo")

2020-10-26 Thread Guenter Roeck
On Mon, Oct 26, 2020 at 01:33:48PM -0700, Linus Torvalds wrote:
> On Mon, Oct 26, 2020 at 12:41 PM Guenter Roeck  wrote:
> >
> > make ARCH=um SUBARCH=x86_64 defconfig:
> >
> > Building um:defconfig ... failed
> > --
> > Error log:
> > arch/um/kernel/skas/clone.c:24:16: error: expected declaration specifiers 
> > or '...' before string constant
> > arch/x86/um/stub_segv.c:11:16: error: expected declaration specifiers or 
> > '...' before string constant
> 
> Weird. Is __section() not defined somehow for those files?
> 
> It does look like they have very minimal headers, so undoing that
> patch just for those two files is likely the right thing to do.
> 
> > As with s390, reverting this patch fixes the problem.
> 
> s390 should be fixed already.
> 
> Is the attached minimal patch sufficient for um to get back to working
> order, or is there something else hiding there too?
> 
That works for me.

Tested-by: Guenter Roeck 

Thanks,
Guenter


Re: [PATCH] treewide: Convert macro and uses of __section(foo) to __section("foo")

2020-10-26 Thread Linus Torvalds
On Mon, Oct 26, 2020 at 12:41 PM Guenter Roeck  wrote:
>
> make ARCH=um SUBARCH=x86_64 defconfig:
>
> Building um:defconfig ... failed
> --
> Error log:
> arch/um/kernel/skas/clone.c:24:16: error: expected declaration specifiers or 
> '...' before string constant
> arch/x86/um/stub_segv.c:11:16: error: expected declaration specifiers or 
> '...' before string constant

Weird. Is __section() not defined somehow for those files?

It does look like they have very minimal headers, so undoing that
patch just for those two files is likely the right thing to do.

> As with s390, reverting this patch fixes the problem.

s390 should be fixed already.

Is the attached minimal patch sufficient for um to get back to working
order, or is there something else hiding there too?

   Linus


patch
Description: Binary data


Re: [PATCH] treewide: Convert macro and uses of __section(foo) to __section("foo")

2020-10-26 Thread Nathan Chancellor
On Mon, Oct 26, 2020 at 12:36:52PM -0700, Guenter Roeck wrote:
> On Wed, Oct 21, 2020 at 07:36:07PM -0700, Joe Perches wrote:
> > Use a more generic form for __section that requires quotes to avoid
> > complications with clang and gcc differences.
> > 
> > Remove the quote operator # from compiler_attributes.h __section macro.
> > 
> > Convert all unquoted __section(foo) uses to quoted __section("foo").
> > Also convert __attribute__((section("foo"))) uses to __section("foo")
> > even if the __attribute__ has multiple list entry forms.
> > 
> > Conversion done using a script:
> > 
> > Link: 
> > https://lore.kernel.org/lkml/75393e5ddc272dc7403de74d645e6c6e0f4e70eb.ca...@perches.com/2-convert_section.pl
> > 
> > Signed-off-by: Joe Perches 
> > Reviewed-by: Nick Desaulniers 
> > Reviewed-by: Miguel Ojeda 
> 
> s390 (all builds):
> 
> Error log:
> error: section .boot.preserved.data differs between vmlinux and 
> arch/s390/boot/compressed/vmlinux
> make[2]: *** [arch/s390/boot/section_cmp.boot.preserved.data] Error 1
> make[2]: *** Waiting for unfinished jobs
> error: section .boot.data differs between vmlinux and 
> arch/s390/boot/compressed/vmlinux
> make[2]: *** [arch/s390/boot/section_cmp.boot.data] Error 1
> make[1]: *** [bzImage] Error 2
> make[1]: *** Waiting for unfinished jobs
> make: *** [__sub-make] Error 2
> 
> Reverting this patch fixes the problem.
> 
> Guenter
> 

Seems like this should be fixed by commit 8e90b4b1305a ("s390: correct
__bootdata / __bootdata_preserved macros").

Cheers,
Nathan


Re: [PATCH] treewide: Convert macro and uses of __section(foo) to __section("foo")

2020-10-26 Thread Guenter Roeck
On Wed, Oct 21, 2020 at 07:36:07PM -0700, Joe Perches wrote:
> Use a more generic form for __section that requires quotes to avoid
> complications with clang and gcc differences.
> 
> Remove the quote operator # from compiler_attributes.h __section macro.
> 
> Convert all unquoted __section(foo) uses to quoted __section("foo").
> Also convert __attribute__((section("foo"))) uses to __section("foo")
> even if the __attribute__ has multiple list entry forms.
> 
> Conversion done using a script:
> 
> Link: 
> https://lore.kernel.org/lkml/75393e5ddc272dc7403de74d645e6c6e0f4e70eb.ca...@perches.com/2-convert_section.pl
> 
> Signed-off-by: Joe Perches 
> Reviewed-by: Nick Desaulniers 
> Reviewed-by: Miguel Ojeda 
> ---
> 
make ARCH=um SUBARCH=x86_64 defconfig:

Building um:defconfig ... failed
--
Error log:
arch/um/kernel/skas/clone.c:24:16: error: expected declaration specifiers or 
'...' before string constant
   24 | void __section(".__syscall_stub")
  |^
make[3]: *** [arch/um/kernel/skas/clone.o] Error 1
make[3]: *** Waiting for unfinished jobs
make[2]: *** [arch/um/kernel/skas] Error 2
make[2]: *** Waiting for unfinished jobs
arch/um/os-Linux/signal.c: In function 'sig_handler_common':
arch/um/os-Linux/signal.c:51:1: warning: the frame size of 2960 bytes is larger 
than 1024 bytes [-Wframe-larger-than=]
   51 | }
  | ^
arch/um/os-Linux/signal.c: In function 'timer_real_alarm_handler':
arch/um/os-Linux/signal.c:95:1: warning: the frame size of 2960 bytes is larger 
than 1024 bytes [-Wframe-larger-than=]
   95 | }
  | ^
make[1]: *** [arch/um/kernel] Error 2
make[1]: *** Waiting for unfinished jobs
arch/x86/um/stub_segv.c:11:16: error: expected declaration specifiers or '...' 
before string constant
   11 | void __section(".__syscall_stub")
  |^
make[2]: *** [arch/x86/um/stub_segv.o] Error 1
make[1]: *** [arch/x86/um] Error 2
make: *** [__sub-make] Error 2

As with s390, reverting this patch fixes the problem.

Guenter


Re: [PATCH] treewide: Convert macro and uses of __section(foo) to __section("foo")

2020-10-26 Thread Guenter Roeck
On Wed, Oct 21, 2020 at 07:36:07PM -0700, Joe Perches wrote:
> Use a more generic form for __section that requires quotes to avoid
> complications with clang and gcc differences.
> 
> Remove the quote operator # from compiler_attributes.h __section macro.
> 
> Convert all unquoted __section(foo) uses to quoted __section("foo").
> Also convert __attribute__((section("foo"))) uses to __section("foo")
> even if the __attribute__ has multiple list entry forms.
> 
> Conversion done using a script:
> 
> Link: 
> https://lore.kernel.org/lkml/75393e5ddc272dc7403de74d645e6c6e0f4e70eb.ca...@perches.com/2-convert_section.pl
> 
> Signed-off-by: Joe Perches 
> Reviewed-by: Nick Desaulniers 
> Reviewed-by: Miguel Ojeda 

s390 (all builds):

Error log:
error: section .boot.preserved.data differs between vmlinux and 
arch/s390/boot/compressed/vmlinux
make[2]: *** [arch/s390/boot/section_cmp.boot.preserved.data] Error 1
make[2]: *** Waiting for unfinished jobs
error: section .boot.data differs between vmlinux and 
arch/s390/boot/compressed/vmlinux
make[2]: *** [arch/s390/boot/section_cmp.boot.data] Error 1
make[1]: *** [bzImage] Error 2
make[1]: *** Waiting for unfinished jobs
make: *** [__sub-make] Error 2

Reverting this patch fixes the problem.

Guenter


Re: [PATCH] treewide: Convert macro and uses of __section(foo) to __section("foo")

2020-10-23 Thread Miguel Ojeda
On Fri, Oct 23, 2020 at 10:03 AM Joe Perches  wrote:
>
> Thanks Miguel, but IMO it doesn't need time in next.

You're welcome! It never hurts to keep things for a bit there.

> Applying it just before an rc1 minimizes conflicts.

There shouldn't be many conflicts after -rc1. The amount of changes is
reasonable too, so no need to apply the script directly. In any case,
if you prefer that Linus picks it up himself right away for this -rc1,
it looks good to me (with the caveat that it isn't tested):

Reviewed-by: Miguel Ojeda 

Cheers,
Miguel


Re: [PATCH] treewide: Convert macro and uses of __section(foo) to __section("foo")

2020-10-23 Thread Joe Perches
On Fri, 2020-10-23 at 08:08 +0200, Miguel Ojeda wrote:
> On Thu, Oct 22, 2020 at 4:36 AM Joe Perches  wrote:
> > 
> > Use a more generic form for __section that requires quotes to avoid
> > complications with clang and gcc differences.
> 
> I performed visual inspection (one by one...) and the only thing I saw
> is that sometimes the `__attribute__` has a whitespace afterwards and
> sometimes it doesn't, same for the commas inside, e.g.:
> 
> -  __used __attribute__((section(".modinfo"), unused, aligned(1)))  \
> +  __used __section(".modinfo") __attribute__((unused, aligned(1)))  \
> 
> and:
> 
> -__attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void * 
> \
> +__section("__param") __attribute__ ((unused, aligned(sizeof(void * \
> 
> I think the patch tries to follow the style of the replaced line, but
> for the commas in this last case it didn't. Anyway, it is not
> important.

Here the change follows the kernel style of space after comma.

> I can pick it up in my queue along with the __alias one and keep it
> for a few weeks in -next.

Thanks Miguel, but IMO it doesn't need time in next.

Applying it just before an rc1 minimizes conflicts.




Re: [PATCH] treewide: Convert macro and uses of __section(foo) to __section("foo")

2020-10-23 Thread Miguel Ojeda
On Thu, Oct 22, 2020 at 4:36 AM Joe Perches  wrote:
>
> Use a more generic form for __section that requires quotes to avoid
> complications with clang and gcc differences.

I performed visual inspection (one by one...) and the only thing I saw
is that sometimes the `__attribute__` has a whitespace afterwards and
sometimes it doesn't, same for the commas inside, e.g.:

-  __used __attribute__((section(".modinfo"), unused, aligned(1)))  \
+  __used __section(".modinfo") __attribute__((unused, aligned(1)))  \

and:

-__attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void * \
+__section("__param") __attribute__ ((unused, aligned(sizeof(void * \

I think the patch tries to follow the style of the replaced line, but
for the commas in this last case it didn't. Anyway, it is not
important.

I can pick it up in my queue along with the __alias one and keep it
for a few weeks in -next.

Cheers,
Miguel


Re: [PATCH] treewide: Convert macro and uses of __section(foo) to __section("foo")

2020-10-22 Thread Nick Desaulniers
.On Wed, Oct 21, 2020 at 7:36 PM Joe Perches  wrote:
>
> Use a more generic form for __section that requires quotes to avoid
> complications with clang and gcc differences.
>
> Remove the quote operator # from compiler_attributes.h __section macro.
>
> Convert all unquoted __section(foo) uses to quoted __section("foo").
> Also convert __attribute__((section("foo"))) uses to __section("foo")
> even if the __attribute__ has multiple list entry forms.
>
> Conversion done using a script:
>
> Link: 
> https://lore.kernel.org/lkml/75393e5ddc272dc7403de74d645e6c6e0f4e70eb.ca...@perches.com/2-convert_section.pl
>
> Signed-off-by: Joe Perches 
> ---
>
> This conversion was previously submitted to -next last month
> https://lore.kernel.org/lkml/46f69161e60b802488ba8c8f3f8bbf922aa3b49b.ca...@perches.com/
>
> Nick Desaulniers found a defect in the conversion of 2 boot files
> for powerpc, but no other defect was found for any other arch.

Untested, but:
Reviewed-by: Nick Desaulniers 

Good job handling the trickier cases when the attribute was mixed with
others, and printing it in scripts/mod/modpost.c.

The only cases that *might* be similar to PPC are:
>  arch/s390/boot/startup.c  |  2 +-
>  arch/x86/boot/compressed/pgtable_64.c |  2 +-
>  arch/x86/purgatory/purgatory.c|  4 ++--

So a quick test of x86_64 and s390 would be good.

Thanks for the patch.

>
> The script was corrected to avoid converting these 2 files.
>
> There is no difference between the script output when run on today's -next
> and Linus' tree through commit f804b3159482, so this should be reasonable to
> apply now.


-- 
Thanks,
~Nick Desaulniers


Re: [PATCH] treewide: Convert macro and uses of __section(foo) to __section("foo")

2020-10-22 Thread Joe Perches
On Thu, 2020-10-22 at 13:42 -0700, Nick Desaulniers wrote:
> .On Wed, Oct 21, 2020 at 7:36 PM Joe Perches  wrote:
> > Use a more generic form for __section that requires quotes to avoid
> > complications with clang and gcc differences.
[]
> >  a quick test of x86_64 and s390 would be good.

x86_64 was compiled here.
I believe the robot tested the others.