All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] linux: Fix powerpc64le defconfig selection
@ 2022-05-10  2:20 Joel Stanley
  2022-05-13 21:52 ` Arnout Vandecappelle
  2022-05-28 19:25 ` Peter Korsgaard
  0 siblings, 2 replies; 10+ messages in thread
From: Joel Stanley @ 2022-05-10  2:20 UTC (permalink / raw)
  To: buildroot; +Cc: mpe

The default defconfig target for the 64 bit powerpc kernel is
ppc64_defconfig, the big endian configuration.

When building for powerpc64le users want the little endian kernel as
they can't boot LE userspace on a BE kernel.

Fix up the defconfig used in this case. This will avoid the following
autobuilder failure:

 VDSO32A arch/powerpc/kernel/vdso32/sigtramp.o
 cc1: error: ‘-m32’ not supported in this configuratioin
 make[4]: *** [arch/powerpc/kernel/vdso32/Makefile:49: arch/powerpc/kernel/vdso32/sigtramp.o] Error 1

 http://autobuild.buildroot.net/results/dd76d53bab56470c0b83e296872d7bb90f9e8296/

Note that the failure indicates the toolchain is configured to disable
the 32 bit target, causing the kernel to fail when building the 32 bit
VDSO. This is only a problem on the BE kernel as the LE kernel disables
CONFIG_COMPAT, aka 32 bit userspace support, by default.

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
Alternatively, we could disalow BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG
when BR2_powerpc64le=y.

 linux/linux.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/linux/linux.mk b/linux/linux.mk
index b27e436b0d57..67832127d92e 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -307,7 +307,11 @@ endif
 ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
 LINUX_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig
 else ifeq ($(BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG),y)
+ifeq ($(BR2_powerpc64le),y)
+LINUX_KCONFIG_DEFCONFIG = ppc64le_defconfig
+else
 LINUX_KCONFIG_DEFCONFIG = defconfig
+endif
 else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
 LINUX_KCONFIG_FILE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE))
 endif
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH] linux: Fix powerpc64le defconfig selection
  2022-05-10  2:20 [Buildroot] [PATCH] linux: Fix powerpc64le defconfig selection Joel Stanley
@ 2022-05-13 21:52 ` Arnout Vandecappelle
  2022-05-16 13:17   ` Michael Ellerman
  2022-05-17  6:13   ` Joel Stanley
  2022-05-28 19:25 ` Peter Korsgaard
  1 sibling, 2 replies; 10+ messages in thread
From: Arnout Vandecappelle @ 2022-05-13 21:52 UTC (permalink / raw)
  To: Joel Stanley, buildroot; +Cc: mpe



On 10/05/2022 04:20, Joel Stanley wrote:
> The default defconfig target for the 64 bit powerpc kernel is
> ppc64_defconfig, the big endian configuration.
> 
> When building for powerpc64le users want the little endian kernel as
> they can't boot LE userspace on a BE kernel.
> 
> Fix up the defconfig used in this case. This will avoid the following
> autobuilder failure:
> 
>   VDSO32A arch/powerpc/kernel/vdso32/sigtramp.o
>   cc1: error: ‘-m32’ not supported in this configuratioin
>   make[4]: *** [arch/powerpc/kernel/vdso32/Makefile:49: arch/powerpc/kernel/vdso32/sigtramp.o] Error 1
> 
>   http://autobuild.buildroot.net/results/dd76d53bab56470c0b83e296872d7bb90f9e8296/
> 
> Note that the failure indicates the toolchain is configured to disable
> the 32 bit target, causing the kernel to fail when building the 32 bit
> VDSO. This is only a problem on the BE kernel as the LE kernel disables
> CONFIG_COMPAT, aka 32 bit userspace support, by default.
> 
> Signed-off-by: Joel Stanley <joel@jms.id.au>

  Applied to master, thanks. However, the defconfig mechanism for *all* powerpc 
seems pretty broken. Here's what we have in 5.16, before that there was 
something similar:

# If we're on a ppc/ppc64/ppc64le machine use that defconfig, otherwise just use
# ppc64_defconfig because we have nothing better to go on.
uname := $(shell uname -m)
KBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64)_defconfig

  So I guess we should use a specific defconfig for *all* powerpc.

  The arch-default defconfig is generally not really reliable, for example for 
