linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/Kconfig: Fix allnoconfig without explicitly specified ARCH
@ 2015-04-03 11:00 Borislav Petkov
  2015-04-03 13:42 ` Paul Bolle
  0 siblings, 1 reply; 7+ messages in thread
From: Borislav Petkov @ 2015-04-03 11:00 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: X86 ML, LKML

From: Borislav Petkov <bp@suse.de>

Doing

  $ make allnoconfig

I get a 32-bit allnoconfig:

  $ grep -i x86 .config
  # Linux/x86 4.0.0-rc6 Kernel Configuration
  CONFIG_X86_32=y
  CONFIG_X86=y
  CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"

The same if I do:

  $ make ARCH=i386 allnoconfig
  $ grep -i x86 .config | head -20
  CONFIG_X86_32=y
  CONFIG_X86=y
  CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"

Make allnoconfig without ARCH specified on the command line default to
64-bit.

Signed-off-by: Borislav Petkov <bp@suse.de>
---
 arch/x86/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 0a37094e458e..04dfb4e7aeff 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2,6 +2,7 @@
 config 64BIT
 	bool "64-bit kernel" if ARCH = "x86"
 	default ARCH != "i386"
+	option allnoconfig_y
 	---help---
 	  Say yes to build a 64-bit kernel - formerly known as x86_64
 	  Say no to build a 32-bit kernel - formerly known as i386
-- 
2.3.3


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

* Re: [PATCH] x86/Kconfig: Fix allnoconfig without explicitly specified ARCH
  2015-04-03 11:00 [PATCH] x86/Kconfig: Fix allnoconfig without explicitly specified ARCH Borislav Petkov
@ 2015-04-03 13:42 ` Paul Bolle
  2015-04-03 14:59   ` Borislav Petkov
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Bolle @ 2015-04-03 13:42 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Ingo Molnar, X86 ML, LKML

Borislav Petkov schreef op vr 03-04-2015 om 13:00 [+0200]:
> From: Borislav Petkov <bp@suse.de>
> 
> Doing
> 
>   $ make allnoconfig
> 
> I get a 32-bit allnoconfig:
> 
>   $ grep -i x86 .config
>   # Linux/x86 4.0.0-rc6 Kernel Configuration
>   CONFIG_X86_32=y
>   CONFIG_X86=y
>   CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"
> 
> The same if I do:
> 
>   $ make ARCH=i386 allnoconfig
>   $ grep -i x86 .config | head -20
>   CONFIG_X86_32=y
>   CONFIG_X86=y
>   CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"
> 
> Make allnoconfig without ARCH specified on the command line default to
> 64-bit.
> 
> Signed-off-by: Borislav Petkov <bp@suse.de>
> ---
>  arch/x86/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 0a37094e458e..04dfb4e7aeff 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -2,6 +2,7 @@
>  config 64BIT
>  	bool "64-bit kernel" if ARCH = "x86"
>  	default ARCH != "i386"
> +	option allnoconfig_y
>  	---help---
>  	  Say yes to build a 64-bit kernel - formerly known as x86_64
>  	  Say no to build a 32-bit kernel - formerly known as i386

A side effect of this patch is that allnoconfig when building on 32 bits
now also requires to set ARCH=i386, which is surprising. This seems to
help with that:

--- a/Makefile
+++ b/Makefile
@@ -221,7 +221,7 @@ export srctree objtree VPATH
 # then ARCH is assigned, getting whatever value it gets normally, and
 # SUBARCH is subsequently ignored.
 
-SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
+SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/x86_64/x86/ \
                                  -e s/sun4u/sparc64/ \
                                  -e s/arm.*/arm/ -e s/sa110/arm/ \
                                  -e s/s390x/s390/ -e s/parisc64/parisc/ \

And that will also set 64BIT to 'n' when doing an allyesconfig on 32
bits. So it removes another surprising configuration one can currently
generate.

(I think that has no further side effects. But I need to double check.)

Would some solution that pins 64BIT to 'y' for x86_64 and to 'n' for
i386 - even for allnoconfig and allyesconfig - do what you want?


Paul Bolle


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

* Re: [PATCH] x86/Kconfig: Fix allnoconfig without explicitly specified ARCH
  2015-04-03 13:42 ` Paul Bolle
@ 2015-04-03 14:59   ` Borislav Petkov
  2015-04-03 15:33     ` Paul Bolle
  0 siblings, 1 reply; 7+ messages in thread
From: Borislav Petkov @ 2015-04-03 14:59 UTC (permalink / raw)
  To: Paul Bolle; +Cc: Ingo Molnar, X86 ML, LKML

On Fri, Apr 03, 2015 at 03:42:18PM +0200, Paul Bolle wrote:
> A side effect of this patch is that allnoconfig when building on 32 bits
> now also requires to set ARCH=i386, which is surprising. This seems to

How else would you build a 32-bit allnoconfig?

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

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

