Skip to contentSkip to conversation

arm64: Kconfig: add a choice for endianess

PATCH Superseded Anders Roxell 3 participants 3 messages Nov 12, 2019 arm64

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: Kconfig: add a choice for endianess

When building allmodconfig KCONFIG_ALLCONFIG=$(pwd)/arch/arm64/configs/defconfig CONFIG_CPU_BIG_ENDIAN gets enabled. Which tends not to be what most people wants. Another concern that thas come up is that ACPI in't built for an allmodconfig kernel today since that also depends on !CPU_BIG_ENDIAN.

Rework so that we introduce a 'choice' and default the choice to CPU_LITTLE_ENDIAN. That means that when we build an allmodconfig kernel it will default to CPU_LITTLE_ENDIAN that most people tends to want.

---
 arch/arm64/Kconfig | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm64/Kconfig +13 -0
index 64764ca92fca..62f83c234a61 100644
@@ -877,11 +877,24 @@ config ARM64_PA_BITS
 	default 48 if ARM64_PA_BITS_48
 	default 52 if ARM64_PA_BITS_52
 
+choice
+	prompt "Endianess"
+	default CPU_LITTLE_ENDIAN
+	help
+	  Choose what mode you plan on running your kernel in.
+
 config CPU_BIG_ENDIAN
        bool "Build big-endian kernel"
        help
          Say Y if you plan on running a kernel in big-endian mode.
 
+config CPU_LITTLE_ENDIAN
+	bool "Build little-endian kernel"
+	help
+	  Say Y if you plan on running a kernel in little-endian mode.
+
+endchoice
+
 config SCHED_MC
 	bool "Multi-core scheduler support"
 	help
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Anders Roxell

When building allmodconfig KCONFIG_ALLCONFIG=$(pwd)/arch/arm64/configs/defconfig CONFIG_CPU_BIG_ENDIAN gets enabled. Which tends not to be what most people wants. Another concern that thas come up is that ACPI in't built

/s/wants/want/, s/thas/has/, s/in't/isn't/

Quoted 7 lines

for an allmodconfig kernel today since that also depends on !CPU_BIG_ENDIAN.

Rework so that we introduce a 'choice' and default the choice to CPU_LITTLE_ENDIAN. That means that when we build an allmodconfig kernel it will default to CPU_LITTLE_ENDIAN that most people tends to want.

FWIW, apart from spelling mistakes:

Quoted 9 lines
---
  arch/arm64/Kconfig | 13 +++++++++++++
  1 file changed, 13 insertions(+)
arch/arm64/Kconfig +0 -0
index 64764ca92fca..62f83c234a61 100644

arch/arm64/Kconfig config ARM64_PA_BITS · line 881

Quoted 5 lines
arch/arm64/Kconfig +2 -0
@@ -877,11 +877,24 @@ config ARM64_PA_BITS
  	default 48 if ARM64_PA_BITS_48
  	default 52 if ARM64_PA_BITS_52
 
+choice
+	prompt "Endianess"

Should this be "Endianness"?

Quoted 20 lines
arch/arm64/Kconfig +11 -0
+	default CPU_LITTLE_ENDIAN
+	help
+	  Choose what mode you plan on running your kernel in.
+
  config CPU_BIG_ENDIAN
         bool "Build big-endian kernel"
         help
           Say Y if you plan on running a kernel in big-endian mode.
 
+config CPU_LITTLE_ENDIAN
+	bool "Build little-endian kernel"
+	help
+	  Say Y if you plan on running a kernel in little-endian mode.
+
+endchoice
+
  config SCHED_MC
  	bool "Multi-core scheduler support"
  	help
maintainer
#2 lore raw
Quoted 35 lines · John Garry
Quoted 3 lines · Anders Roxell

When building allmodconfig KCONFIG_ALLCONFIG=$(pwd)/arch/arm64/configs/defconfig CONFIG_CPU_BIG_ENDIAN gets enabled. Which tends not to be what most people wants. Another concern that thas come up is that ACPI in't built

/s/wants/want/, s/thas/has/, s/in't/isn't/

Quoted 7 lines

for an allmodconfig kernel today since that also depends on !CPU_BIG_ENDIAN.

Rework so that we introduce a 'choice' and default the choice to CPU_LITTLE_ENDIAN. That means that when we build an allmodconfig kernel it will default to CPU_LITTLE_ENDIAN that most people tends to want.

FWIW, apart from spelling mistakes:

arch/arm64/Kconfig config ARM64_PA_BITS · line 880

Quoted 13 lines
---
  arch/arm64/Kconfig | 13 +++++++++++++
  1 file changed, 13 insertions(+)
arch/arm64/Kconfig +2 -0
index 64764ca92fca..62f83c234a61 100644
@@ -877,11 +877,24 @@ config ARM64_PA_BITS
  	default 48 if ARM64_PA_BITS_48
  	default 52 if ARM64_PA_BITS_52
+choice
+	prompt "Endianess"

Should this be "Endianness"?

Quoted 3 lines

arch/arm64/Kconfig config ARM64_PA_BITS · line 884

Quoted 3 lines
arch/arm64/Kconfig +3 -0
+	default CPU_LITTLE_ENDIAN
+	help
+	  Choose what mode you plan on running your kernel in.

While we're at it, I'd avoid the use of "mode" here since that has a different meaning in the architecture, although I see we already use that terminology for CPU_BIG_ENDIAN. How about:

"Select the endianness of data accesses performed by the CPU. Userspace
applications will need to be compiled and linked for the endianness that is selected here.

Little-endian is compatible with x86, but big-endian is faster."

(ok, maybe drop that last sentence ;)

Quoted 4 lines

arch/arm64/Kconfig config ARM64_PA_BITS · line 889

Quoted 4 lines
arch/arm64/Kconfig +0 -0
  config CPU_BIG_ENDIAN
         bool "Build big-endian kernel"
         help
           Say Y if you plan on running a kernel in big-endian mode.

Then this can be:

"Say Y if you plan on running a kernel with a big-endian userspace."

Quoted 4 lines

arch/arm64/Kconfig config ARM64_PA_BITS · line 894

Quoted 4 lines
arch/arm64/Kconfig +4 -0
+config CPU_LITTLE_ENDIAN
+	bool "Build little-endian kernel"
+	help
+	  Say Y if you plan on running a kernel in little-endian mode.

"Say Y if you plan on running a kernel with a little-endian userspace.
This is usually the case for distributions targetting arm64."

I think it's userspace that people really care about, so wording it in terms of that makes most sense to me.

Will