arm it always takes v7_multi, but that won't work for v7m targets...

  Regards,
  Arnout

> ---
> Alternatively, we could disalow BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG
> when BR2_powerpc64le=y.
> 
>   linux/linux.mk | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/linux/linux.mk b/linux/linux.mk
> index b27e436b0d57..67832127d92e 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -307,7 +307,11 @@ endif
>   ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
>   LINUX_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig
>   else ifeq ($(BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG),y)
> +ifeq ($(BR2_powerpc64le),y)
> +LINUX_KCONFIG_DEFCONFIG = ppc64le_defconfig
> +else
>   LINUX_KCONFIG_DEFCONFIG = defconfig
> +endif
>   else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
>   LINUX_KCONFIG_FILE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE))
>   endif
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH] linux: Fix powerpc64le defconfig selection
  2022-05-13 21:52 ` Arnout Vandecappelle
@ 2022-05-16 13:17   ` Michael Ellerman
  2022-05-18 12:03     ` Arnd Bergmann
  2022-05-18 17:23       ` Arnout Vandecappelle
  2022-05-17  6:13   ` Joel Stanley
  1 sibling, 2 replies; 10+ messages in thread
From: Michael Ellerman @ 2022-05-16 13:17 UTC (permalink / raw)
  To: Arnout Vandecappelle, Joel Stanley; +Cc: linuxppc-dev, buildroot

Arnout Vandecappelle <arnout@mind.be> writes:
> On 10/05/2022 04:20, Joel Stanley wrote:
>> The default defconfig target for the 64 bit powerpc kernel is
>> ppc64_defconfig, the big endian configuration.
>> 
>> When building for powerpc64le users want the little endian kernel as
>> they can't boot LE userspace on a BE kernel.
>> 
>> Fix up the defconfig used in this case. This will avoid the following
>> autobuilder failure:
>> 
>>   VDSO32A arch/powerpc/kernel/vdso32/sigtramp.o
>>   cc1: error: ‘-m32’ not supported in this configuratioin
>>   make[4]: *** [arch/powerpc/kernel/vdso32/Makefile:49: arch/powerpc/kernel/vdso32/sigtramp.o] Error 1
>> 
>>   http://autobuild.buildroot.net/results/dd76d53bab56470c0b83e296872d7bb90f9e8296/
>> 
>> Note that the failure indicates the toolchain is configured to disable
>> the 32 bit target, causing the kernel to fail when building the 32 bit
>> VDSO. This is only a problem on the BE kernel as the LE kernel disables
>> CONFIG_COMPAT, aka 32 bit userspace support, by default.
>> 
>> Signed-off-by: Joel Stanley <joel@jms.id.au>
>
>   Applied to master, thanks. However, the defconfig mechanism for *all* powerpc 
> seems pretty broken. Here's what we have in 5.16, before that there was 
> something similar:
>
> # If we're on a ppc/ppc64/ppc64le machine use that defconfig, otherwise just use
> # ppc64_defconfig because we have nothing better to go on.
> uname := $(shell uname -m)
> KBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64)_defconfig
>
>   So I guess we should use a specific defconfig for *all* powerpc.
>
>   The arch-default defconfig is generally not really reliable, for example for 
> arm it always takes v7_multi, but that won't work for v7m targets...

There's a fundamental problem that just the "arch" is not sufficient
detail when you're building a kernel.

Two CPUs that implement the same user-visible "arch" may differ enough
at the kernel level to require a different defconfig.

Having said that I think we could handle this better in the powerpc
kernel. Other arches allow specifying a different value for ARCH, which
then is fed into the defconfig.

That way you could at least pass ARCH=ppc/ppc64/ppc64le, and get an
appropriate defconfig.

I'll work on some kernel changes for that.

cheers

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH] linux: Fix powerpc64le defconfig selection
  2022-05-13 21:52 ` Arnout Vandecappelle
  2022-05-16 13:17   ` Michael Ellerman
@ 2022-05-17  6:13   ` Joel Stanley
  2022-05-18 17:32     ` Arnout Vandecappelle
  1 sibling, 1 reply; 10+ messages in thread
From: Joel Stanley @ 2022-05-17  6:13 UTC (permalink / raw)
  To: Arnout Vandecappelle; +Cc: Michael Ellerman, buildroot

On Fri, 13 May 2022 at 21:52, Arnout Vandecappelle <arnout@mind.be> wrote:
>
>
>
> On 10/05/2022 04:20, Joel Stanley wrote:
> > The default defconfig target for the 64 bit powerpc kernel is
> > ppc64_defconfig, the big endian configuration.
> >
> > When building for powerpc64le users want the little endian kernel as
> > they can't boot LE userspace on a BE kernel.
> >
> > Fix up the defconfig used in this case. This will avoid the following
> > autobuilder failure:
> >
> >   VDSO32A arch/powerpc/kernel/vdso32/sigtramp.o
> >   cc1: error: ‘-m32’ not supported in this configuratioin
> >   make[4]: *** [arch/powerpc/kernel/vdso32/Makefile:49: arch/powerpc/kernel/vdso32/sigtramp.o] Error 1
> >
> >   http://autobuild.buildroot.net/results/dd76d53bab56470c0b83e296872d7bb90f9e8296/
> >
> > Note that the failure indicates the toolchain is configured to disable
> > the 32 bit target, causing the kernel to fail when building the 32 bit
> > VDSO. This is only a problem on the BE kernel as the LE kernel disables
> > CONFIG_COMPAT, aka 32 bit userspace support, by default.
> >
> > Signed-off-by: Joel Stanley <joel@jms.id.au>
>
>   Applied to master, thanks. However, the defconfig mechanism for *all* powerpc
> seems pretty broken. Here's what we have in 5.16, before that there was
> something similar:
>
> # If we're on a ppc/ppc64/ppc64le machine use that defconfig, otherwise just use
> # ppc64_defconfig because we have nothing better to go on.
> uname := $(shell uname -m)
> KBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64)_defconfig

Yes, mpe and I discussed this. x86 does a similar thing:

ifeq ($(ARCH),x86)
  ifeq ($(shell uname -m),x86_64)
        KBUILD_DEFCONFIG := x86_64_defconfig
  else
        KBUILD_DEFCONFIG := i386_defconfig
  endif
else
        KBUILD_DEFCONFIG := $(ARCH)_defconfig
endif

If you were building on an eg. Arm or PowerPC host with ARCH=x86, you
would get unexpected results.

>
>   So I guess we should use a specific defconfig for *all* powerpc.
>
>   The arch-default defconfig is generally not really reliable, for example for
> arm it always takes v7_multi, but that won't work for v7m targets...

I noticed that. It is similarly broken if you expected a kernel that
worked on armv5.

Should we disable BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG for
platforms that don't have a single defconfig?

The other option I considered was removing ARCH_DEFAULT_CONFIG and
providing a default for platforms where we could suggest one. It would
look something like this:

--- a/linux/Config.in
+++ b/linux/Config.in
@@ -176,10 +176,15 @@ endchoice
 config BR2_LINUX_KERNEL_DEFCONFIG
        string "Defconfig name"
        depends on BR2_LINUX_KERNEL_USE_DEFCONFIG
+       default "ppc64le_defconfig" if BR2_powerpc_powerpc64le
+       default "ppc64_defconfig" if BR2_powerpc_powerpc64
+       default "ppc_defconfig" if BR2_powerpc_powerpc
+       default "mutli_v5_defconfig" if BR2_ARM_CPU_ARMV5
+       default "mutli_v7_defconfig" if BR2_ARM_CPU_ARMV7A
+       default "defconfig"
        help
-         Name of the kernel defconfig file to use, without the
-         trailing _defconfig.  The defconfig is located in
-         arch/<arch>/configs in the kernel tree.
+         Name of the kernel defconfig file to use. The defconfig is located in
+         arch/<arch>/configs in the kernel tree

It would need to change the option to include the _defconfig (in order
to support plain old "defconfig"), or we could add some logic in the
.mk to add _defconfig only if the name is not "defconfig".
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH] linux: Fix powerpc64le defconfig selection
  2022-05-16 13:17   ` Michael Ellerman
