[PATCH 1/2] arm64: insn: clean-up memory barrier types

Ada Couprie Diaz ada.coupriediaz at arm.com
Mon Oct 19 08:26:29 PDT 2026


Hi Vladimir,

On 19/10/2026 11:07, Vladimir Murzin wrote:
> Hi Ada,
>
> On 10/16/26 17:51, Ada Couprie Diaz wrote:
>> Replace magic-numbers for offset and mask with shared defines.
>>
>> Re-order the types enum by value, matching the Arm ARM, and
>> define them with their proper values, simplifying their use.
>>
>> 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()`.
>>
> Nitpick: this is slightly confusing since __get_barrier_crm_val()
> gets converted into  __is_valid_barrier_type()
Ah yes, as with patch 2 I did forget this when I reworked this part
of the changes, my mistake. Thanks !
>> 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 | 22 ++++++++----------
>>   arch/arm64/lib/insn.c         | 44 ++++++++++++-----------------------
>>   2 files changed, 25 insertions(+), 41 deletions(-)
>> [...]
> FWIW,
>
> Reviewed-by: Vladimir Murzin <vladimir.murzin at arm.com>
Thanks for having a look !
Kind regards,
Ada



More information about the linux-arm-kernel mailing list