[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZS_VJ29tFbEwNHAS@FVFF77S0Q05N.cambridge.arm.com>
Date: Wed, 18 Oct 2023 13:52:55 +0100
From: Mark Rutland <mark.rutland@....com>
To: Andrea della Porta <andrea.porta@...e.com>
Cc: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
nik.borisov@...e.com
Subject: Re: [PATCH 2/4] arm64/process: Make loading of 32bit processes
depend on aarch32_enabled()
On Wed, Oct 18, 2023 at 01:13:20PM +0200, Andrea della Porta wrote:
> Major aspect of Aarch32 emulation is the ability to load 32bit
> processes.
> That's currently decided (among others) by compat_elf_check_arch().
>
> Make the macro use aarch32_enabled() to decide if Aarch32 compat is
> enabled before loading a 32bit process.
>
> Signed-off-by: Andrea della Porta <andrea.porta@...e.com>
Why can't you make system_supports_32bit_el0() take the option into account
instead?
Mark.
> ---
> arch/arm64/kernel/process.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
> index 657ea273c0f9..96832f1ec3ee 100644
> --- a/arch/arm64/kernel/process.c
> +++ b/arch/arm64/kernel/process.c
> @@ -601,7 +601,7 @@ unsigned long arch_align_stack(unsigned long sp)
> #ifdef CONFIG_COMPAT
> int compat_elf_check_arch(const struct elf32_hdr *hdr)
> {
> - if (!system_supports_32bit_el0())
> + if (!system_supports_32bit_el0() || !aarch32_enabled())
> return false;
>
> if ((hdr)->e_machine != EM_ARM)
> --
> 2.35.3
>
Powered by blists - more mailing lists