@ 2022-05-18 12:03     ` Arnd Bergmann
  2022-05-18 17:23       ` Arnout Vandecappelle
  1 sibling, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2022-05-18 12:03 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, Arnout Vandecappelle, Joel Stanley, buildroot

On Mon, May 16, 2022 at 2:17 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
> Having said that I think we could handle this better in the powerpc
> kernel. Other arches allow specifying a different value for ARCH, which
> then is fed into the defconfig.
>
> That way you could at least pass ARCH=ppc/ppc64/ppc64le, and get an
> appropriate defconfig.
>
> I'll work on some kernel changes for that.

I would recommend against that. It's always a bit hacky, and I think this was
mainly done on x86 to avoid breaking user workflows after arch/i386
and arch/x86_64
got merged.

Since there was never an arch/ppc64le, and arch/{ppc,ppc64}/ are gone for so
long, I see no point in bringing back those interfaces, just use the right
defconfig for what you want.

        Arnd

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH] linux: Fix powerpc64le defconfig selection
  2022-05-16 13:17   ` Michael Ellerman
@ 2022-05-18 17:23       ` Arnout Vandecappelle
  2022-05-18 17:23       ` Arnout Vandecappelle
  1 sibling, 0 replies; 10+ messages in thread
From: Arnout Vandecappelle @ 2022-05-18 17:23 UTC (permalink / raw)
  To: Michael Ellerman, Joel Stanley; +Cc: linuxppc-dev, buildroot



On 16/05/2022 15:17, Michael Ellerman wrote:
> Arnout Vandecappelle <arnout@mind.be> writes:
>> On 10/05/2022 04:20, Joel Stanley wrote:
>>> The default defconfig target for the 64 bit powerpc kernel is
>>> ppc64_defconfig, the big endian configuration.
>>>
>>> When building for powerpc64le users want the little endian kernel as
>>> they can't boot LE userspace on a BE kernel.
>>>
>>> Fix up the defconfig used in this case. This will avoid the following
>>> autobuilder failure:
>>>
>>>    VDSO32A arch/powerpc/kernel/vdso32/sigtramp.o
>>>    cc1: error: ‘-m32’ not supported in this configuratioin
>>>    make[4]: *** [arch/powerpc/kernel/vdso32/Makefile:49: arch/powerpc/kernel/vdso32/sigtramp.o] Error 1
>>>
>>>    http://autobuild.buildroot.net/results/dd76d53bab56470c0b83e296872d7bb90f9e8296/
>>>
>>> Note that the failure indicates the toolchain is configured to disable
>>> the 32 bit target, causing the kernel to fail when building the 32 bit
>>> VDSO. This is only a problem on the BE kernel as the LE kernel disables
>>> CONFIG_COMPAT, aka 32 bit userspace support, by default.
>>>
>>> Signed-off-by: Joel Stanley <joel@jms.id.au>
>>
>>    Applied to master, thanks. However, the defconfig mechanism for *all* powerpc
>> seems pretty broken. Here's what we have in 5.16, before that there was
>> something similar:
>>
>> # If we're on a ppc/ppc64/ppc64le machine use that defconfig, otherwise just use
>> # ppc64_defconfig because we have nothing better to go on.
>> uname := $(shell uname -m)
>> KBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64)_defconfig
>>
>>    So I guess we should use a specific defconfig for *all* powerpc.
>>
>>    The arch-default defconfig is generally not really reliable, for example for
>> arm it always takes v7_multi, but that won't work for v7m targets...
> 
> There's a fundamental problem that just the "arch" is not sufficient
> detail when you're building a kernel.

  Yes, which is pretty much unavoidable.

> Two CPUs that implement the same user-visible "arch" may differ enough
> at the kernel level to require a different defconfig.
> 
> Having said that I think we could handle this better in the powerpc
> kernel. Other arches allow specifying a different value for ARCH, which
> then is fed into the defconfig.

  I don't know if it's worth bothering with that. It certainly would not make 
our life easier, because it would mean we need to set ARCH correctly. If we can 
do that, we can just as well set the defconfig correctly.

> That way you could at least pass ARCH=ppc/ppc64/ppc64le, and get an
> appropriate defconfig.
> 
> I'll work on some kernel changes for that.

  I think the most important thing is that it makes no sense to rely on uname 
when ARCH and/or CROSS_COMPILE are set.

  Regards,
  Arnout

> 
> cheers
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH] linux: Fix powerpc64le defconfig selection
@ 2022-05-18 17:23       ` Arnout Vandecappelle
  0 siblings, 0 replies; 10+ messages in thread
