All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-16 15:45 ` Masahiro Yamada
  0 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-02-16 15:45 UTC (permalink / raw)
  To: linux-kbuild
  Cc: x86, sparclinux, linux-sh, linux-um, linux-kernel,
	Masahiro Yamada, Albert Ou, Anton Ivanov, Borislav Petkov,
	David S. Miller, Greentime Hu, Guo Ren, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Nick Hu, Palmer Dabbelt, Paul Walmsley,
	Rich Felker, Richard Weinberger, Thomas Gleixner, Vincent Chen,
	Yoshinori Sato, linux-riscv

Most of the Kconfig commands (except defconfig and all*config) read the
.config file as a base set of CONFIG options.

When it does not exist, the files in DEFCONFIG_LIST are searched in this
order and loaded if found.

I do not see much sense in the last two entries in DEFCONFIG_LIST.

[1] ARCH_DEFCONFIG

The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.

arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64
bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should
be a fixed string because the base config file is loaded before the symbol
evaluation stage.

Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is
invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the
same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with
"arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".

[2] arch/$(ARCH)/defconfig

This file path is no longer valid. The defconfig files are always located
in the arch configs/ directories.

  $ find arch -name defconfig | sort
  arch/alpha/configs/defconfig
  arch/arm64/configs/defconfig
  arch/csky/configs/defconfig
  arch/nds32/configs/defconfig
  arch/riscv/configs/defconfig
  arch/s390/configs/defconfig
  arch/unicore32/configs/defconfig

The path arch/*/configs/defconfig is already covered by
"arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
not necessary.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/sh/Kconfig     | 5 -----
 arch/sparc/Kconfig  | 5 -----
 arch/x86/Kconfig    | 5 -----
 arch/x86/um/Kconfig | 5 -----
 init/Kconfig        | 3 +--
 5 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 9ece111b0254..b4f0e37b83eb 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -87,11 +87,6 @@ config SUPERH64
 	select HAVE_EXIT_THREAD
 	select KALLSYMS
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/sh/configs/shx3_defconfig" if SUPERH32
-	default "arch/sh/configs/cayman_defconfig" if SUPERH64
-
 config GENERIC_BUG
 	def_bool y
 	depends on BUG && SUPERH32
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index c1dd6dd642f4..0de15380d1fc 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -95,11 +95,6 @@ config SPARC64
 	select PCI_DOMAINS if PCI
 	select ARCH_HAS_GIGANTIC_PAGE
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/sparc/configs/sparc32_defconfig" if SPARC32
-	default "arch/sparc/configs/sparc64_defconfig" if SPARC64
-
 config ARCH_PROC_KCORE_TEXT
 	def_bool y
 
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index beea77046f9b..98935f4387f9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -240,11 +240,6 @@ config OUTPUT_FORMAT
 	default "elf32-i386" if X86_32
 	default "elf64-x86-64" if X86_64
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/x86/configs/i386_defconfig" if X86_32
-	default "arch/x86/configs/x86_64_defconfig" if X86_64
-
 config LOCKDEP_SUPPORT
 	def_bool y
 
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index a8985e1f7432..95d26a69088b 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -27,11 +27,6 @@ config X86_64
 	def_bool 64BIT
 	select MODULES_USE_ELF_RELA
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/um/configs/i386_defconfig" if X86_32
-	default "arch/um/configs/x86_64_defconfig" if X86_64
-
 config 3_LEVEL_PGTABLES
 	bool "Three-level pagetables" if !64BIT
 	default 64BIT
diff --git a/init/Kconfig b/init/Kconfig
index 452bc1835cd4..6ccdb168dee5 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -6,8 +6,7 @@ config DEFCONFIG_LIST
 	default "/lib/modules/$(shell,uname -r)/.config"
 	default "/etc/kernel-config"
 	default "/boot/config-$(shell,uname -r)"
-	default ARCH_DEFCONFIG
-	default "arch/$(ARCH)/defconfig"
+	default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
 
 config CC_IS_GCC
 	def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
-- 
2.17.1

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

* [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-16 15:45 ` Masahiro Yamada
  0 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-02-16 15:45 UTC (permalink / raw)
  To: linux-kbuild
  Cc: x86, sparclinux, linux-sh, linux-um, linux-kernel,
	Masahiro Yamada, Albert Ou, Anton Ivanov, Borislav Petkov,
	David S. Miller, Greentime Hu, Guo Ren, H. Peter Anvin,
	Ingo Molnar, Jeff Dike, Nick Hu, Palmer Dabbelt, Paul Walmsley,
	Rich Felker, Richard Weinberger, Thomas Gleixner, Vincent Chen,
	Yoshinori Sato, linux-riscv

Most of the Kconfig commands (except defconfig and all*config) read the
.config file as a base set of CONFIG options.

When it does not exist, the files in DEFCONFIG_LIST are searched in this
order and loaded if found.

I do not see much sense in the last two entries in DEFCONFIG_LIST.

[1] ARCH_DEFCONFIG

The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.

arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64
bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should
be a fixed string because the base config file is loaded before the symbol
evaluation stage.

Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is
invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the
same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with
"arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".

[2] arch/$(ARCH)/defconfig

This file path is no longer valid. The defconfig files are always located
in the arch configs/ directories.

  $ find arch -name defconfig | sort
  arch/alpha/configs/defconfig
  arch/arm64/configs/defconfig
  arch/csky/configs/defconfig
  arch/nds32/configs/defconfig
  arch/riscv/configs/defconfig
  arch/s390/configs/defconfig
  arch/unicore32/configs/defconfig

The path arch/*/configs/defconfig is already covered by
"arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
not necessary.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/sh/Kconfig     | 5 -----
 arch/sparc/Kconfig  | 5 -----
 arch/x86/Kconfig    | 5 -----
 arch/x86/um/Kconfig | 5 -----
 init/Kconfig        | 3 +--
 5 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 9ece111b0254..b4f0e37b83eb 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -87,11 +87,6 @@ config SUPERH64
 	select HAVE_EXIT_THREAD
 	select KALLSYMS
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/sh/configs/shx3_defconfig" if SUPERH32
-	default "arch/sh/configs/cayman_defconfig" if SUPERH64
-
 config GENERIC_BUG
 	def_bool y
 	depends on BUG && SUPERH32
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index c1dd6dd642f4..0de15380d1fc 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -95,11 +95,6 @@ config SPARC64
 	select PCI_DOMAINS if PCI
 	select ARCH_HAS_GIGANTIC_PAGE
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/sparc/configs/sparc32_defconfig" if SPARC32
-	default "arch/sparc/configs/sparc64_defconfig" if SPARC64
-
 config ARCH_PROC_KCORE_TEXT
 	def_bool y
 
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index beea77046f9b..98935f4387f9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -240,11 +240,6 @@ config OUTPUT_FORMAT
 	default "elf32-i386" if X86_32
 	default "elf64-x86-64" if X86_64
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/x86/configs/i386_defconfig" if X86_32
-	default "arch/x86/configs/x86_64_defconfig" if X86_64
-
 config LOCKDEP_SUPPORT
 	def_bool y
 
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index a8985e1f7432..95d26a69088b 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -27,11 +27,6 @@ config X86_64
 	def_bool 64BIT
 	select MODULES_USE_ELF_RELA
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/um/configs/i386_defconfig" if X86_32
-	default "arch/um/configs/x86_64_defconfig" if X86_64
-
 config 3_LEVEL_PGTABLES
 	bool "Three-level pagetables" if !64BIT
 	default 64BIT
diff --git a/init/Kconfig b/init/Kconfig
index 452bc1835cd4..6ccdb168dee5 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -6,8 +6,7 @@ config DEFCONFIG_LIST
 	default "/lib/modules/$(shell,uname -r)/.config"
 	default "/etc/kernel-config"
 	default "/boot/config-$(shell,uname -r)"
-	default ARCH_DEFCONFIG
-	default "arch/$(ARCH)/defconfig"
+	default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
 
 config CC_IS_GCC
 	def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
-- 
2.17.1


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

* [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-16 15:45 ` Masahiro Yamada
  0 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-02-16 15:45 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Rich Felker, linux-sh, Guo Ren, H. Peter Anvin, sparclinux,
	linux-riscv, Vincent Chen, Anton Ivanov, Yoshinori Sato,
	Richard Weinberger, Masahiro Yamada, x86, Ingo Molnar, Albert Ou,
	Jeff Dike, linux-um, Borislav Petkov, Greentime Hu,
	Paul Walmsley, Thomas Gleixner, Nick Hu, linux-kernel,
	Palmer Dabbelt, David S. Miller

Most of the Kconfig commands (except defconfig and all*config) read the
.config file as a base set of CONFIG options.

When it does not exist, the files in DEFCONFIG_LIST are searched in this
order and loaded if found.

I do not see much sense in the last two entries in DEFCONFIG_LIST.

[1] ARCH_DEFCONFIG

The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.

arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64
bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should
be a fixed string because the base config file is loaded before the symbol
evaluation stage.

Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is
invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the
same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with
"arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".

[2] arch/$(ARCH)/defconfig

This file path is no longer valid. The defconfig files are always located
in the arch configs/ directories.

  $ find arch -name defconfig | sort
  arch/alpha/configs/defconfig
  arch/arm64/configs/defconfig
  arch/csky/configs/defconfig
  arch/nds32/configs/defconfig
  arch/riscv/configs/defconfig
  arch/s390/configs/defconfig
  arch/unicore32/configs/defconfig

The path arch/*/configs/defconfig is already covered by
"arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
not necessary.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/sh/Kconfig     | 5 -----
 arch/sparc/Kconfig  | 5 -----
 arch/x86/Kconfig    | 5 -----
 arch/x86/um/Kconfig | 5 -----
 init/Kconfig        | 3 +--
 5 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 9ece111b0254..b4f0e37b83eb 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -87,11 +87,6 @@ config SUPERH64
 	select HAVE_EXIT_THREAD
 	select KALLSYMS
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/sh/configs/shx3_defconfig" if SUPERH32
-	default "arch/sh/configs/cayman_defconfig" if SUPERH64
-
 config GENERIC_BUG
 	def_bool y
 	depends on BUG && SUPERH32
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index c1dd6dd642f4..0de15380d1fc 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -95,11 +95,6 @@ config SPARC64
 	select PCI_DOMAINS if PCI
 	select ARCH_HAS_GIGANTIC_PAGE
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/sparc/configs/sparc32_defconfig" if SPARC32
-	default "arch/sparc/configs/sparc64_defconfig" if SPARC64
-
 config ARCH_PROC_KCORE_TEXT
 	def_bool y
 
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index beea77046f9b..98935f4387f9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -240,11 +240,6 @@ config OUTPUT_FORMAT
 	default "elf32-i386" if X86_32
 	default "elf64-x86-64" if X86_64
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/x86/configs/i386_defconfig" if X86_32
-	default "arch/x86/configs/x86_64_defconfig" if X86_64
-
 config LOCKDEP_SUPPORT
 	def_bool y
 
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index a8985e1f7432..95d26a69088b 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -27,11 +27,6 @@ config X86_64
 	def_bool 64BIT
 	select MODULES_USE_ELF_RELA
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/um/configs/i386_defconfig" if X86_32
-	default "arch/um/configs/x86_64_defconfig" if X86_64
-
 config 3_LEVEL_PGTABLES
 	bool "Three-level pagetables" if !64BIT
 	default 64BIT
diff --git a/init/Kconfig b/init/Kconfig
index 452bc1835cd4..6ccdb168dee5 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -6,8 +6,7 @@ config DEFCONFIG_LIST
 	default "/lib/modules/$(shell,uname -r)/.config"
 	default "/etc/kernel-config"
 	default "/boot/config-$(shell,uname -r)"
-	default ARCH_DEFCONFIG
-	default "arch/$(ARCH)/defconfig"
+	default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
 
 config CC_IS_GCC
 	def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
-- 
2.17.1



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

