All of lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Naour <romain.naour@smile.fr>
To: Thomas De Schampheleire <patrickdepinguin@gmail.com>,
	buildroot@buildroot.org
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Subject: Re: [Buildroot] [PATCH 3/4] core: introduce BR2_KERNEL_ARCH_OVERRIDE
Date: Mon, 10 Jan 2022 00:27:14 +0100	[thread overview]
Message-ID: <5269b781-3bed-9b6c-9a4f-2d077964a16e@smile.fr> (raw)
In-Reply-To: <20210518113652.29609-4-patrickdepinguin@gmail.com>

Hello Thomas,

Le 18/05/2021 à 13:36, Thomas De Schampheleire a écrit :
> From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
> 
> There are cases where a 64-bit architecture is running a 64-bit kernel but
> 32-bit userspace. Examples include:
>     * aarch64 architecture, with aarch64 kernel and 32-bit (ARM) userspace
>     * x86_64 architecture, with x86_64 kernel and 32-bit (i386) userspace

Can you provide a new qemu defconfig that cover this use case?
This is for gitlab-ci runtime testing.

Best regards,
Romain

PS: (This email doesn't count as a review of this series :))

> 
> In Buildroot, the ARCH/BR2_ARCH and NORMALIZED_ARCH variables will refer to
> the 32-bit architecture, but the kernel needs to be built with the 64-bit
> architecture.
> 
> Make it possible to define the correct architecture to be used for the
> kernel, in a new config option 'BR2_KERNEL_ARCH_OVERRIDE'. The user is
> expected to know the valid values.
> 
> Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
> ---
>  Makefile       |  4 ++++
>  arch/Config.in | 15 +++++++++++++++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index c5399e9a35..d09cf7c958 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -434,7 +434,11 @@ QUIET := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-q)
>  # Strip off the annoying quoting
>  ARCH := $(call qstrip,$(BR2_ARCH))
>  NORMALIZED_ARCH := $(call qstrip,$(BR2_KERNEL_ARCH))
> +ifeq ($(call qstrip,$(BR2_KERNEL_ARCH_OVERRIDE)),)
>  KERNEL_ARCH := $(call qstrip,$(BR2_KERNEL_ARCH))
> +else
> +KERNEL_ARCH := $(call qstrip,$(BR2_KERNEL_ARCH_OVERRIDE))
> +endif
>  
>  ZCAT := $(call qstrip,$(BR2_ZCAT))
>  BZCAT := $(call qstrip,$(BR2_BZCAT))
> diff --git a/arch/Config.in b/arch/Config.in
> index 7575acf48c..c82100f541 100644
> --- a/arch/Config.in
> +++ b/arch/Config.in
> @@ -329,6 +329,21 @@ config BR2_ARCH
>  config BR2_KERNEL_ARCH
>  	string
>  
> +config BR2_KERNEL_ARCH_OVERRIDE
> +	string "Kernel architecture override"
> +	help
> +	  Normally, the correct kernel architecture value is derived
> +	  from the selected architecture, and you should keep this
> +	  option empty.
> +	  However, there are cases where you may want to enter a custom
> +	  value, for example when using a 64-bit architecture but
> +	  running userspace in 32-bit mode.
> +	  As an example, in case of an x86_64 processor where you want
> +	  32-bit userspace, BR2_ARCH will be 'i386'/'i486'/'i686' and
> +	  BR2_KERNEL_ARCH_OVERRIDE should be set to 'x86_64'. Note that
> +	  in this example you will also need a multilib toolchain and
> +	  pass '-m32' via BR2_TARGET_OPTIMIZATION.
> +
>  config BR2_ENDIAN
>  	string
>  
> 

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

  reply	other threads:[~2022-01-09 23:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 11:36 [Buildroot] [PATCH RFC 0/4] Basic support for 64-bit kernel and 32-bit userland Thomas De Schampheleire
2021-05-18 11:36 ` [Buildroot] [PATCH 1/4] arch: move definition of KERNEL_ARCH to Config.in.<arch> files Thomas De Schampheleire
2022-01-13 20:48   ` Romain Naour
2021-05-18 11:36 ` [Buildroot] [PATCH 2/4] core: introduce NORMALIZED_ARCH as non-kernel replacement for KERNEL_ARCH Thomas De Schampheleire
2022-01-13 21:30   ` Romain Naour
2022-01-14 12:27     ` Thomas De Schampheleire
2022-01-15 14:55       ` Romain Naour
2021-05-18 11:36 ` [Buildroot] [PATCH 3/4] core: introduce BR2_KERNEL_ARCH_OVERRIDE Thomas De Schampheleire
2022-01-09 23:27   ` Romain Naour [this message]
2022-01-12 11:04     ` Thomas De Schampheleire
2022-01-12 19:10       ` Arnout Vandecappelle
2022-01-12 20:06         ` Romain Naour
2022-01-13 22:05   ` Romain Naour
2022-01-15 19:31     ` Thomas De Schampheleire
2022-01-15 19:45     ` Thomas De Schampheleire
2021-05-18 11:36 ` [Buildroot] [PATCH 4/4] perf: fix compilation in case of i386 userspace with x86_64 kernel Thomas De Schampheleire
2022-01-13 22:15   ` Romain Naour
2022-01-14  9:33     ` Thomas De Schampheleire

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5269b781-3bed-9b6c-9a4f-2d077964a16e@smile.fr \
    --to=romain.naour@smile.fr \
    --cc=buildroot@buildroot.org \
    --cc=patrickdepinguin@gmail.com \
    --cc=thomas.de_schampheleire@nokia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.