From: Arnout Vandecappelle @ 2022-05-18 17:23 UTC (permalink / raw)
  To: Michael Ellerman, Joel Stanley; +Cc: linuxppc-dev, buildroot



On 16/05/2022 15:17, Michael Ellerman wrote:
> Arnout Vandecappelle <arnout@mind.be> writes:
>> On 10/05/2022 04:20, Joel Stanley wrote:
>>> The default defconfig target for the 64 bit powerpc kernel is
>>> ppc64_defconfig, the big endian configuration.
>>>
>>> When building for powerpc64le users want the little endian kernel as
>>> they can't boot LE userspace on a BE kernel.
>>>
>>> Fix up the defconfig used in this case. This will avoid the following
>>> autobuilder failure:
>>>
>>>    VDSO32A arch/powerpc/kernel/vdso32/sigtramp.o
>>>    cc1: error: ‘-m32’ not supported in this configuratioin
>>>    make[4]: *** [arch/powerpc/kernel/vdso32/Makefile:49: arch/powerpc/kernel/vdso32/sigtramp.o] Error 1
>>>
>>>    http://autobuild.buildroot.net/results/dd76d53bab56470c0b83e296872d7bb90f9e8296/
>>>
>>> Note that the failure indicates the toolchain is configured to disable
>>> the 32 bit target, causing the kernel to fail when building the 32 bit
>>> VDSO. This is only a problem on the BE kernel as the LE kernel disables
>>> CONFIG_COMPAT, aka 32 bit userspace support, by default.
>>>
>>> Signed-off-by: Joel Stanley <joel@jms.id.au>
>>
>>    Applied to master, thanks. However, the defconfig mechanism for *all* powerpc
>> seems pretty broken. Here's what we have in 5.16, before that there was
>> something similar:
>>
>> # If we're on a ppc/ppc64/ppc64le machine use that defconfig, otherwise just use
>> # ppc64_defconfig because we have nothing better to go on.
>> uname := $(shell uname -m)
>> KBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64)_defconfig
>>
>>    So I guess we should use a specific defconfig for *all* powerpc.
>>
>>    The arch-default defconfig is generally not really reliable, for example for
>> arm it always takes v7_multi, but that won't work for v7m targets...
> 
> There's a fundamental problem that just the "arch" is not sufficient
> detail when you're building a kernel.

  Yes, which is pretty much unavoidable.

