lkml.org 
[lkml]   [2023]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 2/4] arm64/process: Make loading of 32bit processes depend on aarch32_enabled()
Date
Major aspect of Aarch32 support is the ability to load 32bit
processes.
That's currently decided (among others) by compat_elf_check_arch()
and system_supports_32bit_el0().

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>
---
arch/arm64/include/asm/cpufeature.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
index 1180d68daaff..778f2f3b2c7d 100644
--- a/arch/arm64/include/asm/cpufeature.h
+++ b/arch/arm64/include/asm/cpufeature.h
@@ -679,8 +679,9 @@ static inline bool system_supports_32bit_el0(void)
{
u64 pfr0 = read_sanitised_ftr_reg(SYS_ID_AA64PFR0_EL1);

- return static_branch_unlikely(&arm64_mismatched_32bit_el0) ||
- id_aa64pfr0_32bit_el0(pfr0);
+ return (static_branch_unlikely(&arm64_mismatched_32bit_el0) ||
+ id_aa64pfr0_32bit_el0(pfr0)) &&
+ aarch32_enabled();
}

static inline bool system_supports_4kb_granule(void)
--
2.35.3
\
 
 \ /
  Last update: 2023-10-23 16:44    [W:0.085 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site