* Re: [PATCH] x86/Kconfig: Fix allnoconfig without explicitly specified ARCH
  2015-04-03 14:59   ` Borislav Petkov
@ 2015-04-03 15:33     ` Paul Bolle
  2015-04-03 17:23       ` Borislav Petkov
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Bolle @ 2015-04-03 15:33 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Ingo Molnar, X86 ML, LKML

Borislav Petkov schreef op vr 03-04-2015 om 16:59 [+0200]:
> On Fri, Apr 03, 2015 at 03:42:18PM +0200, Paul Bolle wrote:
> > A side effect of this patch is that allnoconfig when building on 32 bits
> > now also requires to set ARCH=i386, which is surprising. This seems to
> 
> How else would you build a 32-bit allnoconfig?

Well, "when building on 32 bits" it currently suffices to do:
    make allnoconfig

and the patch changes that.

Just like it is surprising to get a CONFIG_X86_32=y .config when doing
allnoconfig on x86_64 it is also surprising to get a
CONFIG_X86_64=y .config when doing allyesconfig on i386. So I think a
more general solution to these surprising .configs should be considered.
 
Thanks,


Paul Bolle


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

* Re: [PATCH] x86/Kconfig: Fix allnoconfig without explicitly specified ARCH
  2015-04-03 15:33     ` Paul Bolle
@ 2015-04-03 17:23       ` Borislav Petkov
  2015-04-03 21:43         ` Paul Bolle
  0 siblings, 1 reply; 7+ messages in thread
From: Borislav Petkov @ 2015-04-03 17:23 UTC (permalink / raw)
  To: Paul Bolle; +Cc: Ingo Molnar, X86 ML, LKML

On Fri, Apr 03, 2015 at 05:33:03PM +0200, Paul Bolle wrote:
> Well, "when building on 32 bits" it currently suffices to do:
>     make allnoconfig
> 
> and the patch changes that.

Hmm, so this would need more staring. The fact that 64-bit needs to set
CONFIG_64BIT, we would need a way to say:

	option allnoconfig_y if ARCH = "x86"

And Kconfig doesn't support that yet...

:-\

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

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

* Re: [PATCH] x86/Kconfig: Fix allnoconfig without explicitly specified ARCH
  2015-04-03 17:23       ` Borislav Petkov
@ 2015-04-03 21:43         ` Paul Bolle
  2015-04-04  9:35           ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Bolle @ 2015-04-03 21:43 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Ingo Molnar, X86 ML, LKML

On Fri, 2015-04-03 at 19:23 +0200, Borislav Petkov wrote:
> On Fri, Apr 03, 2015 at 05:33:03PM +0200, Paul Bolle wrote:
> > Well, "when building on 32 bits" it currently suffices to do:
> >     make allnoconfig
> > 
> > and the patch changes that.
> 
> Hmm, so this would need more staring. The fact that 64-bit needs to set
> CONFIG_64BIT, we would need a way to say:
> 
> 	option allnoconfig_y if ARCH = "x86"
> 
> And Kconfig doesn't support that yet...

The fact that "make allnoconfig" and "make allyesconfig" can give you
a .config for another subarchitecture is annoying. I think it would be
nice if we teach those make targets (through tweaks in Kconfig files
and/or Makefiles) to avoid doing that.

Not sure, yet, how a clean way to do that might look like, sorry.


Paul Bolle


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

* Re: [PATCH] x86/Kconfig: Fix allnoconfig without explicitly specified ARCH
  2015-04-03 21:43         ` Paul Bolle
@ 2015-04-04  9:35           ` Ingo Molnar
  0 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2015-04-04  9:35 UTC (permalink / raw)
  To: Paul Bolle; +Cc: Borislav Petkov, X86 ML, LKML


* Paul Bolle <pebolle@tiscali.nl> wrote:

> On Fri, 2015-04-03 at 19:23 +0200, Borislav Petkov wrote:
> > On Fri, Apr 03, 2015 at 05:33:03PM +0200, Paul Bolle wrote:
> > > Well, "when building on 32 bits" it currently suffices to do:
> > >     make allnoconfig
> > > 
> > > and the patch changes that.
> > 
> > Hmm, so this would need more staring. The fact that 64-bit needs to set
> > CONFIG_64BIT, we would need a way to say:
> > 
> > 	option allnoconfig_y if ARCH = "x86"
> > 
> > And Kconfig doesn't support that yet...
> 
> The fact that "make allnoconfig" and "make allyesconfig" can give you
> a .config for another subarchitecture is annoying. [...]

Absolutely! No 'make *config' option should change the current 
.config's architecture, except if ARCH= is specified on the command 
line.

Thanks,

	Ingo

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

end of thread, other threads:[~2015-04-04  9:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-03 11:00 [PATCH] x86/Kconfig: Fix allnoconfig without explicitly specified ARCH Borislav Petkov
2015-04-03 13:42 ` Paul Bolle
2015-04-03 14:59   ` Borislav Petkov
2015-04-03 15:33     ` Paul Bolle
2015-04-03 17:23       ` Borislav Petkov
2015-04-03 21:43         ` Paul Bolle
2015-04-04  9:35           ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).