> Two CPUs that implement the same user-visible "arch" may differ enough
> at the kernel level to require a different defconfig.
> 
> Having said that I think we could handle this better in the powerpc
> kernel. Other arches allow specifying a different value for ARCH, which
> then is fed into the defconfig.

  I don't know if it's worth bothering with that. It certainly would not make 
our life easier, because it would mean we need to set ARCH correctly. If we can 
do that, we can just as well set the defconfig correctly.

> That way you could at least pass ARCH=ppc/ppc64/ppc64le, and get an
> appropriate defconfig.
> 
> I'll work on some kernel changes for that.

  I think the most important thing is that it makes no sense to rely on uname 
when ARCH and/or CROSS_COMPILE are set.

  Regards,
  Arnout

> 
> cheers

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH] linux: Fix powerpc64le defconfig selection
  2022-05-17  6:13   ` Joel Stanley
@ 2022-05-18 17:32     ` Arnout Vandecappelle
  0 siblings, 0 replies; 10+ messages in thread
From: Arnout Vandecappelle @ 2022-05-18 17:32 UTC (permalink / raw)
  To: Joel Stanley; +Cc: Michael Ellerman, buildroot



On 17/05/2022 08:13, Joel Stanley wrote:
> On Fri, 13 May 2022 at 21:52, Arnout Vandecappelle <arnout@mind.be> wrote:
[snip]
>>    So I guess we should use a specific defconfig for *all* powerpc.
>>
>>    The arch-default defconfig is generally not really reliable, for example for
>> arm it always takes v7_multi, but that won't work for v7m targets...
> 
> I noticed that. It is similarly broken if you expected a kernel that
> worked on armv5.
> 
> Should we disable BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG for
> platforms that don't have a single defconfig?
> 
> The other option I considered was removing ARCH_DEFAULT_CONFIG and
> providing a default for platforms where we could suggest one. It would
> look something like this:
> 
> --- a/linux/Config.in
> +++ b/linux/Config.in
> @@ -176,10 +176,15 @@ endchoice
>   config BR2_LINUX_KERNEL_DEFCONFIG
>          string "Defconfig name"
>          depends on BR2_LINUX_KERNEL_USE_DEFCONFIG
> +       default "ppc64le_defconfig" if BR2_powerpc_powerpc64le
> +       default "ppc64_defconfig" if BR2_powerpc_powerpc64
> +       default "ppc_defconfig" if BR2_powerpc_powerpc
> +       default "mutli_v5_defconfig" if BR2_ARM_CPU_ARMV5
> +       default "mutli_v7_defconfig" if BR2_ARM_CPU_ARMV7A
> +       default "defconfig"
>          help
> -         Name of the kernel defconfig file to use, without the
> -         trailing _defconfig.  The defconfig is located in
> -         arch/<arch>/configs in the kernel tree.
> +         Name of the kernel defconfig file to use. The defconfig is located in
> +         arch/<arch>/configs in the kernel tree
> 
> It would need to change the option to include the _defconfig (in order
> to support plain old "defconfig"), or we could add some logic in the
> .mk to add _defconfig only if the name is not "defconfig".

  I like that idea! It allows us to gradually complete the list of defconfigs 
