linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] arm64: Kconfig: add a choice for endianness
@ 2019-11-13  9:26 Anders Roxell
  2019-11-13 10:33 ` Will Deacon
  2019-11-14 14:40 ` Catalin Marinas
  0 siblings, 2 replies; 3+ messages in thread
From: Anders Roxell @ 2019-11-13  9:26 UTC (permalink / raw)
  To: catalin.marinas
  Cc: will, john.garry, linux-arm-kernel, linux-kernel, 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 want. Another concern that has come up is that ACPI isn'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.

Reviewed-by: John Garry <john.garry@huawei.com>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 arch/arm64/Kconfig | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 64764ca92fca..c599b6b288be 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -877,10 +877,26 @@ config ARM64_PA_BITS
 	default 48 if ARM64_PA_BITS_48
 	default 52 if ARM64_PA_BITS_52
 
+choice
+	prompt "Endianness"
+	default CPU_LITTLE_ENDIAN
+	help
+	  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.
+
 config CPU_BIG_ENDIAN
        bool "Build big-endian kernel"
        help
-         Say Y if you plan on running a kernel in big-endian mode.
+	  Say Y if you plan on running a kernel with a big-endian userspace.
+
+config CPU_LITTLE_ENDIAN
+	bool "Build little-endian kernel"
+	help
+	  Say Y if you plan on running a kernel with a little-endian userspace.
+	  This is usually the case for distributions targetting arm64.
+
+endchoice
 
 config SCHED_MC
 	bool "Multi-core scheduler support"
-- 
2.20.1


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

* Re: [PATCH v2] arm64: Kconfig: add a choice for endianness
  2019-11-13  9:26 [PATCH v2] arm64: Kconfig: add a choice for endianness Anders Roxell
@ 2019-11-13 10:33 ` Will Deacon
  2019-11-14 14:40 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2019-11-13 10:33 UTC (permalink / raw)
  To: Anders Roxell; +Cc: catalin.marinas, john.garry, linux-arm-kernel, linux-kernel

On Wed, Nov 13, 2019 at 10:26:52AM +0100, Anders Roxell wrote:
> When building allmodconfig KCONFIG_ALLCONFIG=$(pwd)/arch/arm64/configs/defconfig
> CONFIG_CPU_BIG_ENDIAN gets enabled. Which tends not to be what most
> people want. Another concern that has come up is that ACPI isn'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.
> 
> Reviewed-by: John Garry <john.garry@huawei.com>
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>  arch/arm64/Kconfig | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 64764ca92fca..c599b6b288be 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -877,10 +877,26 @@ config ARM64_PA_BITS
>  	default 48 if ARM64_PA_BITS_48
>  	default 52 if ARM64_PA_BITS_52
>  
> +choice
> +	prompt "Endianness"
> +	default CPU_LITTLE_ENDIAN
> +	help
> +	  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.
> +
>  config CPU_BIG_ENDIAN
>         bool "Build big-endian kernel"
>         help
> -         Say Y if you plan on running a kernel in big-endian mode.
> +	  Say Y if you plan on running a kernel with a big-endian userspace.
> +
> +config CPU_LITTLE_ENDIAN
> +	bool "Build little-endian kernel"
> +	help
> +	  Say Y if you plan on running a kernel with a little-endian userspace.
> +	  This is usually the case for distributions targetting arm64.

Bah, my typo here: targetting -> targeting

Catalin, could you take this with the above fixed, please?

Acked-by: Will Deacon <will@kernel.org>

Will

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

* Re: [PATCH v2] arm64: Kconfig: add a choice for endianness
  2019-11-13  9:26 [PATCH v2] arm64: Kconfig: add a choice for endianness Anders Roxell
  2019-11-13 10:33 ` Will Deacon
@ 2019-11-14 14:40 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2019-11-14 14:40 UTC (permalink / raw)
  To: Anders Roxell; +Cc: will, john.garry, linux-arm-kernel, linux-kernel

On Wed, Nov 13, 2019 at 10:26:52AM +0100, Anders Roxell wrote:
> When building allmodconfig KCONFIG_ALLCONFIG=$(pwd)/arch/arm64/configs/defconfig
> CONFIG_CPU_BIG_ENDIAN gets enabled. Which tends not to be what most
> people want. Another concern that has come up is that ACPI isn'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.
> 
> Reviewed-by: John Garry <john.garry@huawei.com>
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

Queued for 5.5 (with the typo fixed). Thanks.

-- 
Catalin

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

end of thread, other threads:[~2019-11-14 14:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13  9:26 [PATCH v2] arm64: Kconfig: add a choice for endianness Anders Roxell
2019-11-13 10:33 ` Will Deacon
2019-11-14 14:40 ` Catalin Marinas

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