lkml.org 
[lkml]   [2023]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@suse.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
>

\
 
 \ /
  Last update: 2023-10-18 14:54    [W:0.571 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site