[PATCH 1/6] arm64: insn: remove deprecated memory barrier types
Vladimir Murzin
vladimir.murzin at arm.com
Fri Oct 9 03:19:23 PDT 2026
Hi Ada,
On 10/7/26 18:05, Ada Couprie Diaz wrote:
> Hi Vladimir,
>
> On 07/10/2026 07:21, Vladimir Murzin wrote:
>> Hi Ada,
>>
>> On 9/28/26 14:30, Ada Couprie Diaz wrote:
>>> Arm ARM DDI 0487 version M.c[0] deprecated a number of types
>>> used as options for the DMB and DSB instructions, with no change
>>> in behaviour.
>>> The deprecated types are not used in the kernel, so remove them
>>> from our instruction generation framework and add the missing
>>> `AARCH64_INSN_MB_OSH` case in `__get_barrier_crm_val()`.
>>>
>> Arm ARM says that OSH has the same behaviour as SY, so I'd assume
>> any user of OSH should be fine to upgrade to SY, no?
>
> As you mention below, OSH is _technically_ not deprecated for DSB, so I think
> it would make sense to add it for completion.
> Though, given that it is indeed equivalent I can see the argument for leaving it.
>
Ahh, missed that. I think if we go for inlining barrier encodings into
aarch64_insn_gen_d{m,s}b() then we can keep OSH for completion.
> I initially wanted to silently convert deprecated encodings to SY and co.,
> Mark was against the idea but I guess it could be OK just not providing them.
>
>>> This simplifies the switch-case and now covers all the enum types,
>>> which allows for making the DSB and DMB generation non instrumentable
>>> in a follow-up commit.
>>>
>>> [0]: https://support.arm.com/documentation/ddi0487/mc/
>>> (See C6.2.150, C6.2.152)
>>>
>>> Signed-off-by: Ada Couprie Diaz <ada.coupriediaz at arm.com>
>>> ---
>>> arch/arm64/include/asm/insn.h | 6 ------
>>> arch/arm64/lib/insn.c | 10 ++--------
>>> 2 files changed, 2 insertions(+), 14 deletions(-)
>>>
>>> diff --git a/arch/arm64/include/asm/insn.h b/arch/arm64/include/asm/insn.h
>>> index 1ce75a4426387..8ec9d86cc575c 100644
>>> --- a/arch/arm64/include/asm/insn.h
>>> +++ b/arch/arm64/include/asm/insn.h
>>> @@ -302,14 +302,8 @@ enum aarch64_insn_mb_type {
>>> AARCH64_INSN_MB_ST,
>>> AARCH64_INSN_MB_LD,
>>> AARCH64_INSN_MB_ISH,
>>> - AARCH64_INSN_MB_ISHST,
>>> - AARCH64_INSN_MB_ISHLD,
>>> AARCH64_INSN_MB_NSH,
>>> - AARCH64_INSN_MB_NSHST,
>>> - AARCH64_INSN_MB_NSHLD,
>>> AARCH64_INSN_MB_OSH,
>>> - AARCH64_INSN_MB_OSHST,
>>> - AARCH64_INSN_MB_OSHLD,
>>> };
>>> #define __AARCH64_INSN_FUNCS(abbr, mask, val) \
>>> diff --git a/arch/arm64/lib/insn.c b/arch/arm64/lib/insn.c
>>> index e70ac02385153..c70820d65805f 100644
>>> --- a/arch/arm64/lib/insn.c
>>> +++ b/arch/arm64/lib/insn.c
>>> @@ -1572,16 +1572,10 @@ static u32 __get_barrier_crm_val(enum aarch64_insn_mb_type type)
>>> return 0xd;
>>> case AARCH64_INSN_MB_ISH:
>>> return 0xb;
>>> - case AARCH64_INSN_MB_ISHST:
>>> - return 0xa;
>>> - case AARCH64_INSN_MB_ISHLD:
>>> - return 0x9;
>>> case AARCH64_INSN_MB_NSH:
>>> return 0x7;
>>> - case AARCH64_INSN_MB_NSHST:
>>> - return 0x6;
>>> - case AARCH64_INSN_MB_NSHLD:
>>> - return 0x5;
>>> + case AARCH64_INSN_MB_OSH:
>>> + return 0x3;
>>> default:
>>> pr_err("%s: unknown barrier type %d\n", __func__, type);
>>> return AARCH64_BREAK_FAULT;
>>> -- 2.43.0
>>>
>> It looks like NSH, ISH and OSH applies to DSB and deprecated in case of DMB
>> which is slightly confusing. Given that we drop bunch of encodings perhaps we
>> can inline logic in aarch64_insn_gen_d{m,s}b()?
>
> Yeah I can see an argument for that, I'm not against it and it probably makes
> the error handling in patch 2 a bit cleaner...
>
Happy to take a look!
Thanks!
>> Cheers
>> Vladimir
> Thanks for the comments !
> Kind regards,
> Ada
More information about the linux-arm-kernel
mailing list