Re: [RFC PATCH 1/1] arch: arm64: Implement unaligned atomic emulation
From: Mark Brown
Date: Thu Nov 06 2025 - 11:19:28 EST
On Thu, Nov 06, 2025 at 01:07:35PM -0300, André Almeida wrote:
> +int set_unalign_atomic_ctl(unsigned int val)
> +{
> + unsigned long valid_mask = PR_ARM64_UNALIGN_ATOMIC_EMULATE;
> + if (val & ~valid_mask)
> + return -EINVAL;
> +
> + /*
> + * TODO: check if this is running in a ARM v8.1 or greater.
> + * Refuse otherwise.
> + */
The code should check for the specific feature you're relying on, not
the architecture level which isn't really a technically discoverable
thing, something like:
if (!cpus_have_final_cap(ARM64_HAS_LDAPR))
return -EINVAL;
Attachment:
signature.asc
Description: PGP signature