From: "Arnd Bergmann" <arnd@arndb.de>
To: "Catalin Marinas" <catalin.marinas@arm.com>,
"Arnd Bergmann" <arnd@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org, apais@microsoft.com,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Fuad Tabba" <fuad.tabba@linux.dev>,
hargar@linux.microsoft.com, "Joey Gouly" <joey.gouly@arm.com>,
"Marc Zyngier" <maz@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Navneet Singh" <navneetsingh@microsoft.com>,
"Oliver Upton" <oupton@kernel.org>,
rlmenge@gmail.com,
"Siddharth Chintamaneni" <sidchintamaneni@gmail.com>,
"Steffen Eiden" <seiden@linux.ibm.com>,
"Suzuki K Poulose" <suzuki.poulose@arm.com>,
"Sven Schnelle" <sven@linux.ibm.com>,
"Will Deacon" <will@kernel.org>,
"Zenghui Yu" <yuzenghui@huawei.com>,
"Zhou Wang" <wangzhou1@hisilicon.com>,
kvmarm@lists.linux.dev, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] arm64: add HWCAP3_LS64_ACCDATA
Date: Wed, 02 Dec 2026 23:53:03 +0100 [thread overview]
Message-ID: <0f482f23-53fc-4537-a11e-85ef20ce9859@app.fastmail.com> (raw)
In-Reply-To: <aw26TP1HH-oo1kjf@arm.com>
On Mon, Nov 30, 2026, at 19:02, Catalin Marinas wrote:
> On Thu, Nov 26, 2026 at 04:53:38PM +0100, Arnd Bergmann wrote:
>> diff --git a/Documentation/arch/arm64/elf_hwcaps.rst b/Documentation/arch/arm64/elf_hwcaps.rst
>> index f60ca5612daa..f63035696654 100644
>> --- a/Documentation/arch/arm64/elf_hwcaps.rst
>> +++ b/Documentation/arch/arm64/elf_hwcaps.rst
>> @@ -478,6 +478,13 @@ HWCAP3_SVE_LUT6
>> Functionality implied by ID_AA64PFR0_EL1.SVE == 0b0001 and
>> ID_AA64ISAR2_EL1.LUT == 0b0010.
>>
>> +HWCAP3_LS64_ACCDATA
>> + Functionality implied by ID_AA64ISAR1_EL1.LS64 >= 0b0011. Note that
>> + the function of instruction st64bv0 requires support by CPU, system
>> + and target (device) memory location and HWCAP3_LS64_ACCDATA implies
>> + the support of CPU. User should only use st64bv0 on supported target
>> + (device) memory location, otherwise fallback to the non-atomic
>> + alternatives.
>
> Not sure where to document it but without a device and PASID the
> instruction will trigger SIGBUS. I'm not even sure the fallback to
> non-atomic alternatives is appropriate since user has no knowledge of
> PASIDs.
My mistake, that reference was leftover from the original ls64
enablement patch.
> Something like (feel free to reword):
>
> Functionality implied by ID_AA64ISAR1_EL1.LS64 >= 0b0011. Note that
> the function of instruction st64bv0 requires support by CPU, system
> and target (device) memory location and HWCAP3_LS64_ACCDATA implies
> the support of CPU only.
>
> The kernel uses ACCDATA_EL1 to supply the Process Address Space ID
> (PASID) of the calling process. The CPU replaces bits [31:0] of the
> 64-byte store data with this value. st64bv0 can only be used after a
> device driver has bound the process address space to a device that
> takes the PASID from the store payload. Otherwise, the instruction
> raises SIGBUS with si_code == BUS_OBJERR.
>
> But a bit more below before deciding what this HWCAP means:
Thanks, I've taken this with very minor changes
>> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
>> index c88ea4b93138..dcbe024284e0 100644
>> --- a/arch/arm64/kernel/cpufeature.c
>> +++ b/arch/arm64/kernel/cpufeature.c
>> @@ -3223,6 +3223,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
>> HWCAP_CAP(ID_AA64ISAR1_EL1, DGH, IMP, CAP_HWCAP, KERNEL_HWCAP_DGH),
>> HWCAP_CAP(ID_AA64ISAR1_EL1, I8MM, IMP, CAP_HWCAP, KERNEL_HWCAP_I8MM),
>> HWCAP_CAP(ID_AA64ISAR1_EL1, LS64, LS64, CAP_HWCAP, KERNEL_HWCAP_LS64),
>> + HWCAP_CAP(ID_AA64ISAR1_EL1, LS64, LS64_ACCDATA, CAP_HWCAP, KERNEL_HWCAP_LS64_ACCDATA),
>
> This HWCAP is advertised even with CONFIG_IOMMU_SVA=n but in such
> configuration we'll get a SIGILL rather than SIGBUS since
> system_supports_ls64_accdata() is false. It feels a bit inconsistent:
> HWCAP_CAP() above suggests it's a CPU only feature but the behaviour,
> SIGBUS etc. depends on the kernel configuration.
>
> We could make this a CPU feature only (irrespective of iommu) but then
> we'd need to inform the user somehow that PASIDs get passed to the
> device. The easiest is to add #ifdef around this with a dedicated
> CONFIG_ARM64_LS64_ACCDATA option which depends on IOMMU_SVA (same with
> system_supports_ls64_accdata()).
I've moved the check for CONFIG_ARM64_LS64_ACCDATA out of
system_supports_ls64_accdata() into the callers now, which
makes the SIGBUS behavior consistent regardless of kernel
configuration.
Arnd
prev parent reply other threads:[~2026-12-02 22:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 15:53 [PATCH v2 0/3] st64bv0 support in iommu-sva Arnd Bergmann
[not found] ` <20261126155339.1349218-2-arnd@kernel.org>
2026-11-30 17:24 ` [PATCH v2 1/3] arm64: dynamically enable st64bv0 for SVA Catalin Marinas
2026-12-02 22:32 ` Arnd Bergmann
[not found] ` <20261126155339.1349218-3-arnd@kernel.org>
2026-11-30 18:02 ` [PATCH v2 2/3] arm64: add HWCAP3_LS64_ACCDATA Catalin Marinas
2026-12-02 22:53 ` Arnd Bergmann [this message]
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=0f482f23-53fc-4537-a11e-85ef20ce9859@app.fastmail.com \
--to=arnd@arndb.de \
--cc=apais@microsoft.com \
--cc=arnd@kernel.org \
--cc=borntraeger@linux.ibm.com \
--cc=catalin.marinas@arm.com \
--cc=fuad.tabba@linux.dev \
--cc=hargar@linux.microsoft.com \
--cc=joey.gouly@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=navneetsingh@microsoft.com \
--cc=oupton@kernel.org \
--cc=rlmenge@gmail.com \
--cc=seiden@linux.ibm.com \
--cc=sidchintamaneni@gmail.com \
--cc=suzuki.poulose@arm.com \
--cc=sven@linux.ibm.com \
--cc=wangzhou1@hisilicon.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/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
all inboxes | Powered by JetHome®