Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ada Couprie Diaz <ada.coupriediaz@arm.com>
To: Vladimir Murzin <vladimir.murzin@arm.com>,
	linux-arm-kernel@lists.infradead.org
Cc: Mark Rutland <mark.rutland@arm.com>,
	Marc Zyngier <maz@kernel.org>, Barry Song <baohua@kernel.org>,
	Oliver Upton <oupton@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Shanker Donthineni <sdonthineni@nvidia.com>,
	Vikram Sethi <vsethi@nvidia.com>,
	James Morse <james.morse@arm.com>,
	Andre Przywara <andre.przywara@arm.com>,
	Tejun Heo <tj@kernel.org>, Lucas Wei <lucaswei@google.com>,
	Will Deacon <will@kernel.org>
Subject: Re: [PATCH 1/6] arm64: insn: remove deprecated memory barrier types
Date: Wed, 7 Oct 2026 18:05:43 +0100	[thread overview]
Message-ID: <a163f846-dbc3-4077-ab9c-a17d31656af2@arm.com> (raw)
In-Reply-To: <dc663e58-b366-4f97-a260-0aff278f2f6f@arm.com>

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.

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@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...

> Cheers
> Vladimir
Thanks for the comments !
Kind regards,
Ada


  reply	other threads:[~2026-10-07 17:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 13:30 [PATCH 0/6] arm64: alternatives: switch most used alternatives to callbacks Ada Couprie Diaz
2026-09-28 13:30 ` [PATCH 1/6] arm64: insn: remove deprecated memory barrier types Ada Couprie Diaz
2026-10-07  6:21   ` Vladimir Murzin
2026-10-07 17:05     ` Ada Couprie Diaz [this message]
2026-10-09 10:19       ` Vladimir Murzin
2026-09-28 13:30 ` [PATCH 2/6] arm64: insn: make `aarch64_insn_gen_d{m,s}b()` alternative-safe Ada Couprie Diaz
2026-09-28 13:30 ` [PATCH 3/6] arm64: io: replace NVIDIA Olympus erratum alternative with callback Ada Couprie Diaz
2026-09-28 13:30 ` [PATCH 4/6] arm64: io: replace ARM erratum 832075 " Ada Couprie Diaz
2026-09-28 13:30 ` [PATCH 5/6] arm64: insn: operate on MSR/MRS sysreg field via defines Ada Couprie Diaz
2026-10-07  6:53   ` Vladimir Murzin
2026-10-07 16:31     ` Ada Couprie Diaz
2026-10-09  9:14       ` Vladimir Murzin
2026-09-28 13:30 ` [PATCH 6/6] arm64: use alternatie callback to patch TPIDR_EL1 accesses Ada Couprie Diaz
2026-10-06 16:28 ` [PATCH 0/6] arm64: alternatives: switch most used alternatives to callbacks Catalin Marinas
2026-10-06 17:30   ` Ada Couprie Diaz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a163f846-dbc3-4077-ab9c-a17d31656af2@arm.com \
    --to=ada.coupriediaz@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=anshuman.khandual@arm.com \
    --cc=arnd@arndb.de \
    --cc=baohua@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=lucaswei@google.com \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=sdonthineni@nvidia.com \
    --cc=tj@kernel.org \
    --cc=vladimir.murzin@arm.com \
    --cc=vsethi@nvidia.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox