lkml.org 
[lkml]   [2021]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v8 14/19] arm64: exec: Adjust affinity for compat tasks with mismatched 32-bit EL0
From
Date
On 6/2/21 6:47 PM, Will Deacon wrote:
> When exec'ing a 32-bit task on a system with mismatched support for
> 32-bit EL0, try to ensure that it starts life on a CPU that can actually
> run it.
>
> Similarly, when exec'ing a 64-bit task on such a system, try to restore
> the old affinity mask if it was previously restricted.
>
> Reviewed-by: Quentin Perret <qperret@google.com>
> Signed-off-by: Will Deacon <will@kernel.org>
> ---

[...]

>
> +#ifdef CONFIG_COMPAT
> +int compat_elf_check_arch(const struct elf32_hdr *hdr)
> +{
> + if (!system_supports_32bit_el0())
> + return false;
> +
> + if ((hdr)->e_machine != EM_ARM)
> + return false;
> +
> + if (!((hdr)->e_flags & EF_ARM_EABI_MASK))
> + return false;
> +
> + /*
> + * Prevent execve() of a 32-bit program from a deadline task
> + * if the restricted affinity mask would be inadmissible on an
> + * asymmetric system.
> + */
> + return !static_branch_unlikely(&arm64_mismatched_32bit_el0) ||
> + task_cpus_dl_admissible(current, system_32bit_el0_cpumask());
> +}
> +#endif

From the DL perspective:

Reviewed-by: Daniel Bristot de Oliveira <bristot@redhat.com>

Thanks!
-- Daniel

\
 
 \ /
  Last update: 2021-06-03 11:46    [W:0.241 / U:1.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site