with better defaults. We could also add a condition after the "defconfig" to 
allow it only for the cases which are known to actually work (not much more than 
aarch64 and s390x, I think...).

  Note that changing it so that _defconfig needs to be added is not acceptable, 
because it breaks existing configs too much. We can easily work around that by 
special-casing the "defconfig" string in the .mk file.


  Regards,
  Arnout

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH] linux: Fix powerpc64le defconfig selection
  2022-05-18 17:23       ` Arnout Vandecappelle
  (?)
@ 2022-05-26  6:57       ` Michael Ellerman
  -1 siblings, 0 replies; 10+ messages in thread
From: Michael Ellerman @ 2022-05-26  6:57 UTC (permalink / raw)
  To: Arnout Vandecappelle, Joel Stanley; +Cc: linuxppc-dev, buildroot

Arnout Vandecappelle <arnout@mind.be> writes:
> On 16/05/2022 15:17, Michael Ellerman wrote:
>> Arnout Vandecappelle <arnout@mind.be> writes:
>>> On 10/05/2022 04:20, Joel Stanley wrote:
>>>> The default defconfig target for the 64 bit powerpc kernel is
>>>> ppc64_defconfig, the big endian configuration.
>>>>
>>>> When building for powerpc64le users want the little endian kernel as
>>>> they can't boot LE userspace on a BE kernel.
>>>>
>>>> Fix up the defconfig used in this case. This will avoid the following
>>>> autobuilder failure:
>>>>
>>>>    VDSO32A arch/powerpc/kernel/vdso32/sigtramp.o
>>>>    cc1: error: ‘-m32’ not supported in this configuratioin
>>>>    make[4]: *** [arch/powerpc/kernel/vdso32/Makefile:49: arch/powerpc/kernel/vdso32/sigtramp.o] Error 1
>>>>
>>>>    http://autobuild.buildroot.net/results/dd76d53bab56470c0b83e296872d7bb90f9e8296/
>>>>
>>>> Note that the failure indicates the toolchain is configured to disable
>>>> the 32 bit target, causing the kernel to fail when building the 32 bit
>>>> VDSO. This is only a problem on the BE kernel as the LE kernel disables
>>>> CONFIG_COMPAT, aka 32 bit userspace support, by default.
>>>>
>>>> Signed-off-by: Joel Stanley <joel@jms.id.au>
>>>
>>>    Applied to master, thanks. However, the defconfig mechanism for *all* powerpc
>>> seems pretty broken. Here's what we have in 5.16, before that there was
>>> something similar:
>>>
>>> # If we're on a ppc/ppc64/ppc64le machine use that defconfig, otherwise just use
>>> # ppc64_defconfig because we have nothing better to go on.
>>> uname := $(shell uname -m)
>>> KBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64)_defconfig
>>>
>>>    So I guess we should use a specific defconfig for *all* powerpc.
>>>
>>>    The arch-default defconfig is generally not really reliable, for example for
>>> arm it always takes v7_multi, but that won't work for v7m targets...
>> 
>> There's a fundamental problem that just the "arch" is not sufficient
>> detail when you're building a kernel.
>
>   Yes, which is pretty much unavoidable.
>
>> Two CPUs that implement the same user-visible "arch" may differ enough
>> at the kernel level to require a different defconfig.
>> 
>> Having said that I think we could handle this better in the powerpc
>> kernel. Other arches allow specifying a different value for ARCH, which
>> then is fed into the defconfig.
>
>   I don't know if it's worth bothering with that. It certainly would not make 
> our life easier, because it would mean we need to set ARCH correctly. If we can 
> do that, we can just as well set the defconfig correctly.