* [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-16 15:45 ` Masahiro Yamada
  0 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-02-16 15:45 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Rich Felker, linux-sh, Guo Ren, H. Peter Anvin, sparclinux,
	linux-riscv, Vincent Chen, Anton Ivanov, Yoshinori Sato,
	Richard Weinberger, Masahiro Yamada, x86, Ingo Molnar, Albert Ou,
	Jeff Dike, linux-um, Borislav Petkov, Greentime Hu,
	Paul Walmsley, Thomas Gleixner, Nick Hu, linux-kernel,
	Palmer Dabbelt, David S. Miller

Most of the Kconfig commands (except defconfig and all*config) read the
.config file as a base set of CONFIG options.

When it does not exist, the files in DEFCONFIG_LIST are searched in this
order and loaded if found.

I do not see much sense in the last two entries in DEFCONFIG_LIST.

[1] ARCH_DEFCONFIG

The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.

arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64
bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should
be a fixed string because the base config file is loaded before the symbol
evaluation stage.

Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is
invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the
same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with
"arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".

[2] arch/$(ARCH)/defconfig

This file path is no longer valid. The defconfig files are always located
in the arch configs/ directories.

  $ find arch -name defconfig | sort
  arch/alpha/configs/defconfig
  arch/arm64/configs/defconfig
  arch/csky/configs/defconfig
  arch/nds32/configs/defconfig
  arch/riscv/configs/defconfig
  arch/s390/configs/defconfig
  arch/unicore32/configs/defconfig

The path arch/*/configs/defconfig is already covered by
"arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
not necessary.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/sh/Kconfig     | 5 -----
 arch/sparc/Kconfig  | 5 -----
 arch/x86/Kconfig    | 5 -----
 arch/x86/um/Kconfig | 5 -----
 init/Kconfig        | 3 +--
 5 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 9ece111b0254..b4f0e37b83eb 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -87,11 +87,6 @@ config SUPERH64
 	select HAVE_EXIT_THREAD
 	select KALLSYMS
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/sh/configs/shx3_defconfig" if SUPERH32
-	default "arch/sh/configs/cayman_defconfig" if SUPERH64
-
 config GENERIC_BUG
 	def_bool y
 	depends on BUG && SUPERH32
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index c1dd6dd642f4..0de15380d1fc 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -95,11 +95,6 @@ config SPARC64
 	select PCI_DOMAINS if PCI
 	select ARCH_HAS_GIGANTIC_PAGE
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/sparc/configs/sparc32_defconfig" if SPARC32
-	default "arch/sparc/configs/sparc64_defconfig" if SPARC64
-
 config ARCH_PROC_KCORE_TEXT
 	def_bool y
 
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index beea77046f9b..98935f4387f9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -240,11 +240,6 @@ config OUTPUT_FORMAT
 	default "elf32-i386" if X86_32
 	default "elf64-x86-64" if X86_64
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/x86/configs/i386_defconfig" if X86_32
-	default "arch/x86/configs/x86_64_defconfig" if X86_64
-
 config LOCKDEP_SUPPORT
 	def_bool y
 
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index a8985e1f7432..95d26a69088b 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -27,11 +27,6 @@ config X86_64
 	def_bool 64BIT
 	select MODULES_USE_ELF_RELA
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/um/configs/i386_defconfig" if X86_32
-	default "arch/um/configs/x86_64_defconfig" if X86_64
-
 config 3_LEVEL_PGTABLES
 	bool "Three-level pagetables" if !64BIT
 	default 64BIT
diff --git a/init/Kconfig b/init/Kconfig
index 452bc1835cd4..6ccdb168dee5 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -6,8 +6,7 @@ config DEFCONFIG_LIST
 	default "/lib/modules/$(shell,uname -r)/.config"
 	default "/etc/kernel-config"
 	default "/boot/config-$(shell,uname -r)"
-	default ARCH_DEFCONFIG
-	default "arch/$(ARCH)/defconfig"
+	default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
 
 config CC_IS_GCC
 	def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
-- 
2.17.1


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
       [not found] ` <CGME20200221085039eucas1p2b439c37eb04870cc020f452b7ad31929@eucas1p2.samsung.com>
                       ` (2 preceding siblings ...)
  (?)
@ 2020-02-21  8:50     ` Marek Szyprowski
  0 siblings, 0 replies; 27+ messages in thread
From: Marek Szyprowski @ 2020-02-21  8:50 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild
  Cc: Rich Felker, linux-sh, Catalin Marinas, Guo Ren, H. Peter Anvin,
	sparclinux, linux-riscv, Vincent Chen, Will Deacon, Anton Ivanov,
	Yoshinori Sato, Richard Weinberger, x86, Ingo Molnar, Albert Ou,
	Jeff Dike, linux-um, Borislav Petkov, Greentime Hu,
	Paul Walmsley, Thomas Gleixner, linux-arm-kernel, Nick Hu,
	linux-kernel, Palmer Dabbelt, David S. Miller

Dear All,

On 16.02.2020 16:45, Masahiro Yamada wrote:
> Most of the Kconfig commands (except defconfig and all*config) read the
> .config file as a base set of CONFIG options.
>
> When it does not exist, the files in DEFCONFIG_LIST are searched in this
> order and loaded if found.
>
> I do not see much sense in the last two entries in DEFCONFIG_LIST.
>
> [1] ARCH_DEFCONFIG
>
> The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
> ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
>
> arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64
> bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should
> be a fixed string because the base config file is loaded before the symbol
> evaluation stage.
>
> Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is
> invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the
> same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with
> "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
>
> [2] arch/$(ARCH)/defconfig
>
> This file path is no longer valid. The defconfig files are always located
> in the arch configs/ directories.
>
>    $ find arch -name defconfig | sort
>    arch/alpha/configs/defconfig
>    arch/arm64/configs/defconfig
>    arch/csky/configs/defconfig
>    arch/nds32/configs/defconfig
>    arch/riscv/configs/defconfig
>    arch/s390/configs/defconfig
>    arch/unicore32/configs/defconfig
>
> The path arch/*/configs/defconfig is already covered by
> "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
> not necessary.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

This patch landed in today's linux-next (next-20200221) and broke arm64 
builds:

--->8---

$ make ARCH=arm64 CROSS_COMPILEªrch64-linux-gnu- defconfig
*** Default configuration is based on 'defconfig'
#
# configuration written to .config
#
$ make ARCH=arm64 CROSS_COMPILEªrch64-linux-gnu- Image.gz
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
...

(endless loop)

--->8---

Reverting it fixes the issue:

--->8---

$ git revert cdd5d1a207d6a3a06c9e627a0234d9a6af6ad347
[detached HEAD 1080d6a13b6d] Revert "kbuild: use KBUILD_DEFCONFIG as the 
fallback for DEFCONFIG_LIST"
  5 files changed, 22 insertions(+), 1 deletion(-)
$ make ARCH=arm64 CROSS_COMPILEªrch64-linux-gnu- defconfig
*** Default configuration is based on 'defconfig'
#
# No change to .config
#
$ make ARCH=arm64 CROSS_COMPILEªrch64-linux-gnu- Image.gz
scripts/kconfig/conf  --syncconfig Kconfig
   UPD     include/config/kernel.release
   UPD     include/generated/utsrelease.h
   CC      scripts/mod/empty.o
...

$ aarch64-linux-gnu-gcc --version
aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--->8---

It looks that the issue is similar to the one described here:

https://patchwork.kernel.org/patch/10453685/

I hope this report helps fixing the issue.

> ---
>
>   arch/sh/Kconfig     | 5 -----
>   arch/sparc/Kconfig  | 5 -----
>   arch/x86/Kconfig    | 5 -----
>   arch/x86/um/Kconfig | 5 -----
>   init/Kconfig        | 3 +--
>   5 files changed, 1 insertion(+), 22 deletions(-)
>
> diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> index 9ece111b0254..b4f0e37b83eb 100644
> --- a/arch/sh/Kconfig
> +++ b/arch/sh/Kconfig
> @@ -87,11 +87,6 @@ config SUPERH64
>   	select HAVE_EXIT_THREAD
>   	select KALLSYMS
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/sh/configs/shx3_defconfig" if SUPERH32
> -	default "arch/sh/configs/cayman_defconfig" if SUPERH64
> -
>   config GENERIC_BUG
>   	def_bool y
>   	depends on BUG && SUPERH32
> diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
> index c1dd6dd642f4..0de15380d1fc 100644
> --- a/arch/sparc/Kconfig
> +++ b/arch/sparc/Kconfig
> @@ -95,11 +95,6 @@ config SPARC64
>   	select PCI_DOMAINS if PCI
>   	select ARCH_HAS_GIGANTIC_PAGE
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/sparc/configs/sparc32_defconfig" if SPARC32
> -	default "arch/sparc/configs/sparc64_defconfig" if SPARC64
> -
>   config ARCH_PROC_KCORE_TEXT
>   	def_bool y
>   
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index beea77046f9b..98935f4387f9 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -240,11 +240,6 @@ config OUTPUT_FORMAT
>   	default "elf32-i386" if X86_32
>   	default "elf64-x86-64" if X86_64
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/x86/configs/i386_defconfig" if X86_32
> -	default "arch/x86/configs/x86_64_defconfig" if X86_64
> -
>   config LOCKDEP_SUPPORT
>   	def_bool y
>   
> diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
> index a8985e1f7432..95d26a69088b 100644
> --- a/arch/x86/um/Kconfig
> +++ b/arch/x86/um/Kconfig
> @@ -27,11 +27,6 @@ config X86_64
>   	def_bool 64BIT
>   	select MODULES_USE_ELF_RELA
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/um/configs/i386_defconfig" if X86_32
> -	default "arch/um/configs/x86_64_defconfig" if X86_64
> -
>   config 3_LEVEL_PGTABLES
>   	bool "Three-level pagetables" if !64BIT
>   	default 64BIT
> diff --git a/init/Kconfig b/init/Kconfig
> index 452bc1835cd4..6ccdb168dee5 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -6,8 +6,7 @@ config DEFCONFIG_LIST
>   	default "/lib/modules/$(shell,uname -r)/.config"
>   	default "/etc/kernel-config"
>   	default "/boot/config-$(shell,uname -r)"
> -	default ARCH_DEFCONFIG
> -	default "arch/$(ARCH)/defconfig"
> +	default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
>   
>   config CC_IS_GCC
>   	def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-21  8:50     ` Marek Szyprowski
  0 siblings, 0 replies; 27+ messages in thread
From: Marek Szyprowski @ 2020-02-21  8:50 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild
  Cc: x86, sparclinux, linux-sh, linux-um, linux-kernel, Albert Ou,
	Anton Ivanov, Borislav Petkov, David S. Miller, Greentime Hu,
	Guo Ren, H. Peter Anvin, Ingo Molnar, Jeff Dike, Nick Hu,
	Palmer Dabbelt, Paul Walmsley, Rich Felker, Richard Weinberger,
	Thomas Gleixner, Vincent Chen, Yoshinori Sato, linux-riscv,
	linux-arm-kernel, Catalin Marinas, Will Deacon

Dear All,

On 16.02.2020 16:45, Masahiro Yamada wrote:
> Most of the Kconfig commands (except defconfig and all*config) read the
> .config file as a base set of CONFIG options.
>
> When it does not exist, the files in DEFCONFIG_LIST are searched in this
> order and loaded if found.
>
> I do not see much sense in the last two entries in DEFCONFIG_LIST.
>
> [1] ARCH_DEFCONFIG
>
> The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
> ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
>
> arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64
> bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should
> be a fixed string because the base config file is loaded before the symbol
> evaluation stage.
>
> Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is
> invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the
> same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with
> "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
>
> [2] arch/$(ARCH)/defconfig
>
> This file path is no longer valid. The defconfig files are always located
> in the arch configs/ directories.
>
>    $ find arch -name defconfig | sort
>    arch/alpha/configs/defconfig
>    arch/arm64/configs/defconfig
>    arch/csky/configs/defconfig
>    arch/nds32/configs/defconfig
>    arch/riscv/configs/defconfig
>    arch/s390/configs/defconfig
>    arch/unicore32/configs/defconfig
>
> The path arch/*/configs/defconfig is already covered by
> "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
> not necessary.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

This patch landed in today's linux-next (next-20200221) and broke arm64 
builds:

--->8---

$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
*** Default configuration is based on 'defconfig'
#
# configuration written to .config
#
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
...

(endless loop)

--->8---

Reverting it fixes the issue:

--->8---

$ git revert cdd5d1a207d6a3a06c9e627a0234d9a6af6ad347
[detached HEAD 1080d6a13b6d] Revert "kbuild: use KBUILD_DEFCONFIG as the 
fallback for DEFCONFIG_LIST"
  5 files changed, 22 insertions(+), 1 deletion(-)
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
*** Default configuration is based on 'defconfig'
#
# No change to .config
#
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
scripts/kconfig/conf  --syncconfig Kconfig
   UPD     include/config/kernel.release
   UPD     include/generated/utsrelease.h
   CC      scripts/mod/empty.o
...

$ aarch64-linux-gnu-gcc --version
aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--->8---

It looks that the issue is similar to the one described here:

https://patchwork.kernel.org/patch/10453685/

I hope this report helps fixing the issue.

> ---
>
>   arch/sh/Kconfig     | 5 -----
>   arch/sparc/Kconfig  | 5 -----
>   arch/x86/Kconfig    | 5 -----
>   arch/x86/um/Kconfig | 5 -----
>   init/Kconfig        | 3 +--
>   5 files changed, 1 insertion(+), 22 deletions(-)
>
> diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> index 9ece111b0254..b4f0e37b83eb 100644
> --- a/arch/sh/Kconfig
> +++ b/arch/sh/Kconfig
> @@ -87,11 +87,6 @@ config SUPERH64
>   	select HAVE_EXIT_THREAD
>   	select KALLSYMS
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/sh/configs/shx3_defconfig" if SUPERH32
> -	default "arch/sh/configs/cayman_defconfig" if SUPERH64
> -
>   config GENERIC_BUG
>   	def_bool y
>   	depends on BUG && SUPERH32
> diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
> index c1dd6dd642f4..0de15380d1fc 100644
> --- a/arch/sparc/Kconfig
> +++ b/arch/sparc/Kconfig
> @@ -95,11 +95,6 @@ config SPARC64
>   	select PCI_DOMAINS if PCI
>   	select ARCH_HAS_GIGANTIC_PAGE
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/sparc/configs/sparc32_defconfig" if SPARC32
> -	default "arch/sparc/configs/sparc64_defconfig" if SPARC64
> -
>   config ARCH_PROC_KCORE_TEXT
>   	def_bool y
>   
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index beea77046f9b..98935f4387f9 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -240,11 +240,6 @@ config OUTPUT_FORMAT
>   	default "elf32-i386" if X86_32
>   	default "elf64-x86-64" if X86_64
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/x86/configs/i386_defconfig" if X86_32
> -	default "arch/x86/configs/x86_64_defconfig" if X86_64
> -
>   config LOCKDEP_SUPPORT
>   	def_bool y
>   
> diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
> index a8985e1f7432..95d26a69088b 100644
> --- a/arch/x86/um/Kconfig
> +++ b/arch/x86/um/Kconfig
> @@ -27,11 +27,6 @@ config X86_64
>   	def_bool 64BIT
>   	select MODULES_USE_ELF_RELA
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/um/configs/i386_defconfig" if X86_32
> -	default "arch/um/configs/x86_64_defconfig" if X86_64
> -
>   config 3_LEVEL_PGTABLES
>   	bool "Three-level pagetables" if !64BIT
>   	default 64BIT
> diff --git a/init/Kconfig b/init/Kconfig
> index 452bc1835cd4..6ccdb168dee5 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -6,8 +6,7 @@ config DEFCONFIG_LIST
>   	default "/lib/modules/$(shell,uname -r)/.config"
>   	default "/etc/kernel-config"
>   	default "/boot/config-$(shell,uname -r)"
> -	default ARCH_DEFCONFIG
> -	default "arch/$(ARCH)/defconfig"
> +	default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
>   
>   config CC_IS_GCC
>   	def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-21  8:50     ` Marek Szyprowski
  0 siblings, 0 replies; 27+ messages in thread
From: Marek Szyprowski @ 2020-02-21  8:50 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild
  Cc: x86, sparclinux, linux-sh, linux-um, linux-kernel, Albert Ou,
	Anton Ivanov, Borislav Petkov, David S. Miller, Greentime Hu,
	Guo Ren, H. Peter Anvin, Ingo Molnar, Jeff Dike, Nick Hu,
	Palmer Dabbelt, Paul Walmsley, Rich Felker, Richard Weinberger,
	Thomas Gleixner, Vincent Chen, Yoshinori Sato, linux-riscv,
	linux-arm-kernel, Catalin Marinas, Will Deacon

Dear All,

On 16.02.2020 16:45, Masahiro Yamada wrote:
> Most of the Kconfig commands (except defconfig and all*config) read the
> .config file as a base set of CONFIG options.
>
> When it does not exist, the files in DEFCONFIG_LIST are searched in this
> order and loaded if found.
>
> I do not see much sense in the last two entries in DEFCONFIG_LIST.
>
> [1] ARCH_DEFCONFIG
>
> The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
> ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
>
> arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64
> bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should
> be a fixed string because the base config file is loaded before the symbol
> evaluation stage.
>
> Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is
> invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the
> same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with
> "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
>
> [2] arch/$(ARCH)/defconfig
>
> This file path is no longer valid. The defconfig files are always located
> in the arch configs/ directories.
>
>    $ find arch -name defconfig | sort
>    arch/alpha/configs/defconfig
>    arch/arm64/configs/defconfig
>    arch/csky/configs/defconfig
>    arch/nds32/configs/defconfig
>    arch/riscv/configs/defconfig
>    arch/s390/configs/defconfig
>    arch/unicore32/configs/defconfig
>
> The path arch/*/configs/defconfig is already covered by
> "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
> not necessary.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

This patch landed in today's linux-next (next-20200221) and broke arm64 
builds:

--->8---

$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
*** Default configuration is based on 'defconfig'
#
# configuration written to .config
#
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
...

(endless loop)

--->8---

Reverting it fixes the issue:

--->8---

$ git revert cdd5d1a207d6a3a06c9e627a0234d9a6af6ad347
[detached HEAD 1080d6a13b6d] Revert "kbuild: use KBUILD_DEFCONFIG as the 
fallback for DEFCONFIG_LIST"
  5 files changed, 22 insertions(+), 1 deletion(-)
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
*** Default configuration is based on 'defconfig'
#
# No change to .config
#
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
scripts/kconfig/conf  --syncconfig Kconfig
   UPD     include/config/kernel.release
   UPD     include/generated/utsrelease.h
   CC      scripts/mod/empty.o
...

$ aarch64-linux-gnu-gcc --version
aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--->8---

It looks that the issue is similar to the one described here:

https://patchwork.kernel.org/patch/10453685/

I hope this report helps fixing the issue.

> ---
>
>   arch/sh/Kconfig     | 5 -----
>   arch/sparc/Kconfig  | 5 -----
>   arch/x86/Kconfig    | 5 -----
>   arch/x86/um/Kconfig | 5 -----
>   init/Kconfig        | 3 +--
>   5 files changed, 1 insertion(+), 22 deletions(-)
>
> diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> index 9ece111b0254..b4f0e37b83eb 100644
> --- a/arch/sh/Kconfig
> +++ b/arch/sh/Kconfig
> @@ -87,11 +87,6 @@ config SUPERH64
>   	select HAVE_EXIT_THREAD
>   	select KALLSYMS
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/sh/configs/shx3_defconfig" if SUPERH32
> -	default "arch/sh/configs/cayman_defconfig" if SUPERH64
> -
>   config GENERIC_BUG
>   	def_bool y
>   	depends on BUG && SUPERH32
> diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
> index c1dd6dd642f4..0de15380d1fc 100644
> --- a/arch/sparc/Kconfig
> +++ b/arch/sparc/Kconfig
> @@ -95,11 +95,6 @@ config SPARC64
>   	select PCI_DOMAINS if PCI
>   	select ARCH_HAS_GIGANTIC_PAGE
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/sparc/configs/sparc32_defconfig" if SPARC32
> -	default "arch/sparc/configs/sparc64_defconfig" if SPARC64
> -
>   config ARCH_PROC_KCORE_TEXT
>   	def_bool y
>   
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index beea77046f9b..98935f4387f9 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -240,11 +240,6 @@ config OUTPUT_FORMAT
>   	default "elf32-i386" if X86_32
>   	default "elf64-x86-64" if X86_64
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/x86/configs/i386_defconfig" if X86_32
> -	default "arch/x86/configs/x86_64_defconfig" if X86_64
> -
>   config LOCKDEP_SUPPORT
>   	def_bool y
>   
> diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
> index a8985e1f7432..95d26a69088b 100644
> --- a/arch/x86/um/Kconfig
> +++ b/arch/x86/um/Kconfig
> @@ -27,11 +27,6 @@ config X86_64
>   	def_bool 64BIT
>   	select MODULES_USE_ELF_RELA
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/um/configs/i386_defconfig" if X86_32
> -	default "arch/um/configs/x86_64_defconfig" if X86_64
> -
>   config 3_LEVEL_PGTABLES
>   	bool "Three-level pagetables" if !64BIT
>   	default 64BIT
> diff --git a/init/Kconfig b/init/Kconfig
> index 452bc1835cd4..6ccdb168dee5 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -6,8 +6,7 @@ config DEFCONFIG_LIST
>   	default "/lib/modules/$(shell,uname -r)/.config"
>   	default "/etc/kernel-config"
>   	default "/boot/config-$(shell,uname -r)"
> -	default ARCH_DEFCONFIG
> -	default "arch/$(ARCH)/defconfig"
> +	default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
>   
>   config CC_IS_GCC
>   	def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-21  8:50     ` Marek Szyprowski
  0 siblings, 0 replies; 27+ messages in thread
From: Marek Szyprowski @ 2020-02-21  8:50 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild
  Cc: Rich Felker, linux-sh, Catalin Marinas, Guo Ren, H. Peter Anvin,
	sparclinux, linux-riscv, Vincent Chen, Will Deacon, Anton Ivanov,
	Yoshinori Sato, Richard Weinberger, x86, Ingo Molnar, Albert Ou,
	Jeff Dike, linux-um, Borislav Petkov, Greentime Hu,
	Paul Walmsley, Thomas Gleixner, linux-arm-kernel, Nick Hu,
	linux-kernel, Palmer Dabbelt, David S. Miller

Dear All,

On 16.02.2020 16:45, Masahiro Yamada wrote:
> Most of the Kconfig commands (except defconfig and all*config) read the
> .config file as a base set of CONFIG options.
>
> When it does not exist, the files in DEFCONFIG_LIST are searched in this
> order and loaded if found.
>
> I do not see much sense in the last two entries in DEFCONFIG_LIST.
>
> [1] ARCH_DEFCONFIG
>
> The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
> ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
>
> arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64
> bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should
> be a fixed string because the base config file is loaded before the symbol
> evaluation stage.
>
> Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is
> invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the
> same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with
> "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
>
> [2] arch/$(ARCH)/defconfig
>
> This file path is no longer valid. The defconfig files are always located
> in the arch configs/ directories.
>
>    $ find arch -name defconfig | sort
>    arch/alpha/configs/defconfig
>    arch/arm64/configs/defconfig
>    arch/csky/configs/defconfig
>    arch/nds32/configs/defconfig
>    arch/riscv/configs/defconfig
>    arch/s390/configs/defconfig
>    arch/unicore32/configs/defconfig
>
> The path arch/*/configs/defconfig is already covered by
> "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
> not necessary.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

This patch landed in today's linux-next (next-20200221) and broke arm64 
builds:

--->8---

$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
*** Default configuration is based on 'defconfig'
#
# configuration written to .config
#
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
...

(endless loop)

--->8---

Reverting it fixes the issue:

--->8---

$ git revert cdd5d1a207d6a3a06c9e627a0234d9a6af6ad347
[detached HEAD 1080d6a13b6d] Revert "kbuild: use KBUILD_DEFCONFIG as the 
fallback for DEFCONFIG_LIST"
  5 files changed, 22 insertions(+), 1 deletion(-)
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
*** Default configuration is based on 'defconfig'
#
# No change to .config
#
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
scripts/kconfig/conf  --syncconfig Kconfig
   UPD     include/config/kernel.release
   UPD     include/generated/utsrelease.h
   CC      scripts/mod/empty.o
...

$ aarch64-linux-gnu-gcc --version
aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--->8---

It looks that the issue is similar to the one described here:

https://patchwork.kernel.org/patch/10453685/

I hope this report helps fixing the issue.

> ---
>
>   arch/sh/Kconfig     | 5 -----
>   arch/sparc/Kconfig  | 5 -----
>   arch/x86/Kconfig    | 5 -----
>   arch/x86/um/Kconfig | 5 -----
>   init/Kconfig        | 3 +--
>   5 files changed, 1 insertion(+), 22 deletions(-)
>
> diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> index 9ece111b0254..b4f0e37b83eb 100644
> --- a/arch/sh/Kconfig
> +++ b/arch/sh/Kconfig
> @@ -87,11 +87,6 @@ config SUPERH64
>   	select HAVE_EXIT_THREAD
>   	select KALLSYMS
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/sh/configs/shx3_defconfig" if SUPERH32
> -	default "arch/sh/configs/cayman_defconfig" if SUPERH64
> -
>   config GENERIC_BUG
>   	def_bool y
>   	depends on BUG && SUPERH32
> diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
> index c1dd6dd642f4..0de15380d1fc 100644
> --- a/arch/sparc/Kconfig
> +++ b/arch/sparc/Kconfig
> @@ -95,11 +95,6 @@ config SPARC64
>   	select PCI_DOMAINS if PCI
>   	select ARCH_HAS_GIGANTIC_PAGE
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/sparc/configs/sparc32_defconfig" if SPARC32
> -	default "arch/sparc/configs/sparc64_defconfig" if SPARC64
> -
>   config ARCH_PROC_KCORE_TEXT
>   	def_bool y
>   
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index beea77046f9b..98935f4387f9 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -240,11 +240,6 @@ config OUTPUT_FORMAT
>   	default "elf32-i386" if X86_32
>   	default "elf64-x86-64" if X86_64
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/x86/configs/i386_defconfig" if X86_32
> -	default "arch/x86/configs/x86_64_defconfig" if X86_64
> -
>   config LOCKDEP_SUPPORT
>   	def_bool y
>   
> diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
> index a8985e1f7432..95d26a69088b 100644
> --- a/arch/x86/um/Kconfig
> +++ b/arch/x86/um/Kconfig
> @@ -27,11 +27,6 @@ config X86_64
>   	def_bool 64BIT
>   	select MODULES_USE_ELF_RELA
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/um/configs/i386_defconfig" if X86_32
> -	default "arch/um/configs/x86_64_defconfig" if X86_64
> -
>   config 3_LEVEL_PGTABLES
>   	bool "Three-level pagetables" if !64BIT
>   	default 64BIT
> diff --git a/init/Kconfig b/init/Kconfig
> index 452bc1835cd4..6ccdb168dee5 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -6,8 +6,7 @@ config DEFCONFIG_LIST
>   	default "/lib/modules/$(shell,uname -r)/.config"
>   	default "/etc/kernel-config"
>   	default "/boot/config-$(shell,uname -r)"
> -	default ARCH_DEFCONFIG
> -	default "arch/$(ARCH)/defconfig"
> +	default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
>   
>   config CC_IS_GCC
>   	def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland



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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-21  8:50     ` Marek Szyprowski
  0 siblings, 0 replies; 27+ messages in thread
From: Marek Szyprowski @ 2020-02-21  8:50 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kbuild
  Cc: Rich Felker, linux-sh, Catalin Marinas, Guo Ren, H. Peter Anvin,
	sparclinux, linux-riscv, Vincent Chen, Will Deacon, Anton Ivanov,
	Yoshinori Sato, Richard Weinberger, x86, Ingo Molnar, Albert Ou,
	Jeff Dike, linux-um, Borislav Petkov, Greentime Hu,
	Paul Walmsley, Thomas Gleixner, linux-arm-kernel, Nick Hu,
	linux-kernel, Palmer Dabbelt, David S. Miller

Dear All,

On 16.02.2020 16:45, Masahiro Yamada wrote:
> Most of the Kconfig commands (except defconfig and all*config) read the
> .config file as a base set of CONFIG options.
>
> When it does not exist, the files in DEFCONFIG_LIST are searched in this
> order and loaded if found.
>
> I do not see much sense in the last two entries in DEFCONFIG_LIST.
>
> [1] ARCH_DEFCONFIG
>
> The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
> ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
>
> arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64
> bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should
> be a fixed string because the base config file is loaded before the symbol
> evaluation stage.
>
> Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is
> invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the
> same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with
> "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
>
> [2] arch/$(ARCH)/defconfig
>
> This file path is no longer valid. The defconfig files are always located
> in the arch configs/ directories.
>
>    $ find arch -name defconfig | sort
>    arch/alpha/configs/defconfig
>    arch/arm64/configs/defconfig
>    arch/csky/configs/defconfig
>    arch/nds32/configs/defconfig
>    arch/riscv/configs/defconfig
>    arch/s390/configs/defconfig
>    arch/unicore32/configs/defconfig
>
> The path arch/*/configs/defconfig is already covered by
> "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
> not necessary.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

This patch landed in today's linux-next (next-20200221) and broke arm64 
builds:

--->8---

$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
*** Default configuration is based on 'defconfig'
#
# configuration written to .config
#
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
scripts/kconfig/conf  --syncconfig Kconfig
...

(endless loop)

--->8---

Reverting it fixes the issue:

--->8---

$ git revert cdd5d1a207d6a3a06c9e627a0234d9a6af6ad347
[detached HEAD 1080d6a13b6d] Revert "kbuild: use KBUILD_DEFCONFIG as the 
fallback for DEFCONFIG_LIST"
  5 files changed, 22 insertions(+), 1 deletion(-)
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
*** Default configuration is based on 'defconfig'
#
# No change to .config
#
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
scripts/kconfig/conf  --syncconfig Kconfig
   UPD     include/config/kernel.release
   UPD     include/generated/utsrelease.h
   CC      scripts/mod/empty.o
...

$ aarch64-linux-gnu-gcc --version
aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--->8---

It looks that the issue is similar to the one described here:

https://patchwork.kernel.org/patch/10453685/

I hope this report helps fixing the issue.

> ---
>
>   arch/sh/Kconfig     | 5 -----
>   arch/sparc/Kconfig  | 5 -----
>   arch/x86/Kconfig    | 5 -----
>   arch/x86/um/Kconfig | 5 -----
>   init/Kconfig        | 3 +--
>   5 files changed, 1 insertion(+), 22 deletions(-)
>
> diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> index 9ece111b0254..b4f0e37b83eb 100644
> --- a/arch/sh/Kconfig
> +++ b/arch/sh/Kconfig
> @@ -87,11 +87,6 @@ config SUPERH64
>   	select HAVE_EXIT_THREAD
>   	select KALLSYMS
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/sh/configs/shx3_defconfig" if SUPERH32
> -	default "arch/sh/configs/cayman_defconfig" if SUPERH64
> -
>   config GENERIC_BUG
>   	def_bool y
>   	depends on BUG && SUPERH32
> diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
> index c1dd6dd642f4..0de15380d1fc 100644
> --- a/arch/sparc/Kconfig
> +++ b/arch/sparc/Kconfig
> @@ -95,11 +95,6 @@ config SPARC64
>   	select PCI_DOMAINS if PCI
>   	select ARCH_HAS_GIGANTIC_PAGE
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/sparc/configs/sparc32_defconfig" if SPARC32
> -	default "arch/sparc/configs/sparc64_defconfig" if SPARC64
> -
>   config ARCH_PROC_KCORE_TEXT
>   	def_bool y
>   
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index beea77046f9b..98935f4387f9 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -240,11 +240,6 @@ config OUTPUT_FORMAT
>   	default "elf32-i386" if X86_32
>   	default "elf64-x86-64" if X86_64
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/x86/configs/i386_defconfig" if X86_32
> -	default "arch/x86/configs/x86_64_defconfig" if X86_64
> -
>   config LOCKDEP_SUPPORT
>   	def_bool y
>   
> diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
> index a8985e1f7432..95d26a69088b 100644
> --- a/arch/x86/um/Kconfig
> +++ b/arch/x86/um/Kconfig
> @@ -27,11 +27,6 @@ config X86_64
>   	def_bool 64BIT
>   	select MODULES_USE_ELF_RELA
>   
> -config ARCH_DEFCONFIG
> -	string
> -	default "arch/um/configs/i386_defconfig" if X86_32
> -	default "arch/um/configs/x86_64_defconfig" if X86_64
> -
>   config 3_LEVEL_PGTABLES
>   	bool "Three-level pagetables" if !64BIT
>   	default 64BIT
> diff --git a/init/Kconfig b/init/Kconfig
> index 452bc1835cd4..6ccdb168dee5 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -6,8 +6,7 @@ config DEFCONFIG_LIST
>   	default "/lib/modules/$(shell,uname -r)/.config"
>   	default "/etc/kernel-config"
>   	default "/boot/config-$(shell,uname -r)"
> -	default ARCH_DEFCONFIG
> -	default "arch/$(ARCH)/defconfig"
> +	default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
>   
>   config CC_IS_GCC
>   	def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
  2020-02-21  8:50     ` Marek Szyprowski
                         ` (2 preceding siblings ...)
  (?)
@ 2020-02-21  9:18       ` Masahiro Yamada
  -1 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-02-21  9:18 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: Rich Felker, Linux-sh list, Catalin Marinas, Guo Ren,
	H. Peter Anvin, sparclinux, open list:SIFIVE DRIVERS,
	Vincent Chen, Will Deacon, Anton Ivanov, Yoshinori Sato,
	Richard Weinberger, X86 ML, Ingo Molnar, Albert Ou,
	Linux Kbuild mailing list, Jeff Dike, linux-um, Borislav Petkov,
	Greentime Hu, Paul Walmsley, Thomas Gleixner, linux-arm-kernel,
	Nick Hu, Linux Kernel Mailing List, Palmer Dabbelt,
	David S. Miller

On Fri, Feb 21, 2020 at 5:50 PM Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
>
> Dear All,
>
> On 16.02.2020 16:45, Masahiro Yamada wrote:
> > Most of the Kconfig commands (except defconfig and all*config) read the
> > .config file as a base set of CONFIG options.
> >
> > When it does not exist, the files in DEFCONFIG_LIST are searched in this
> > order and loaded if found.
> >
> > I do not see much sense in the last two entries in DEFCONFIG_LIST.
> >
> > [1] ARCH_DEFCONFIG
> >
> > The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
> > ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
> >
> > arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64
> > bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should
> > be a fixed string because the base config file is loaded before the symbol
> > evaluation stage.
> >
> > Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is
> > invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the
> > same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with
> > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
> >
> > [2] arch/$(ARCH)/defconfig
> >
> > This file path is no longer valid. The defconfig files are always located
> > in the arch configs/ directories.
> >
> >    $ find arch -name defconfig | sort
> >    arch/alpha/configs/defconfig
> >    arch/arm64/configs/defconfig
> >    arch/csky/configs/defconfig
> >    arch/nds32/configs/defconfig
> >    arch/riscv/configs/defconfig
> >    arch/s390/configs/defconfig
> >    arch/unicore32/configs/defconfig
> >
> > The path arch/*/configs/defconfig is already covered by
> > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
> > not necessary.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>
> This patch landed in today's linux-next (next-20200221) and broke arm64
> builds:
>
> --->8---
>
> $ make ARCH=arm64 CROSS_COMPILEªrch64-linux-gnu- defconfig
> *** Default configuration is based on 'defconfig'
> #
> # configuration written to .config
> #
> $ make ARCH=arm64 CROSS_COMPILEªrch64-linux-gnu- Image.gz
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> ...
>
> (endless loop)
>
> --->8---
>
> Reverting it fixes the issue:



My bad.

This is because arch/arm64/Makefile does not define
KBUILD_DEFCONFIG.



I will drop it.

Sorry about that.





>
> --->8---
>
> $ git revert cdd5d1a207d6a3a06c9e627a0234d9a6af6ad347
> [detached HEAD 1080d6a13b6d] Revert "kbuild: use KBUILD_DEFCONFIG as the
> fallback for DEFCONFIG_LIST"
>   5 files changed, 22 insertions(+), 1 deletion(-)
> $ make ARCH=arm64 CROSS_COMPILEªrch64-linux-gnu- defconfig
> *** Default configuration is based on 'defconfig'
> #
> # No change to .config
> #
> $ make ARCH=arm64 CROSS_COMPILEªrch64-linux-gnu- Image.gz
> scripts/kconfig/conf  --syncconfig Kconfig
>    UPD     include/config/kernel.release
>    UPD     include/generated/utsrelease.h
>    CC      scripts/mod/empty.o
> ...
>
> $ aarch64-linux-gnu-gcc --version
> aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0
> Copyright (C) 2017 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> --->8---
>
> It looks that the issue is similar to the one described here:
>
> https://patchwork.kernel.org/patch/10453685/
>
> I hope this report helps fixing the issue.
>
> > ---
> >
> >   arch/sh/Kconfig     | 5 -----
> >   arch/sparc/Kconfig  | 5 -----
> >   arch/x86/Kconfig    | 5 -----
> >   arch/x86/um/Kconfig | 5 -----
> >   init/Kconfig        | 3 +--
> >   5 files changed, 1 insertion(+), 22 deletions(-)
> >
> > diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> > index 9ece111b0254..b4f0e37b83eb 100644
> > --- a/arch/sh/Kconfig
> > +++ b/arch/sh/Kconfig
> > @@ -87,11 +87,6 @@ config SUPERH64
> >       select HAVE_EXIT_THREAD
> >       select KALLSYMS
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/sh/configs/shx3_defconfig" if SUPERH32
> > -     default "arch/sh/configs/cayman_defconfig" if SUPERH64
> > -
> >   config GENERIC_BUG
> >       def_bool y
> >       depends on BUG && SUPERH32
> > diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
> > index c1dd6dd642f4..0de15380d1fc 100644
> > --- a/arch/sparc/Kconfig
> > +++ b/arch/sparc/Kconfig
> > @@ -95,11 +95,6 @@ config SPARC64
> >       select PCI_DOMAINS if PCI
> >       select ARCH_HAS_GIGANTIC_PAGE
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/sparc/configs/sparc32_defconfig" if SPARC32
> > -     default "arch/sparc/configs/sparc64_defconfig" if SPARC64
> > -
> >   config ARCH_PROC_KCORE_TEXT
> >       def_bool y
> >
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> > index beea77046f9b..98935f4387f9 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -240,11 +240,6 @@ config OUTPUT_FORMAT
> >       default "elf32-i386" if X86_32
> >       default "elf64-x86-64" if X86_64
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/x86/configs/i386_defconfig" if X86_32
> > -     default "arch/x86/configs/x86_64_defconfig" if X86_64
> > -
> >   config LOCKDEP_SUPPORT
> >       def_bool y
> >
> > diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
> > index a8985e1f7432..95d26a69088b 100644
> > --- a/arch/x86/um/Kconfig
> > +++ b/arch/x86/um/Kconfig
> > @@ -27,11 +27,6 @@ config X86_64
> >       def_bool 64BIT
> >       select MODULES_USE_ELF_RELA
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/um/configs/i386_defconfig" if X86_32
> > -     default "arch/um/configs/x86_64_defconfig" if X86_64
> > -
> >   config 3_LEVEL_PGTABLES
> >       bool "Three-level pagetables" if !64BIT
> >       default 64BIT
> > diff --git a/init/Kconfig b/init/Kconfig
> > index 452bc1835cd4..6ccdb168dee5 100644
> > --- a/init/Kconfig
> > +++ b/init/Kconfig
> > @@ -6,8 +6,7 @@ config DEFCONFIG_LIST
> >       default "/lib/modules/$(shell,uname -r)/.config"
> >       default "/etc/kernel-config"
> >       default "/boot/config-$(shell,uname -r)"
> > -     default ARCH_DEFCONFIG
> > -     default "arch/$(ARCH)/defconfig"
> > +     default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
> >
> >   config CC_IS_GCC
> >       def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
>
> Best regards
> --
> Marek Szyprowski, PhD
> Samsung R&D Institute Poland
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-21  9:18       ` Masahiro Yamada
  0 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-02-21  9:18 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: Linux Kbuild mailing list, X86 ML, sparclinux, Linux-sh list,
	linux-um, Linux Kernel Mailing List, Albert Ou, Anton Ivanov,
	Borislav Petkov, David S. Miller, Greentime Hu, Guo Ren,
	H. Peter Anvin, Ingo Molnar, Jeff Dike, Nick Hu, Palmer Dabbelt,
	Paul Walmsley, Rich Felker, Richard Weinberger, Thomas Gleixner,
	Vincent Chen, Yoshinori Sato, open list:SIFIVE DRIVERS,
	linux-arm-kernel, Catalin Marinas, Will Deacon

On Fri, Feb 21, 2020 at 5:50 PM Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
>
> Dear All,
>
> On 16.02.2020 16:45, Masahiro Yamada wrote:
> > Most of the Kconfig commands (except defconfig and all*config) read the
> > .config file as a base set of CONFIG options.
> >
> > When it does not exist, the files in DEFCONFIG_LIST are searched in this
> > order and loaded if found.
> >
> > I do not see much sense in the last two entries in DEFCONFIG_LIST.
> >
> > [1] ARCH_DEFCONFIG
> >
> > The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
> > ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
> >
> > arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64
> > bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should
> > be a fixed string because the base config file is loaded before the symbol
> > evaluation stage.
> >
> > Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is
> > invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the
> > same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with
> > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
> >
> > [2] arch/$(ARCH)/defconfig
> >
> > This file path is no longer valid. The defconfig files are always located
> > in the arch configs/ directories.
> >
> >    $ find arch -name defconfig | sort
> >    arch/alpha/configs/defconfig
> >    arch/arm64/configs/defconfig
> >    arch/csky/configs/defconfig
> >    arch/nds32/configs/defconfig
> >    arch/riscv/configs/defconfig
> >    arch/s390/configs/defconfig
> >    arch/unicore32/configs/defconfig
> >
> > The path arch/*/configs/defconfig is already covered by
> > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
> > not necessary.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>
> This patch landed in today's linux-next (next-20200221) and broke arm64
> builds:
>
> --->8---
>
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
> *** Default configuration is based on 'defconfig'
> #
> # configuration written to .config
> #
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> ...
>
> (endless loop)
>
> --->8---
>
> Reverting it fixes the issue:



My bad.

This is because arch/arm64/Makefile does not define
KBUILD_DEFCONFIG.



I will drop it.

Sorry about that.





>
> --->8---
>
> $ git revert cdd5d1a207d6a3a06c9e627a0234d9a6af6ad347
> [detached HEAD 1080d6a13b6d] Revert "kbuild: use KBUILD_DEFCONFIG as the
> fallback for DEFCONFIG_LIST"
>   5 files changed, 22 insertions(+), 1 deletion(-)
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
> *** Default configuration is based on 'defconfig'
> #
> # No change to .config
> #
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
> scripts/kconfig/conf  --syncconfig Kconfig
>    UPD     include/config/kernel.release
>    UPD     include/generated/utsrelease.h
>    CC      scripts/mod/empty.o
> ...
>
> $ aarch64-linux-gnu-gcc --version
> aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0
> Copyright (C) 2017 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> --->8---
>
> It looks that the issue is similar to the one described here:
>
> https://patchwork.kernel.org/patch/10453685/
>
> I hope this report helps fixing the issue.
>
> > ---
> >
> >   arch/sh/Kconfig     | 5 -----
> >   arch/sparc/Kconfig  | 5 -----
> >   arch/x86/Kconfig    | 5 -----
> >   arch/x86/um/Kconfig | 5 -----
> >   init/Kconfig        | 3 +--
> >   5 files changed, 1 insertion(+), 22 deletions(-)
> >
> > diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> > index 9ece111b0254..b4f0e37b83eb 100644
> > --- a/arch/sh/Kconfig
> > +++ b/arch/sh/Kconfig
> > @@ -87,11 +87,6 @@ config SUPERH64
> >       select HAVE_EXIT_THREAD
> >       select KALLSYMS
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/sh/configs/shx3_defconfig" if SUPERH32
> > -     default "arch/sh/configs/cayman_defconfig" if SUPERH64
> > -
> >   config GENERIC_BUG
> >       def_bool y
> >       depends on BUG && SUPERH32
> > diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
> > index c1dd6dd642f4..0de15380d1fc 100644
> > --- a/arch/sparc/Kconfig
> > +++ b/arch/sparc/Kconfig
> > @@ -95,11 +95,6 @@ config SPARC64
> >       select PCI_DOMAINS if PCI
> >       select ARCH_HAS_GIGANTIC_PAGE
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/sparc/configs/sparc32_defconfig" if SPARC32
> > -     default "arch/sparc/configs/sparc64_defconfig" if SPARC64
> > -
> >   config ARCH_PROC_KCORE_TEXT
> >       def_bool y
> >
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> > index beea77046f9b..98935f4387f9 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -240,11 +240,6 @@ config OUTPUT_FORMAT
> >       default "elf32-i386" if X86_32
> >       default "elf64-x86-64" if X86_64
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/x86/configs/i386_defconfig" if X86_32
> > -     default "arch/x86/configs/x86_64_defconfig" if X86_64
> > -
> >   config LOCKDEP_SUPPORT
> >       def_bool y
> >
> > diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
> > index a8985e1f7432..95d26a69088b 100644
> > --- a/arch/x86/um/Kconfig
> > +++ b/arch/x86/um/Kconfig
> > @@ -27,11 +27,6 @@ config X86_64
> >       def_bool 64BIT
> >       select MODULES_USE_ELF_RELA
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/um/configs/i386_defconfig" if X86_32
> > -     default "arch/um/configs/x86_64_defconfig" if X86_64
> > -
> >   config 3_LEVEL_PGTABLES
> >       bool "Three-level pagetables" if !64BIT
> >       default 64BIT
> > diff --git a/init/Kconfig b/init/Kconfig
> > index 452bc1835cd4..6ccdb168dee5 100644
> > --- a/init/Kconfig
> > +++ b/init/Kconfig
> > @@ -6,8 +6,7 @@ config DEFCONFIG_LIST
> >       default "/lib/modules/$(shell,uname -r)/.config"
> >       default "/etc/kernel-config"
> >       default "/boot/config-$(shell,uname -r)"
> > -     default ARCH_DEFCONFIG
> > -     default "arch/$(ARCH)/defconfig"
> > +     default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
> >
> >   config CC_IS_GCC
> >       def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
>
> Best regards
> --
> Marek Szyprowski, PhD
> Samsung R&D Institute Poland
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-21  9:18       ` Masahiro Yamada
  0 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-02-21  9:18 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: Linux Kbuild mailing list, X86 ML, sparclinux, Linux-sh list,
	linux-um, Linux Kernel Mailing List, Albert Ou, Anton Ivanov,
	Borislav Petkov, David S. Miller, Greentime Hu, Guo Ren,
	H. Peter Anvin, Ingo Molnar, Jeff Dike, Nick Hu, Palmer Dabbelt,
	Paul Walmsley, Rich Felker, Richard Weinberger, Thomas Gleixner,
	Vincent Chen, Yoshinori Sato, open list:SIFIVE DRIVERS,
	linux-arm-kernel, Catalin Marinas, Will Deacon

On Fri, Feb 21, 2020 at 5:50 PM Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
>
> Dear All,
>
> On 16.02.2020 16:45, Masahiro Yamada wrote:
> > Most of the Kconfig commands (except defconfig and all*config) read the
> > .config file as a base set of CONFIG options.
> >
> > When it does not exist, the files in DEFCONFIG_LIST are searched in this
> > order and loaded if found.
> >
> > I do not see much sense in the last two entries in DEFCONFIG_LIST.
> >
> > [1] ARCH_DEFCONFIG
> >
> > The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
> > ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
> >
> > arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64
> > bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should
> > be a fixed string because the base config file is loaded before the symbol
> > evaluation stage.
> >
> > Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is
> > invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the
> > same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with
> > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
> >
> > [2] arch/$(ARCH)/defconfig
> >
> > This file path is no longer valid. The defconfig files are always located
> > in the arch configs/ directories.
> >
> >    $ find arch -name defconfig | sort
> >    arch/alpha/configs/defconfig
> >    arch/arm64/configs/defconfig
> >    arch/csky/configs/defconfig
> >    arch/nds32/configs/defconfig
> >    arch/riscv/configs/defconfig
> >    arch/s390/configs/defconfig
> >    arch/unicore32/configs/defconfig
> >
> > The path arch/*/configs/defconfig is already covered by
> > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
> > not necessary.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>
> This patch landed in today's linux-next (next-20200221) and broke arm64
> builds:
>
> --->8---
>
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
> *** Default configuration is based on 'defconfig'
> #
> # configuration written to .config
> #
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> ...
>
> (endless loop)
>
> --->8---
>
> Reverting it fixes the issue:



My bad.

This is because arch/arm64/Makefile does not define
KBUILD_DEFCONFIG.



I will drop it.

Sorry about that.





>
> --->8---
>
> $ git revert cdd5d1a207d6a3a06c9e627a0234d9a6af6ad347
> [detached HEAD 1080d6a13b6d] Revert "kbuild: use KBUILD_DEFCONFIG as the
> fallback for DEFCONFIG_LIST"
>   5 files changed, 22 insertions(+), 1 deletion(-)
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
> *** Default configuration is based on 'defconfig'
> #
> # No change to .config
> #
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
> scripts/kconfig/conf  --syncconfig Kconfig
>    UPD     include/config/kernel.release
>    UPD     include/generated/utsrelease.h
>    CC      scripts/mod/empty.o
> ...
>
> $ aarch64-linux-gnu-gcc --version
> aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0
> Copyright (C) 2017 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> --->8---
>
> It looks that the issue is similar to the one described here:
>
> https://patchwork.kernel.org/patch/10453685/
>
> I hope this report helps fixing the issue.
>
> > ---
> >
> >   arch/sh/Kconfig     | 5 -----
> >   arch/sparc/Kconfig  | 5 -----
> >   arch/x86/Kconfig    | 5 -----
> >   arch/x86/um/Kconfig | 5 -----
> >   init/Kconfig        | 3 +--
> >   5 files changed, 1 insertion(+), 22 deletions(-)
> >
> > diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> > index 9ece111b0254..b4f0e37b83eb 100644
> > --- a/arch/sh/Kconfig
> > +++ b/arch/sh/Kconfig
> > @@ -87,11 +87,6 @@ config SUPERH64
> >       select HAVE_EXIT_THREAD
> >       select KALLSYMS
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/sh/configs/shx3_defconfig" if SUPERH32
> > -     default "arch/sh/configs/cayman_defconfig" if SUPERH64
> > -
> >   config GENERIC_BUG
> >       def_bool y
> >       depends on BUG && SUPERH32
> > diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
> > index c1dd6dd642f4..0de15380d1fc 100644
> > --- a/arch/sparc/Kconfig
> > +++ b/arch/sparc/Kconfig
> > @@ -95,11 +95,6 @@ config SPARC64
> >       select PCI_DOMAINS if PCI
> >       select ARCH_HAS_GIGANTIC_PAGE
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/sparc/configs/sparc32_defconfig" if SPARC32
> > -     default "arch/sparc/configs/sparc64_defconfig" if SPARC64
> > -
> >   config ARCH_PROC_KCORE_TEXT
> >       def_bool y
> >
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> > index beea77046f9b..98935f4387f9 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -240,11 +240,6 @@ config OUTPUT_FORMAT
> >       default "elf32-i386" if X86_32
> >       default "elf64-x86-64" if X86_64
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/x86/configs/i386_defconfig" if X86_32
> > -     default "arch/x86/configs/x86_64_defconfig" if X86_64
> > -
> >   config LOCKDEP_SUPPORT
> >       def_bool y
> >
> > diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
> > index a8985e1f7432..95d26a69088b 100644
> > --- a/arch/x86/um/Kconfig
> > +++ b/arch/x86/um/Kconfig
> > @@ -27,11 +27,6 @@ config X86_64
> >       def_bool 64BIT
> >       select MODULES_USE_ELF_RELA
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/um/configs/i386_defconfig" if X86_32
> > -     default "arch/um/configs/x86_64_defconfig" if X86_64
> > -
> >   config 3_LEVEL_PGTABLES
> >       bool "Three-level pagetables" if !64BIT
> >       default 64BIT
> > diff --git a/init/Kconfig b/init/Kconfig
> > index 452bc1835cd4..6ccdb168dee5 100644
> > --- a/init/Kconfig
> > +++ b/init/Kconfig
> > @@ -6,8 +6,7 @@ config DEFCONFIG_LIST
> >       default "/lib/modules/$(shell,uname -r)/.config"
> >       default "/etc/kernel-config"
> >       default "/boot/config-$(shell,uname -r)"
> > -     default ARCH_DEFCONFIG
> > -     default "arch/$(ARCH)/defconfig"
> > +     default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
> >
> >   config CC_IS_GCC
> >       def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
>
> Best regards
> --
> Marek Szyprowski, PhD
> Samsung R&D Institute Poland
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-21  9:18       ` Masahiro Yamada
  0 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-02-21  9:18 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: Rich Felker, Linux-sh list, Catalin Marinas, Guo Ren,
	H. Peter Anvin, sparclinux, open list:SIFIVE DRIVERS,
	Vincent Chen, Will Deacon, Anton Ivanov, Yoshinori Sato,
	Richard Weinberger, X86 ML, Ingo Molnar, Albert Ou,
	Linux Kbuild mailing list, Jeff Dike, linux-um, Borislav Petkov,
	Greentime Hu, Paul Walmsley, Thomas Gleixner, linux-arm-kernel,
	Nick Hu, Linux Kernel Mailing List, Palmer Dabbelt,
	David S. Miller

On Fri, Feb 21, 2020 at 5:50 PM Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
>
> Dear All,
>
> On 16.02.2020 16:45, Masahiro Yamada wrote:
> > Most of the Kconfig commands (except defconfig and all*config) read the
> > .config file as a base set of CONFIG options.
> >
> > When it does not exist, the files in DEFCONFIG_LIST are searched in this
> > order and loaded if found.
> >
> > I do not see much sense in the last two entries in DEFCONFIG_LIST.
> >
> > [1] ARCH_DEFCONFIG
> >
> > The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
> > ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
> >
> > arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64
> > bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should
> > be a fixed string because the base config file is loaded before the symbol
> > evaluation stage.
> >
> > Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is
> > invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the
> > same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with
> > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
> >
> > [2] arch/$(ARCH)/defconfig
> >
> > This file path is no longer valid. The defconfig files are always located
> > in the arch configs/ directories.
> >
> >    $ find arch -name defconfig | sort
> >    arch/alpha/configs/defconfig
> >    arch/arm64/configs/defconfig
> >    arch/csky/configs/defconfig
> >    arch/nds32/configs/defconfig
> >    arch/riscv/configs/defconfig
> >    arch/s390/configs/defconfig
> >    arch/unicore32/configs/defconfig
> >
> > The path arch/*/configs/defconfig is already covered by
> > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
> > not necessary.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>
> This patch landed in today's linux-next (next-20200221) and broke arm64
> builds:
>
> --->8---
>
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
> *** Default configuration is based on 'defconfig'
> #
> # configuration written to .config
> #
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> ...
>
> (endless loop)
>
> --->8---
>
> Reverting it fixes the issue:



My bad.

This is because arch/arm64/Makefile does not define
KBUILD_DEFCONFIG.



I will drop it.

Sorry about that.





>
> --->8---
>
> $ git revert cdd5d1a207d6a3a06c9e627a0234d9a6af6ad347
> [detached HEAD 1080d6a13b6d] Revert "kbuild: use KBUILD_DEFCONFIG as the
> fallback for DEFCONFIG_LIST"
>   5 files changed, 22 insertions(+), 1 deletion(-)
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
> *** Default configuration is based on 'defconfig'
> #
> # No change to .config
> #
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
> scripts/kconfig/conf  --syncconfig Kconfig
>    UPD     include/config/kernel.release
>    UPD     include/generated/utsrelease.h
>    CC      scripts/mod/empty.o
> ...
>
> $ aarch64-linux-gnu-gcc --version
> aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0
> Copyright (C) 2017 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> --->8---
>
> It looks that the issue is similar to the one described here:
>
> https://patchwork.kernel.org/patch/10453685/
>
> I hope this report helps fixing the issue.
>
> > ---
> >
> >   arch/sh/Kconfig     | 5 -----
> >   arch/sparc/Kconfig  | 5 -----
> >   arch/x86/Kconfig    | 5 -----
> >   arch/x86/um/Kconfig | 5 -----
> >   init/Kconfig        | 3 +--
> >   5 files changed, 1 insertion(+), 22 deletions(-)
> >
> > diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> > index 9ece111b0254..b4f0e37b83eb 100644
> > --- a/arch/sh/Kconfig
> > +++ b/arch/sh/Kconfig
> > @@ -87,11 +87,6 @@ config SUPERH64
> >       select HAVE_EXIT_THREAD
> >       select KALLSYMS
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/sh/configs/shx3_defconfig" if SUPERH32
> > -     default "arch/sh/configs/cayman_defconfig" if SUPERH64
> > -
> >   config GENERIC_BUG
> >       def_bool y
> >       depends on BUG && SUPERH32
> > diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
> > index c1dd6dd642f4..0de15380d1fc 100644
> > --- a/arch/sparc/Kconfig
> > +++ b/arch/sparc/Kconfig
> > @@ -95,11 +95,6 @@ config SPARC64
> >       select PCI_DOMAINS if PCI
> >       select ARCH_HAS_GIGANTIC_PAGE
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/sparc/configs/sparc32_defconfig" if SPARC32
> > -     default "arch/sparc/configs/sparc64_defconfig" if SPARC64
> > -
> >   config ARCH_PROC_KCORE_TEXT
> >       def_bool y
> >
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> > index beea77046f9b..98935f4387f9 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -240,11 +240,6 @@ config OUTPUT_FORMAT
> >       default "elf32-i386" if X86_32
> >       default "elf64-x86-64" if X86_64
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/x86/configs/i386_defconfig" if X86_32
> > -     default "arch/x86/configs/x86_64_defconfig" if X86_64
> > -
> >   config LOCKDEP_SUPPORT
> >       def_bool y
> >
> > diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
> > index a8985e1f7432..95d26a69088b 100644
> > --- a/arch/x86/um/Kconfig
> > +++ b/arch/x86/um/Kconfig
> > @@ -27,11 +27,6 @@ config X86_64
> >       def_bool 64BIT
> >       select MODULES_USE_ELF_RELA
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/um/configs/i386_defconfig" if X86_32
> > -     default "arch/um/configs/x86_64_defconfig" if X86_64
> > -
> >   config 3_LEVEL_PGTABLES
> >       bool "Three-level pagetables" if !64BIT
> >       default 64BIT
> > diff --git a/init/Kconfig b/init/Kconfig
> > index 452bc1835cd4..6ccdb168dee5 100644
> > --- a/init/Kconfig
> > +++ b/init/Kconfig
> > @@ -6,8 +6,7 @@ config DEFCONFIG_LIST
> >       default "/lib/modules/$(shell,uname -r)/.config"
> >       default "/etc/kernel-config"
> >       default "/boot/config-$(shell,uname -r)"
> > -     default ARCH_DEFCONFIG
> > -     default "arch/$(ARCH)/defconfig"
> > +     default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
> >
> >   config CC_IS_GCC
> >       def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
>
> Best regards
> --
> Marek Szyprowski, PhD
> Samsung R&D Institute Poland
>


-- 
Best Regards
Masahiro Yamada


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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-21  9:18       ` Masahiro Yamada
  0 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-02-21  9:18 UTC (permalink / raw)
  To: Marek Szyprowski
  Cc: Rich Felker, Linux-sh list, Catalin Marinas, Guo Ren,
	H. Peter Anvin, sparclinux, open list:SIFIVE DRIVERS,
	Vincent Chen, Will Deacon, Anton Ivanov, Yoshinori Sato,
	Richard Weinberger, X86 ML, Ingo Molnar, Albert Ou,
	Linux Kbuild mailing list, Jeff Dike, linux-um, Borislav Petkov,
	Greentime Hu, Paul Walmsley, Thomas Gleixner, linux-arm-kernel,
	Nick Hu, Linux Kernel Mailing List, Palmer Dabbelt,
	David S. Miller

On Fri, Feb 21, 2020 at 5:50 PM Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
>
> Dear All,
>
> On 16.02.2020 16:45, Masahiro Yamada wrote:
> > Most of the Kconfig commands (except defconfig and all*config) read the
> > .config file as a base set of CONFIG options.
> >
> > When it does not exist, the files in DEFCONFIG_LIST are searched in this
> > order and loaded if found.
> >
> > I do not see much sense in the last two entries in DEFCONFIG_LIST.
> >
> > [1] ARCH_DEFCONFIG
> >
> > The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
> > ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
> >
> > arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or 64
> > bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG should
> > be a fixed string because the base config file is loaded before the symbol
> > evaluation stage.
> >
> > Using KBUILD_DEFCONFIG is saner because it is fixed before Kconfig is
> > invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it in the
> > same way, and it works as expected. Hence, replace ARCH_DEFCONFIG with
> > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
> >
> > [2] arch/$(ARCH)/defconfig
> >
> > This file path is no longer valid. The defconfig files are always located
> > in the arch configs/ directories.
> >
> >    $ find arch -name defconfig | sort
> >    arch/alpha/configs/defconfig
> >    arch/arm64/configs/defconfig
> >    arch/csky/configs/defconfig
> >    arch/nds32/configs/defconfig
> >    arch/riscv/configs/defconfig
> >    arch/s390/configs/defconfig
> >    arch/unicore32/configs/defconfig
> >
> > The path arch/*/configs/defconfig is already covered by
> > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
> > not necessary.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>
> This patch landed in today's linux-next (next-20200221) and broke arm64
> builds:
>
> --->8---
>
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
> *** Default configuration is based on 'defconfig'
> #
> # configuration written to .config
> #
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> scripts/kconfig/conf  --syncconfig Kconfig
> ...
>
> (endless loop)
>
> --->8---
>
> Reverting it fixes the issue:



My bad.

This is because arch/arm64/Makefile does not define
KBUILD_DEFCONFIG.



I will drop it.

Sorry about that.





>
> --->8---
>
> $ git revert cdd5d1a207d6a3a06c9e627a0234d9a6af6ad347
> [detached HEAD 1080d6a13b6d] Revert "kbuild: use KBUILD_DEFCONFIG as the
> fallback for DEFCONFIG_LIST"
>   5 files changed, 22 insertions(+), 1 deletion(-)
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
> *** Default configuration is based on 'defconfig'
> #
> # No change to .config
> #
> $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
> scripts/kconfig/conf  --syncconfig Kconfig
>    UPD     include/config/kernel.release
>    UPD     include/generated/utsrelease.h
>    CC      scripts/mod/empty.o
> ...
>
> $ aarch64-linux-gnu-gcc --version
> aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0
> Copyright (C) 2017 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> --->8---
>
> It looks that the issue is similar to the one described here:
>
> https://patchwork.kernel.org/patch/10453685/
>
> I hope this report helps fixing the issue.
>
> > ---
> >
> >   arch/sh/Kconfig     | 5 -----
> >   arch/sparc/Kconfig  | 5 -----
> >   arch/x86/Kconfig    | 5 -----
> >   arch/x86/um/Kconfig | 5 -----
> >   init/Kconfig        | 3 +--
> >   5 files changed, 1 insertion(+), 22 deletions(-)
> >
> > diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> > index 9ece111b0254..b4f0e37b83eb 100644
> > --- a/arch/sh/Kconfig
> > +++ b/arch/sh/Kconfig
> > @@ -87,11 +87,6 @@ config SUPERH64
> >       select HAVE_EXIT_THREAD
> >       select KALLSYMS
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/sh/configs/shx3_defconfig" if SUPERH32
> > -     default "arch/sh/configs/cayman_defconfig" if SUPERH64
> > -
> >   config GENERIC_BUG
> >       def_bool y
> >       depends on BUG && SUPERH32
> > diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
> > index c1dd6dd642f4..0de15380d1fc 100644
> > --- a/arch/sparc/Kconfig
> > +++ b/arch/sparc/Kconfig
> > @@ -95,11 +95,6 @@ config SPARC64
> >       select PCI_DOMAINS if PCI
> >       select ARCH_HAS_GIGANTIC_PAGE
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/sparc/configs/sparc32_defconfig" if SPARC32
> > -     default "arch/sparc/configs/sparc64_defconfig" if SPARC64
> > -
> >   config ARCH_PROC_KCORE_TEXT
> >       def_bool y
> >
> > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> > index beea77046f9b..98935f4387f9 100644
> > --- a/arch/x86/Kconfig
> > +++ b/arch/x86/Kconfig
> > @@ -240,11 +240,6 @@ config OUTPUT_FORMAT
> >       default "elf32-i386" if X86_32
> >       default "elf64-x86-64" if X86_64
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/x86/configs/i386_defconfig" if X86_32
> > -     default "arch/x86/configs/x86_64_defconfig" if X86_64
> > -
> >   config LOCKDEP_SUPPORT
> >       def_bool y
> >
> > diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
> > index a8985e1f7432..95d26a69088b 100644
> > --- a/arch/x86/um/Kconfig
> > +++ b/arch/x86/um/Kconfig
> > @@ -27,11 +27,6 @@ config X86_64
> >       def_bool 64BIT
> >       select MODULES_USE_ELF_RELA
> >
> > -config ARCH_DEFCONFIG
> > -     string
> > -     default "arch/um/configs/i386_defconfig" if X86_32
> > -     default "arch/um/configs/x86_64_defconfig" if X86_64
> > -
> >   config 3_LEVEL_PGTABLES
> >       bool "Three-level pagetables" if !64BIT
> >       default 64BIT
> > diff --git a/init/Kconfig b/init/Kconfig
> > index 452bc1835cd4..6ccdb168dee5 100644
> > --- a/init/Kconfig
> > +++ b/init/Kconfig
> > @@ -6,8 +6,7 @@ config DEFCONFIG_LIST
> >       default "/lib/modules/$(shell,uname -r)/.config"
> >       default "/etc/kernel-config"
> >       default "/boot/config-$(shell,uname -r)"
> > -     default ARCH_DEFCONFIG
> > -     default "arch/$(ARCH)/defconfig"
> > +     default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
> >
> >   config CC_IS_GCC
> >       def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
>
> Best regards
> --
> Marek Szyprowski, PhD
> Samsung R&D Institute Poland
>


-- 
Best Regards
Masahiro Yamada

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
  2020-02-21  9:18       ` Masahiro Yamada
                           ` (2 preceding siblings ...)
  (?)
@ 2020-02-21  9:22         ` Will Deacon
  -1 siblings, 0 replies; 27+ messages in thread
From: Will Deacon @ 2020-02-21  9:22 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Rich Felker, Linux-sh list, Catalin Marinas, Guo Ren,
	H. Peter Anvin, sparclinux, open list:SIFIVE DRIVERS,
	Vincent Chen, Anton Ivanov, Yoshinori Sato, Richard Weinberger,
	X86 ML, Ingo Molnar, Marek Szyprowski, Albert Ou,
	Linux Kbuild mailing list, Jeff Dike, linux-um, Borislav Petkov,
	Greentime Hu, Paul Walmsley, Thomas Gleixner, linux-arm-kernel,
	Nick Hu, Linux Kernel Mailing List, Palmer Dabbelt,
	David S. Miller

On Fri, Feb 21, 2020 at 06:18:50PM +0900, Masahiro Yamada wrote:
> On Fri, Feb 21, 2020 at 5:50 PM Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
> > This patch landed in today's linux-next (next-20200221) and broke arm64
> > builds:
> >
> > --->8---
> >
> > $ make ARCH=arm64 CROSS_COMPILEªrch64-linux-gnu- defconfig
> > *** Default configuration is based on 'defconfig'
> > #
> > # configuration written to .config
> > #
> > $ make ARCH=arm64 CROSS_COMPILEªrch64-linux-gnu- Image.gz
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > ...
> >
> > (endless loop)
> >
> > --->8---
> >
> > Reverting it fixes the issue:
> 
> 
> 
> My bad.
> 
> This is because arch/arm64/Makefile does not define
> KBUILD_DEFCONFIG.
> 
> 
> 
> I will drop it.
> 
> Sorry about that.

Thanks, Masahiro.

Will

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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-21  9:22         ` Will Deacon
  0 siblings, 0 replies; 27+ messages in thread
From: Will Deacon @ 2020-02-21  9:22 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Marek Szyprowski, Linux Kbuild mailing list, X86 ML, sparclinux,
	Linux-sh list, linux-um, Linux Kernel Mailing List, Albert Ou,
	Anton Ivanov, Borislav Petkov, David S. Miller, Greentime Hu,
	Guo Ren, H. Peter Anvin, Ingo Molnar, Jeff Dike, Nick Hu,
	Palmer Dabbelt, Paul Walmsley, Rich Felker, Richard Weinberger,
	Thomas Gleixner, Vincent Chen, Yoshinori Sato,
	open list:SIFIVE DRIVERS, linux-arm-kernel, Catalin Marinas

On Fri, Feb 21, 2020 at 06:18:50PM +0900, Masahiro Yamada wrote:
> On Fri, Feb 21, 2020 at 5:50 PM Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
> > This patch landed in today's linux-next (next-20200221) and broke arm64
> > builds:
> >
> > --->8---
> >
> > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
> > *** Default configuration is based on 'defconfig'
> > #
> > # configuration written to .config
> > #
> > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > ...
> >
> > (endless loop)
> >
> > --->8---
> >
> > Reverting it fixes the issue:
> 
> 
> 
> My bad.
> 
> This is because arch/arm64/Makefile does not define
> KBUILD_DEFCONFIG.
> 
> 
> 
> I will drop it.
> 
> Sorry about that.

Thanks, Masahiro.

Will

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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-21  9:22         ` Will Deacon
  0 siblings, 0 replies; 27+ messages in thread
From: Will Deacon @ 2020-02-21  9:22 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Marek Szyprowski, Linux Kbuild mailing list, X86 ML, sparclinux,
	Linux-sh list, linux-um, Linux Kernel Mailing List, Albert Ou,
	Anton Ivanov, Borislav Petkov, David S. Miller, Greentime Hu,
	Guo Ren, H. Peter Anvin, Ingo Molnar, Jeff Dike, Nick Hu,
	Palmer Dabbelt, Paul Walmsley, Rich Felker, Richard Weinberger,
	Thomas Gleixner, Vincent Chen, Yoshinori Sato,
	open list:SIFIVE DRIVERS, linux-arm-kernel, Catalin Marinas

On Fri, Feb 21, 2020 at 06:18:50PM +0900, Masahiro Yamada wrote:
> On Fri, Feb 21, 2020 at 5:50 PM Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
> > This patch landed in today's linux-next (next-20200221) and broke arm64
> > builds:
> >
> > --->8---
> >
> > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
> > *** Default configuration is based on 'defconfig'
> > #
> > # configuration written to .config
> > #
> > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > ...
> >
> > (endless loop)
> >
> > --->8---
> >
> > Reverting it fixes the issue:
> 
> 
> 
> My bad.
> 
> This is because arch/arm64/Makefile does not define
> KBUILD_DEFCONFIG.
> 
> 
> 
> I will drop it.
> 
> Sorry about that.

Thanks, Masahiro.

Will

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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-21  9:22         ` Will Deacon
  0 siblings, 0 replies; 27+ messages in thread
From: Will Deacon @ 2020-02-21  9:22 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Rich Felker, Linux-sh list, Catalin Marinas, Guo Ren,
	H. Peter Anvin, sparclinux, open list:SIFIVE DRIVERS,
	Vincent Chen, Anton Ivanov, Yoshinori Sato, Richard Weinberger,
	X86 ML, Ingo Molnar, Marek Szyprowski, Albert Ou,
	Linux Kbuild mailing list, Jeff Dike, linux-um, Borislav Petkov,
	Greentime Hu, Paul Walmsley, Thomas Gleixner, linux-arm-kernel,
	Nick Hu, Linux Kernel Mailing List, Palmer Dabbelt,
	David S. Miller

On Fri, Feb 21, 2020 at 06:18:50PM +0900, Masahiro Yamada wrote:
> On Fri, Feb 21, 2020 at 5:50 PM Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
> > This patch landed in today's linux-next (next-20200221) and broke arm64
> > builds:
> >
> > --->8---
> >
> > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
> > *** Default configuration is based on 'defconfig'
> > #
> > # configuration written to .config
> > #
> > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > ...
> >
> > (endless loop)
> >
> > --->8---
> >
> > Reverting it fixes the issue:
> 
> 
> 
> My bad.
> 
> This is because arch/arm64/Makefile does not define
> KBUILD_DEFCONFIG.
> 
> 
> 
> I will drop it.
> 
> Sorry about that.

Thanks, Masahiro.

Will


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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-21  9:22         ` Will Deacon
  0 siblings, 0 replies; 27+ messages in thread
From: Will Deacon @ 2020-02-21  9:22 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Rich Felker, Linux-sh list, Catalin Marinas, Guo Ren,
	H. Peter Anvin, sparclinux, open list:SIFIVE DRIVERS,
	Vincent Chen, Anton Ivanov, Yoshinori Sato, Richard Weinberger,
	X86 ML, Ingo Molnar, Marek Szyprowski, Albert Ou,
	Linux Kbuild mailing list, Jeff Dike, linux-um, Borislav Petkov,
	Greentime Hu, Paul Walmsley, Thomas Gleixner, linux-arm-kernel,
	Nick Hu, Linux Kernel Mailing List, Palmer Dabbelt,
	David S. Miller

On Fri, Feb 21, 2020 at 06:18:50PM +0900, Masahiro Yamada wrote:
> On Fri, Feb 21, 2020 at 5:50 PM Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
> > This patch landed in today's linux-next (next-20200221) and broke arm64
> > builds:
> >
> > --->8---
> >
> > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
> > *** Default configuration is based on 'defconfig'
> > #
> > # configuration written to .config
> > #
> > $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > scripts/kconfig/conf  --syncconfig Kconfig
> > ...
> >
> > (endless loop)
> >
> > --->8---
> >
> > Reverting it fixes the issue:
> 
> 
> 
> My bad.
> 
> This is because arch/arm64/Makefile does not define
> KBUILD_DEFCONFIG.
> 
> 
> 
> I will drop it.
> 
> Sorry about that.

Thanks, Masahiro.

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
  2020-02-16 15:45 ` Masahiro Yamada
  (?)
@ 2020-02-28  3:46 ` Masahiro Yamada
  -1 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-02-28  3:46 UTC (permalink / raw)
  To: linux-kbuild; +Cc: linux-kernel, x86, linux-um, sparclinux, Masahiro Yamada

Most of the Kconfig commands (except defconfig and all*config) read
the .config file as a base set of CONFIG options.

When it does not exist, the files in DEFCONFIG_LIST are searched in
this order and loaded if found.

I do not see much sense in the last two lines in DEFCONFIG_LIST.

[1] ARCH_DEFCONFIG

The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.

arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or
64 bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG
should be a fixed string because the base config file is loaded before
the symbol evaluation stage.

Using KBUILD_DEFCONFIG makes more sense because it is fixed before
Kconfig is invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it
in the same way, and it works as expected. Hence, replace ARCH_DEFCONFIG
with "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".

[2] arch/$(ARCH)/defconfig

This file path is no longer valid. The defconfig files are always located
in the arch configs/ directories.

  $ find arch -name defconfig | sort
  arch/alpha/configs/defconfig
  arch/arm64/configs/defconfig
  arch/csky/configs/defconfig
  arch/nds32/configs/defconfig
  arch/riscv/configs/defconfig
  arch/s390/configs/defconfig
  arch/unicore32/configs/defconfig

The path arch/*/configs/defconfig is already covered by
"arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
not necessary.

I moved the default KBUILD_DEFCONFIG to the top Makefile. Otherwise,
the 7 architectures listed above would end up with endless loop of
syncconfig.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 Makefile                 | 3 +++
 arch/sh/Kconfig          | 5 -----
 arch/sparc/Kconfig       | 5 -----
 arch/x86/Kconfig         | 5 -----
 arch/x86/um/Kconfig      | 5 -----
 init/Kconfig             | 3 +--
 scripts/kconfig/Makefile | 4 ----
 7 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/Makefile b/Makefile
index 81d130ad9534..17cc09304561 100644
--- a/Makefile
+++ b/Makefile
@@ -388,6 +388,9 @@ endif
 KCONFIG_CONFIG	?= .config
 export KCONFIG_CONFIG
 
+# Default file for 'make defconfig'. This may be overridden by arch-Makefile.
+export KBUILD_DEFCONFIG := defconfig
+
 # SHELL used by kbuild
 CONFIG_SHELL := sh
 
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 9ece111b0254..b4f0e37b83eb 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -87,11 +87,6 @@ config SUPERH64
 	select HAVE_EXIT_THREAD
 	select KALLSYMS
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/sh/configs/shx3_defconfig" if SUPERH32
-	default "arch/sh/configs/cayman_defconfig" if SUPERH64
-
 config GENERIC_BUG
 	def_bool y
 	depends on BUG && SUPERH32
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index c1dd6dd642f4..0de15380d1fc 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -95,11 +95,6 @@ config SPARC64
 	select PCI_DOMAINS if PCI
 	select ARCH_HAS_GIGANTIC_PAGE
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/sparc/configs/sparc32_defconfig" if SPARC32
-	default "arch/sparc/configs/sparc64_defconfig" if SPARC64
-
 config ARCH_PROC_KCORE_TEXT
 	def_bool y
 
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index beea77046f9b..98935f4387f9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -240,11 +240,6 @@ config OUTPUT_FORMAT
 	default "elf32-i386" if X86_32
 	default "elf64-x86-64" if X86_64
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/x86/configs/i386_defconfig" if X86_32
-	default "arch/x86/configs/x86_64_defconfig" if X86_64
-
 config LOCKDEP_SUPPORT
 	def_bool y
 
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index a8985e1f7432..95d26a69088b 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -27,11 +27,6 @@ config X86_64
 	def_bool 64BIT
 	select MODULES_USE_ELF_RELA
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/um/configs/i386_defconfig" if X86_32
-	default "arch/um/configs/x86_64_defconfig" if X86_64
-
 config 3_LEVEL_PGTABLES
 	bool "Three-level pagetables" if !64BIT
 	default 64BIT
diff --git a/init/Kconfig b/init/Kconfig
index 20a6ac33761c..240c1ed15c69 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -6,8 +6,7 @@ config DEFCONFIG_LIST
 	default "/lib/modules/$(shell,uname -r)/.config"
 	default "/etc/kernel-config"
 	default "/boot/config-$(shell,uname -r)"
-	default ARCH_DEFCONFIG
-	default "arch/$(ARCH)/defconfig"
+	default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
 
 config CC_IS_GCC
 	def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 5887ceb6229e..c9d0a4a8efb3 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -12,10 +12,6 @@ else
 Kconfig := Kconfig
 endif
 
-ifndef KBUILD_DEFCONFIG
-KBUILD_DEFCONFIG := defconfig
-endif
-
 ifeq ($(quiet),silent_)
 silent := -s
 endif
-- 
2.17.1


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

* [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-28  3:46 ` Masahiro Yamada
  0 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-02-28  3:46 UTC (permalink / raw)
  To: linux-kbuild; +Cc: linux-kernel, x86, linux-um, sparclinux, Masahiro Yamada

Most of the Kconfig commands (except defconfig and all*config) read
the .config file as a base set of CONFIG options.

When it does not exist, the files in DEFCONFIG_LIST are searched in
this order and loaded if found.

I do not see much sense in the last two lines in DEFCONFIG_LIST.

[1] ARCH_DEFCONFIG

The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.

arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or
64 bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG
should be a fixed string because the base config file is loaded before
the symbol evaluation stage.

Using KBUILD_DEFCONFIG makes more sense because it is fixed before
Kconfig is invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it
in the same way, and it works as expected. Hence, replace ARCH_DEFCONFIG
with "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".

[2] arch/$(ARCH)/defconfig

This file path is no longer valid. The defconfig files are always located
in the arch configs/ directories.

  $ find arch -name defconfig | sort
  arch/alpha/configs/defconfig
  arch/arm64/configs/defconfig
  arch/csky/configs/defconfig
  arch/nds32/configs/defconfig
  arch/riscv/configs/defconfig
  arch/s390/configs/defconfig
  arch/unicore32/configs/defconfig

The path arch/*/configs/defconfig is already covered by
"arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
not necessary.

I moved the default KBUILD_DEFCONFIG to the top Makefile. Otherwise,
the 7 architectures listed above would end up with endless loop of
syncconfig.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 Makefile                 | 3 +++
 arch/sh/Kconfig          | 5 -----
 arch/sparc/Kconfig       | 5 -----
 arch/x86/Kconfig         | 5 -----
 arch/x86/um/Kconfig      | 5 -----
 init/Kconfig             | 3 +--
 scripts/kconfig/Makefile | 4 ----
 7 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/Makefile b/Makefile
index 81d130ad9534..17cc09304561 100644
--- a/Makefile
+++ b/Makefile
@@ -388,6 +388,9 @@ endif
 KCONFIG_CONFIG	?= .config
 export KCONFIG_CONFIG
 
+# Default file for 'make defconfig'. This may be overridden by arch-Makefile.
+export KBUILD_DEFCONFIG := defconfig
+
 # SHELL used by kbuild
 CONFIG_SHELL := sh
 
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 9ece111b0254..b4f0e37b83eb 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -87,11 +87,6 @@ config SUPERH64
 	select HAVE_EXIT_THREAD
 	select KALLSYMS
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/sh/configs/shx3_defconfig" if SUPERH32
-	default "arch/sh/configs/cayman_defconfig" if SUPERH64
-
 config GENERIC_BUG
 	def_bool y
 	depends on BUG && SUPERH32
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index c1dd6dd642f4..0de15380d1fc 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -95,11 +95,6 @@ config SPARC64
 	select PCI_DOMAINS if PCI
 	select ARCH_HAS_GIGANTIC_PAGE
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/sparc/configs/sparc32_defconfig" if SPARC32
-	default "arch/sparc/configs/sparc64_defconfig" if SPARC64
-
 config ARCH_PROC_KCORE_TEXT
 	def_bool y
 
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index beea77046f9b..98935f4387f9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -240,11 +240,6 @@ config OUTPUT_FORMAT
 	default "elf32-i386" if X86_32
 	default "elf64-x86-64" if X86_64
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/x86/configs/i386_defconfig" if X86_32
-	default "arch/x86/configs/x86_64_defconfig" if X86_64
-
 config LOCKDEP_SUPPORT
 	def_bool y
 
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index a8985e1f7432..95d26a69088b 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -27,11 +27,6 @@ config X86_64
 	def_bool 64BIT
 	select MODULES_USE_ELF_RELA
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/um/configs/i386_defconfig" if X86_32
-	default "arch/um/configs/x86_64_defconfig" if X86_64
-
 config 3_LEVEL_PGTABLES
 	bool "Three-level pagetables" if !64BIT
 	default 64BIT
diff --git a/init/Kconfig b/init/Kconfig
index 20a6ac33761c..240c1ed15c69 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -6,8 +6,7 @@ config DEFCONFIG_LIST
 	default "/lib/modules/$(shell,uname -r)/.config"
 	default "/etc/kernel-config"
 	default "/boot/config-$(shell,uname -r)"
-	default ARCH_DEFCONFIG
-	default "arch/$(ARCH)/defconfig"
+	default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
 
 config CC_IS_GCC
 	def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 5887ceb6229e..c9d0a4a8efb3 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -12,10 +12,6 @@ else
 Kconfig := Kconfig
 endif
 
-ifndef KBUILD_DEFCONFIG
-KBUILD_DEFCONFIG := defconfig
-endif
-
 ifeq ($(quiet),silent_)
 silent := -s
 endif
-- 
2.17.1

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

* [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-28  3:46 ` Masahiro Yamada
  0 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-02-28  3:46 UTC (permalink / raw)
  To: linux-kbuild; +Cc: sparclinux, Masahiro Yamada, x86, linux-um, linux-kernel

Most of the Kconfig commands (except defconfig and all*config) read
the .config file as a base set of CONFIG options.

When it does not exist, the files in DEFCONFIG_LIST are searched in
this order and loaded if found.

I do not see much sense in the last two lines in DEFCONFIG_LIST.

[1] ARCH_DEFCONFIG

The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.

arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or
64 bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG
should be a fixed string because the base config file is loaded before
the symbol evaluation stage.

Using KBUILD_DEFCONFIG makes more sense because it is fixed before
Kconfig is invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it
in the same way, and it works as expected. Hence, replace ARCH_DEFCONFIG
with "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".

[2] arch/$(ARCH)/defconfig

This file path is no longer valid. The defconfig files are always located
in the arch configs/ directories.

  $ find arch -name defconfig | sort
  arch/alpha/configs/defconfig
  arch/arm64/configs/defconfig
  arch/csky/configs/defconfig
  arch/nds32/configs/defconfig
  arch/riscv/configs/defconfig
  arch/s390/configs/defconfig
  arch/unicore32/configs/defconfig

The path arch/*/configs/defconfig is already covered by
"arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
not necessary.

I moved the default KBUILD_DEFCONFIG to the top Makefile. Otherwise,
the 7 architectures listed above would end up with endless loop of
syncconfig.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 Makefile                 | 3 +++
 arch/sh/Kconfig          | 5 -----
 arch/sparc/Kconfig       | 5 -----
 arch/x86/Kconfig         | 5 -----
 arch/x86/um/Kconfig      | 5 -----
 init/Kconfig             | 3 +--
 scripts/kconfig/Makefile | 4 ----
 7 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/Makefile b/Makefile
index 81d130ad9534..17cc09304561 100644
--- a/Makefile
+++ b/Makefile
@@ -388,6 +388,9 @@ endif
 KCONFIG_CONFIG	?= .config
 export KCONFIG_CONFIG
 
+# Default file for 'make defconfig'. This may be overridden by arch-Makefile.
+export KBUILD_DEFCONFIG := defconfig
+
 # SHELL used by kbuild
 CONFIG_SHELL := sh
 
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 9ece111b0254..b4f0e37b83eb 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -87,11 +87,6 @@ config SUPERH64
 	select HAVE_EXIT_THREAD
 	select KALLSYMS
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/sh/configs/shx3_defconfig" if SUPERH32
-	default "arch/sh/configs/cayman_defconfig" if SUPERH64
-
 config GENERIC_BUG
 	def_bool y
 	depends on BUG && SUPERH32
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index c1dd6dd642f4..0de15380d1fc 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -95,11 +95,6 @@ config SPARC64
 	select PCI_DOMAINS if PCI
 	select ARCH_HAS_GIGANTIC_PAGE
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/sparc/configs/sparc32_defconfig" if SPARC32
-	default "arch/sparc/configs/sparc64_defconfig" if SPARC64
-
 config ARCH_PROC_KCORE_TEXT
 	def_bool y
 
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index beea77046f9b..98935f4387f9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -240,11 +240,6 @@ config OUTPUT_FORMAT
 	default "elf32-i386" if X86_32
 	default "elf64-x86-64" if X86_64
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/x86/configs/i386_defconfig" if X86_32
-	default "arch/x86/configs/x86_64_defconfig" if X86_64
-
 config LOCKDEP_SUPPORT
 	def_bool y
 
diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
index a8985e1f7432..95d26a69088b 100644
--- a/arch/x86/um/Kconfig
+++ b/arch/x86/um/Kconfig
@@ -27,11 +27,6 @@ config X86_64
 	def_bool 64BIT
 	select MODULES_USE_ELF_RELA
 
-config ARCH_DEFCONFIG
-	string
-	default "arch/um/configs/i386_defconfig" if X86_32
-	default "arch/um/configs/x86_64_defconfig" if X86_64
-
 config 3_LEVEL_PGTABLES
 	bool "Three-level pagetables" if !64BIT
 	default 64BIT
diff --git a/init/Kconfig b/init/Kconfig
index 20a6ac33761c..240c1ed15c69 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -6,8 +6,7 @@ config DEFCONFIG_LIST
 	default "/lib/modules/$(shell,uname -r)/.config"
 	default "/etc/kernel-config"
 	default "/boot/config-$(shell,uname -r)"
-	default ARCH_DEFCONFIG
-	default "arch/$(ARCH)/defconfig"
+	default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
 
 config CC_IS_GCC
 	def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 5887ceb6229e..c9d0a4a8efb3 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -12,10 +12,6 @@ else
 Kconfig := Kconfig
 endif
 
-ifndef KBUILD_DEFCONFIG
-KBUILD_DEFCONFIG := defconfig
-endif
-
 ifeq ($(quiet),silent_)
 silent := -s
 endif
-- 
2.17.1


_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
  2020-02-28  3:46 ` Masahiro Yamada
@ 2020-02-28  3:48   ` Masahiro Yamada
  -1 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-02-28  3:48 UTC (permalink / raw)
  To: Linux Kbuild mailing list
  Cc: Linux Kernel Mailing List, X86 ML, linux-um, sparclinux

On Fri, Feb 28, 2020 at 12:47 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> Most of the Kconfig commands (except defconfig and all*config) read
> the .config file as a base set of CONFIG options.
>
> When it does not exist, the files in DEFCONFIG_LIST are searched in
> this order and loaded if found.
>
> I do not see much sense in the last two lines in DEFCONFIG_LIST.
>
> [1] ARCH_DEFCONFIG
>
> The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
> ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
>
> arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or
> 64 bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG
> should be a fixed string because the base config file is loaded before
> the symbol evaluation stage.
>
> Using KBUILD_DEFCONFIG makes more sense because it is fixed before
> Kconfig is invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it
> in the same way, and it works as expected. Hence, replace ARCH_DEFCONFIG
> with "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
>
> [2] arch/$(ARCH)/defconfig
>
> This file path is no longer valid. The defconfig files are always located
> in the arch configs/ directories.
>
>   $ find arch -name defconfig | sort
>   arch/alpha/configs/defconfig
>   arch/arm64/configs/defconfig
>   arch/csky/configs/defconfig
>   arch/nds32/configs/defconfig
>   arch/riscv/configs/defconfig
>   arch/s390/configs/defconfig
>   arch/unicore32/configs/defconfig
>
> The path arch/*/configs/defconfig is already covered by
> "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
> not necessary.
>
> I moved the default KBUILD_DEFCONFIG to the top Makefile. Otherwise,
> the 7 architectures listed above would end up with endless loop of
> syncconfig.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


I forgot to say this.
This is v2.

Changes in v2:
  - Move KBUILD_DEFCONFIG to fix endless loop of syncconfig


> ---
>
>  Makefile                 | 3 +++
>  arch/sh/Kconfig          | 5 -----
>  arch/sparc/Kconfig       | 5 -----
>  arch/x86/Kconfig         | 5 -----
>  arch/x86/um/Kconfig      | 5 -----
>  init/Kconfig             | 3 +--
>  scripts/kconfig/Makefile | 4 ----
>  7 files changed, 4 insertions(+), 26 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 81d130ad9534..17cc09304561 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -388,6 +388,9 @@ endif
>  KCONFIG_CONFIG ?= .config
>  export KCONFIG_CONFIG
>
> +# Default file for 'make defconfig'. This may be overridden by arch-Makefile.
> +export KBUILD_DEFCONFIG := defconfig
> +
>  # SHELL used by kbuild
>  CONFIG_SHELL := sh
>
> diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> index 9ece111b0254..b4f0e37b83eb 100644
> --- a/arch/sh/Kconfig
> +++ b/arch/sh/Kconfig
> @@ -87,11 +87,6 @@ config SUPERH64
>         select HAVE_EXIT_THREAD
>         select KALLSYMS
>
> -config ARCH_DEFCONFIG
> -       string
> -       default "arch/sh/configs/shx3_defconfig" if SUPERH32
> -       default "arch/sh/configs/cayman_defconfig" if SUPERH64
> -
>  config GENERIC_BUG
>         def_bool y
>         depends on BUG && SUPERH32
> diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
> index c1dd6dd642f4..0de15380d1fc 100644
> --- a/arch/sparc/Kconfig
> +++ b/arch/sparc/Kconfig
> @@ -95,11 +95,6 @@ config SPARC64
>         select PCI_DOMAINS if PCI
>         select ARCH_HAS_GIGANTIC_PAGE
>
> -config ARCH_DEFCONFIG
> -       string
> -       default "arch/sparc/configs/sparc32_defconfig" if SPARC32
> -       default "arch/sparc/configs/sparc64_defconfig" if SPARC64
> -
>  config ARCH_PROC_KCORE_TEXT
>         def_bool y
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index beea77046f9b..98935f4387f9 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -240,11 +240,6 @@ config OUTPUT_FORMAT
>         default "elf32-i386" if X86_32
>         default "elf64-x86-64" if X86_64
>
> -config ARCH_DEFCONFIG
> -       string
> -       default "arch/x86/configs/i386_defconfig" if X86_32
> -       default "arch/x86/configs/x86_64_defconfig" if X86_64
> -
>  config LOCKDEP_SUPPORT
>         def_bool y
>
> diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
> index a8985e1f7432..95d26a69088b 100644
> --- a/arch/x86/um/Kconfig
> +++ b/arch/x86/um/Kconfig
> @@ -27,11 +27,6 @@ config X86_64
>         def_bool 64BIT
>         select MODULES_USE_ELF_RELA
>
> -config ARCH_DEFCONFIG
> -       string
> -       default "arch/um/configs/i386_defconfig" if X86_32
> -       default "arch/um/configs/x86_64_defconfig" if X86_64
> -
>  config 3_LEVEL_PGTABLES
>         bool "Three-level pagetables" if !64BIT
>         default 64BIT
> diff --git a/init/Kconfig b/init/Kconfig
> index 20a6ac33761c..240c1ed15c69 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -6,8 +6,7 @@ config DEFCONFIG_LIST
>         default "/lib/modules/$(shell,uname -r)/.config"
>         default "/etc/kernel-config"
>         default "/boot/config-$(shell,uname -r)"
> -       default ARCH_DEFCONFIG
> -       default "arch/$(ARCH)/defconfig"
> +       default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
>
>  config CC_IS_GCC
>         def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
> diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
> index 5887ceb6229e..c9d0a4a8efb3 100644
> --- a/scripts/kconfig/Makefile
> +++ b/scripts/kconfig/Makefile
> @@ -12,10 +12,6 @@ else
>  Kconfig := Kconfig
>  endif
>
> -ifndef KBUILD_DEFCONFIG
> -KBUILD_DEFCONFIG := defconfig
> -endif
> -
>  ifeq ($(quiet),silent_)
>  silent := -s
>  endif
> --
> 2.17.1
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-02-28  3:48   ` Masahiro Yamada
  0 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-02-28  3:48 UTC (permalink / raw)
  To: Linux Kbuild mailing list
  Cc: Linux Kernel Mailing List, X86 ML, linux-um, sparclinux

On Fri, Feb 28, 2020 at 12:47 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> Most of the Kconfig commands (except defconfig and all*config) read
> the .config file as a base set of CONFIG options.
>
> When it does not exist, the files in DEFCONFIG_LIST are searched in
> this order and loaded if found.
>
> I do not see much sense in the last two lines in DEFCONFIG_LIST.
>
> [1] ARCH_DEFCONFIG
>
> The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
> ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
>
> arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or
> 64 bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG
> should be a fixed string because the base config file is loaded before
> the symbol evaluation stage.
>
> Using KBUILD_DEFCONFIG makes more sense because it is fixed before
> Kconfig is invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it
> in the same way, and it works as expected. Hence, replace ARCH_DEFCONFIG
> with "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
>
> [2] arch/$(ARCH)/defconfig
>
> This file path is no longer valid. The defconfig files are always located
> in the arch configs/ directories.
>
>   $ find arch -name defconfig | sort
>   arch/alpha/configs/defconfig
>   arch/arm64/configs/defconfig
>   arch/csky/configs/defconfig
>   arch/nds32/configs/defconfig
>   arch/riscv/configs/defconfig
>   arch/s390/configs/defconfig
>   arch/unicore32/configs/defconfig
>
> The path arch/*/configs/defconfig is already covered by
> "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
> not necessary.
>
> I moved the default KBUILD_DEFCONFIG to the top Makefile. Otherwise,
> the 7 architectures listed above would end up with endless loop of
> syncconfig.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


I forgot to say this.
This is v2.

Changes in v2:
  - Move KBUILD_DEFCONFIG to fix endless loop of syncconfig


> ---
>
>  Makefile                 | 3 +++
>  arch/sh/Kconfig          | 5 -----
>  arch/sparc/Kconfig       | 5 -----
>  arch/x86/Kconfig         | 5 -----
>  arch/x86/um/Kconfig      | 5 -----
>  init/Kconfig             | 3 +--
>  scripts/kconfig/Makefile | 4 ----
>  7 files changed, 4 insertions(+), 26 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 81d130ad9534..17cc09304561 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -388,6 +388,9 @@ endif
>  KCONFIG_CONFIG ?= .config
>  export KCONFIG_CONFIG
>
> +# Default file for 'make defconfig'. This may be overridden by arch-Makefile.
> +export KBUILD_DEFCONFIG := defconfig
> +
>  # SHELL used by kbuild
>  CONFIG_SHELL := sh
>
> diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
> index 9ece111b0254..b4f0e37b83eb 100644
> --- a/arch/sh/Kconfig
> +++ b/arch/sh/Kconfig
> @@ -87,11 +87,6 @@ config SUPERH64
>         select HAVE_EXIT_THREAD
>         select KALLSYMS
>
> -config ARCH_DEFCONFIG
> -       string
> -       default "arch/sh/configs/shx3_defconfig" if SUPERH32
> -       default "arch/sh/configs/cayman_defconfig" if SUPERH64
> -
>  config GENERIC_BUG
>         def_bool y
>         depends on BUG && SUPERH32
> diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
> index c1dd6dd642f4..0de15380d1fc 100644
> --- a/arch/sparc/Kconfig
> +++ b/arch/sparc/Kconfig
> @@ -95,11 +95,6 @@ config SPARC64
>         select PCI_DOMAINS if PCI
>         select ARCH_HAS_GIGANTIC_PAGE
>
> -config ARCH_DEFCONFIG
> -       string
> -       default "arch/sparc/configs/sparc32_defconfig" if SPARC32
> -       default "arch/sparc/configs/sparc64_defconfig" if SPARC64
> -
>  config ARCH_PROC_KCORE_TEXT
>         def_bool y
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index beea77046f9b..98935f4387f9 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -240,11 +240,6 @@ config OUTPUT_FORMAT
>         default "elf32-i386" if X86_32
>         default "elf64-x86-64" if X86_64
>
> -config ARCH_DEFCONFIG
> -       string
> -       default "arch/x86/configs/i386_defconfig" if X86_32
> -       default "arch/x86/configs/x86_64_defconfig" if X86_64
> -
>  config LOCKDEP_SUPPORT
>         def_bool y
>
> diff --git a/arch/x86/um/Kconfig b/arch/x86/um/Kconfig
> index a8985e1f7432..95d26a69088b 100644
> --- a/arch/x86/um/Kconfig
> +++ b/arch/x86/um/Kconfig
> @@ -27,11 +27,6 @@ config X86_64
>         def_bool 64BIT
>         select MODULES_USE_ELF_RELA
>
> -config ARCH_DEFCONFIG
> -       string
> -       default "arch/um/configs/i386_defconfig" if X86_32
> -       default "arch/um/configs/x86_64_defconfig" if X86_64
> -
>  config 3_LEVEL_PGTABLES
>         bool "Three-level pagetables" if !64BIT
>         default 64BIT
> diff --git a/init/Kconfig b/init/Kconfig
> index 20a6ac33761c..240c1ed15c69 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -6,8 +6,7 @@ config DEFCONFIG_LIST
>         default "/lib/modules/$(shell,uname -r)/.config"
>         default "/etc/kernel-config"
>         default "/boot/config-$(shell,uname -r)"
> -       default ARCH_DEFCONFIG
> -       default "arch/$(ARCH)/defconfig"
> +       default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
>
>  config CC_IS_GCC
>         def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
> diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
> index 5887ceb6229e..c9d0a4a8efb3 100644
> --- a/scripts/kconfig/Makefile
> +++ b/scripts/kconfig/Makefile
> @@ -12,10 +12,6 @@ else
>  Kconfig := Kconfig
>  endif
>
> -ifndef KBUILD_DEFCONFIG
> -KBUILD_DEFCONFIG := defconfig
> -endif
> -
>  ifeq ($(quiet),silent_)
>  silent := -s
>  endif
> --
> 2.17.1
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
  2020-02-28  3:48   ` Masahiro Yamada
  (?)
@ 2020-03-03 13:46     ` Masahiro Yamada
  -1 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-03-03 13:46 UTC (permalink / raw)
  To: Linux Kbuild mailing list
  Cc: Linux Kernel Mailing List, X86 ML, linux-um, sparclinux

On Fri, Feb 28, 2020 at 12:48 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Fri, Feb 28, 2020 at 12:47 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > Most of the Kconfig commands (except defconfig and all*config) read
> > the .config file as a base set of CONFIG options.
> >
> > When it does not exist, the files in DEFCONFIG_LIST are searched in
> > this order and loaded if found.
> >
> > I do not see much sense in the last two lines in DEFCONFIG_LIST.
> >
> > [1] ARCH_DEFCONFIG
> >
> > The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
> > ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
> >
> > arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or
> > 64 bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG
> > should be a fixed string because the base config file is loaded before
> > the symbol evaluation stage.
> >
> > Using KBUILD_DEFCONFIG makes more sense because it is fixed before
> > Kconfig is invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it
> > in the same way, and it works as expected. Hence, replace ARCH_DEFCONFIG
> > with "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
> >
> > [2] arch/$(ARCH)/defconfig
> >
> > This file path is no longer valid. The defconfig files are always located
> > in the arch configs/ directories.
> >
> >   $ find arch -name defconfig | sort
> >   arch/alpha/configs/defconfig
> >   arch/arm64/configs/defconfig
> >   arch/csky/configs/defconfig
> >   arch/nds32/configs/defconfig
> >   arch/riscv/configs/defconfig
> >   arch/s390/configs/defconfig
> >   arch/unicore32/configs/defconfig
> >
> > The path arch/*/configs/defconfig is already covered by
> > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
> > not necessary.
> >
> > I moved the default KBUILD_DEFCONFIG to the top Makefile. Otherwise,
> > the 7 architectures listed above would end up with endless loop of
> > syncconfig.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>
>
> I forgot to say this.
> This is v2.
>
> Changes in v2:
>   - Move KBUILD_DEFCONFIG to fix endless loop of syncconfig
>
>

Applied to linux-kbuild.


Best Regards
Masahiro Yamada

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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-03-03 13:46     ` Masahiro Yamada
  0 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-03-03 13:46 UTC (permalink / raw)
  To: Linux Kbuild mailing list
  Cc: Linux Kernel Mailing List, X86 ML, linux-um, sparclinux

On Fri, Feb 28, 2020 at 12:48 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Fri, Feb 28, 2020 at 12:47 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > Most of the Kconfig commands (except defconfig and all*config) read
> > the .config file as a base set of CONFIG options.
> >
> > When it does not exist, the files in DEFCONFIG_LIST are searched in
> > this order and loaded if found.
> >
> > I do not see much sense in the last two lines in DEFCONFIG_LIST.
> >
> > [1] ARCH_DEFCONFIG
> >
> > The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
> > ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
> >
> > arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or
> > 64 bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG
> > should be a fixed string because the base config file is loaded before
> > the symbol evaluation stage.
> >
> > Using KBUILD_DEFCONFIG makes more sense because it is fixed before
> > Kconfig is invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it
> > in the same way, and it works as expected. Hence, replace ARCH_DEFCONFIG
> > with "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
> >
> > [2] arch/$(ARCH)/defconfig
> >
> > This file path is no longer valid. The defconfig files are always located
> > in the arch configs/ directories.
> >
> >   $ find arch -name defconfig | sort
> >   arch/alpha/configs/defconfig
> >   arch/arm64/configs/defconfig
> >   arch/csky/configs/defconfig
> >   arch/nds32/configs/defconfig
> >   arch/riscv/configs/defconfig
> >   arch/s390/configs/defconfig
> >   arch/unicore32/configs/defconfig
> >
> > The path arch/*/configs/defconfig is already covered by
> > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
> > not necessary.
> >
> > I moved the default KBUILD_DEFCONFIG to the top Makefile. Otherwise,
> > the 7 architectures listed above would end up with endless loop of
> > syncconfig.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>
>
> I forgot to say this.
> This is v2.
>
> Changes in v2:
>   - Move KBUILD_DEFCONFIG to fix endless loop of syncconfig
>
>

Applied to linux-kbuild.


Best Regards
Masahiro Yamada

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

* Re: [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST
@ 2020-03-03 13:46     ` Masahiro Yamada
  0 siblings, 0 replies; 27+ messages in thread
From: Masahiro Yamada @ 2020-03-03 13:46 UTC (permalink / raw)
  To: Linux Kbuild mailing list
  Cc: sparclinux, X86 ML, linux-um, Linux Kernel Mailing List

On Fri, Feb 28, 2020 at 12:48 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Fri, Feb 28, 2020 at 12:47 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > Most of the Kconfig commands (except defconfig and all*config) read
> > the .config file as a base set of CONFIG options.
> >
> > When it does not exist, the files in DEFCONFIG_LIST are searched in
> > this order and loaded if found.
> >
> > I do not see much sense in the last two lines in DEFCONFIG_LIST.
> >
> > [1] ARCH_DEFCONFIG
> >
> > The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
> > ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.
> >
> > arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or
> > 64 bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG
> > should be a fixed string because the base config file is loaded before
> > the symbol evaluation stage.
> >
> > Using KBUILD_DEFCONFIG makes more sense because it is fixed before
> > Kconfig is invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it
> > in the same way, and it works as expected. Hence, replace ARCH_DEFCONFIG
> > with "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".
> >
> > [2] arch/$(ARCH)/defconfig
> >
> > This file path is no longer valid. The defconfig files are always located
> > in the arch configs/ directories.
> >
> >   $ find arch -name defconfig | sort
> >   arch/alpha/configs/defconfig
> >   arch/arm64/configs/defconfig
> >   arch/csky/configs/defconfig
> >   arch/nds32/configs/defconfig
> >   arch/riscv/configs/defconfig
> >   arch/s390/configs/defconfig
> >   arch/unicore32/configs/defconfig
> >
> > The path arch/*/configs/defconfig is already covered by
> > "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
> > not necessary.
> >
> > I moved the default KBUILD_DEFCONFIG to the top Makefile. Otherwise,
> > the 7 architectures listed above would end up with endless loop of
> > syncconfig.
> >
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
>
>
> I forgot to say this.
> This is v2.
>
> Changes in v2:
>   - Move KBUILD_DEFCONFIG to fix endless loop of syncconfig
>
>

Applied to linux-kbuild.


Best Regards
Masahiro Yamada

_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


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

end of thread, other threads:[~2020-03-03 13:47 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28  3:46 [PATCH] kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST Masahiro Yamada
2020-02-28  3:46 ` Masahiro Yamada
2020-02-28  3:46 ` Masahiro Yamada
2020-02-28  3:48 ` Masahiro Yamada
2020-02-28  3:48   ` Masahiro Yamada
2020-03-03 13:46   ` Masahiro Yamada
2020-03-03 13:46     ` Masahiro Yamada
2020-03-03 13:46     ` Masahiro Yamada
  -- strict thread matches above, loose matches on Subject: below --
2020-02-16 15:45 Masahiro Yamada
2020-02-16 15:45 ` Masahiro Yamada
2020-02-16 15:45 ` Masahiro Yamada
2020-02-16 15:45 ` Masahiro Yamada
     [not found] ` <CGME20200221085039eucas1p2b439c37eb04870cc020f452b7ad31929@eucas1p2.samsung.com>
2020-02-21  8:50   ` Marek Szyprowski
2020-02-21  8:50     ` Marek Szyprowski
2020-02-21  8:50     ` Marek Szyprowski
2020-02-21  8:50     ` Marek Szyprowski
2020-02-21  8:50     ` Marek Szyprowski
2020-02-21  9:18     ` Masahiro Yamada
2020-02-21  9:18       ` Masahiro Yamada
2020-02-21  9:18       ` Masahiro Yamada
2020-02-21  9:18       ` Masahiro Yamada
2020-02-21  9:18       ` Masahiro Yamada
2020-02-21  9:22       ` Will Deacon
2020-02-21  9:22         ` Will Deacon
2020-02-21  9:22         ` Will Deacon
2020-02-21  9:22         ` Will Deacon
2020-02-21  9:22         ` Will Deacon

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.