OK.

>> That way you could at least pass ARCH=ppc/ppc64/ppc64le, and get an
>> appropriate defconfig.
>> 
>> I'll work on some kernel changes for that.
>
>   I think the most important thing is that it makes no sense to rely on uname 
> when ARCH and/or CROSS_COMPILE are set.

I'm not sure I entirely agree.

Neither ARCH or CROSS_COMPILE give us enough information to know which
defconfig to use, so we still have to guess somehow.

CROSS_COMPILE can be set even when you're building on ppc, it's the
easiest way to specfiy a different toolchain from the default.

cheers

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Buildroot] [PATCH] linux: Fix powerpc64le defconfig selection
  2022-05-10  2:20 [Buildroot] [PATCH] linux: Fix powerpc64le defconfig selection Joel Stanley
  2022-05-13 21:52 ` Arnout Vandecappelle
@ 2022-05-28 19:25 ` Peter Korsgaard
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Korsgaard @ 2022-05-28 19:25 UTC (permalink / raw)
  To: Joel Stanley; +Cc: mpe, buildroot

>>>>> "Joel" == Joel Stanley <joel@jms.id.au> writes:

 > The default defconfig target for the 64 bit powerpc kernel is
 > ppc64_defconfig, the big endian configuration.

 > When building for powerpc64le users want the little endian kernel as
 > they can't boot LE userspace on a BE kernel.

 > Fix up the defconfig used in this case. This will avoid the following
 > autobuilder failure:

 >  VDSO32A arch/powerpc/kernel/vdso32/sigtramp.o
 >  cc1: error: ‘-m32’ not supported in this configuratioin
 >  make[4]: *** [arch/powerpc/kernel/vdso32/Makefile:49:
 > arch/powerpc/kernel/vdso32/sigtramp.o] Error 1

 >  http://autobuild.buildroot.net/results/dd76d53bab56470c0b83e296872d7bb90f9e8296/

 > Note that the failure indicates the toolchain is configured to disable
 > the 32 bit target, causing the kernel to fail when building the 32 bit
 > VDSO. This is only a problem on the BE kernel as the LE kernel disables
 > CONFIG_COMPAT, aka 32 bit userspace support, by default.

 > Signed-off-by: Joel Stanley <joel@jms.id.au>
 > ---
 > Alternatively, we could disalow BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG
 > when BR2_powerpc64le=y.

Committed to 2022.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-05-28 19:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10  2:20 [Buildroot] [PATCH] linux: Fix powerpc64le defconfig selection Joel Stanley
2022-05-13 21:52 ` Arnout Vandecappelle
2022-05-16 13:17   ` Michael Ellerman
2022-05-18 12:03     ` Arnd Bergmann
2022-05-18 17:23     ` Arnout Vandecappelle
2022-05-18 17:23       ` Arnout Vandecappelle
2022-05-26  6:57       ` Michael Ellerman
2022-05-17  6:13   ` Joel Stanley
2022-05-18 17:32     ` Arnout Vandecappelle
2022-05-28 19:25 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.