From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.145 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796252026; b=Qyr0XMzpUwbi23SD2+sFD7aFjIhOcG+/0RFnFgScwxjORPvpRNVtXXts60tycMSpyc2b XMTV9rN7OxdQEiukR3uLcqxi7ZJYsE1eViVqWyBAU45qqLxH5BuGOyyj1yy/yb+w5tNOw UVPwdr3ppWrLOKbH1fTyD9+yLwtK8wHup96NrkUVYC9A6HMlIOBV/oO9oap7R277BWAzx KLlFh4ec6rG4JP6WRuaTSLIIHw406nctE6h6lGHvbk3KjGBAioPNH9a+NvwGEeEPn905u XDeBkvUdgtRe3bGr2OzeBx0KJQe1CA+KAconAm/IOGcuYunZsKu1dQ/uOAxGJCDoPZw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796252026; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:X-Mailer: MIME-Version:X-ThreadId:Date:From:To:Cc:Message-Id:In-Reply-To: References:Subject:Content-Type:Content-Transfer-Encoding; bh=2ypPuj8Ig9vYGbvSy4J7zDr3HwWJbJrKaS8NTyWgdd0=; b=clePtYdpZDlWiCx2ajEVm4dx+fr6beSSQcyZRx6kzz1CPo/VJrVKMKgV1d3zw7695/Vd Gc2QcxR/ccF+Acp+KD3fX+yLCJgyVJu7a71/VG5K68DL2t3UW27mKHt8U8DtHV8mObykJ xNwBrbXLheICCxthj0PfoJ3/pUTIWIuD3WDqCXYDjLLfbo2+lC1naLZD7Opn/wLYfg5PL /784C7MKlPtitPy7rDW5Sf8yDDyytT6T7/HG4OmFLJ8l58yYJfF9nSB1iFf+Wzz5CXelV GXh34FpfdsX4H+YQDVGYoTnQuKc9ppeC5u8GzQOt1SEFD0QgD4Jsg8luwZxs2hhtrhg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass header.d=arndb.de header.i=@arndb.de header.a=rsa-sha256 header.s=fm3 header.b=KDSwQ13A; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=b+IY9K5v; arc=none smtp.remote-ip=103.168.172.145 Received: from fout-a2-smtp.messagingengine.com (fout-a2-smtp.messagingengine.com [103.168.172.145]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8EA9606A322 for ; Wed, 2 Dec 2026 22:53:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C8EA9606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=arndb.de header.i=@arndb.de header.a=rsa-sha256 header.s=fm3 header.b=KDSwQ13A; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=b+IY9K5v Received: from ams-compute-02.internal (ams-compute-02.internal [10.64.2.62]) by mailfout.phl.internal (Postfix) with ESMTP id E7F38EC0323 for ; Wed, 2 Dec 2026 17:53:44 -0500 (EST) Received: from ams-imap-03 ([10.64.2.23]) by ams-compute-02.internal (MEProxy); Wed, 02 Dec 2026 17:53:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1796252013; x=1796338413; bh=2ypPuj8Ig9vYGbvSy4J7zDr3HwWJbJrKaS8NTyWgdd0=; b= KDSwQ13AezWQ94YAlNi9RFOgZZ86YVza52HqGp74ohrgV+uqhgLpJCzab4XxGGyr 4sXEr/v9NvhVLjXMheYd+yzu3xcc1IogRgoUHo/KMqDUvKN8PyfO8y8P5VGzpItu xP9/o+9p5DUKJWtWG7/VYIDO0SIGPdUmqCwYfX35Hf/zGW9haDNgDADBQ5E0Bpqw j1ghn7tLvt/7ZrDk2IuYO5zYTd3fDsUPENCma31kgGdiKvcv8sCmfDLViJHDtnyP iiMrdQ+tzKKGIs2tqmr2HLNRVNalcTsYQeLzzBiqevUKkwgyEUFbs5uv5uejm20c y5AqrNSuN67D+v3+RPLrrg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1796252013; x= 1796338413; bh=2ypPuj8Ig9vYGbvSy4J7zDr3HwWJbJrKaS8NTyWgdd0=; b=b +IY9K5vKa7QpLTuyT29bcgPF+8hFG8TISxrntnJMhlxcEIAZarCf2TbJsrRGzVbt Oqm5h4EKxenKMLiNBTuDNF0uzyh/wl7UDkUnsG5FATnPmnnfF7kXB/2gaSQyQ3vS rWbenk6I10IGJ4ykfZgmH4UV3SCnwjHd1PwayMwsD+Mck4cxKjr9Rigo5Grfj+Li 9+3eDRXJoxPlyxq/U/2hNx/ldBEb3ZU0fuZIdG5vghp/etMNWs4c/j14g88nkfcO SetUIkr2xshh5MkNueGOqlj+ytK18vd5JFyiPfLTrnnKSZnWtY9TeYS1jSjysi4K 73hqL7uKIJflAqO9adzog== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=arndb.de a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796252013; d=arndb.de; mf=PGFybmRAYXJuZGIuZGU+; rt=PGxpbnV4LWtlcm5lbEB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:g6dM+tDWiEekbty2d6byzmkz7IbeMUkQRXUK+GZUibFwq66 1mcPyCcku4ORG+hToSLBcEjTupGlVuocRweDWJX29O+hQWKV7fIgzN6ABs1YFPmB Vrz37tMuACDYV+buXnHAZJ3QRmPo52QdX483zM4vx47p3Jo/RWeosK613Px+yp99 LwnNKNwGr2xTzE59yyXwPbjMntiq+FbIX2YiKhJ0npkeoMIefMGcghnENLVyx93w 1EqJAbqu6gqCb69VotnXWlNTp9NxvEiCUpp8K/NCzE3r6hrm8D48fkV7Hig/+wkd srwal9szjdraRiFTpckIkFEhAiFHeN61+G9yjiw==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-transfer-encoding,content-type,date,feedback-id, from,in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:QzpUfuIGouRwPYuJBcxDyqNU6AMRMgZ0HlXVAJOS9zI=:rfhirJi5Xn6XmuMqdNplDg0B0VObU8LEPicXSXCxpQA=; X-ME-Sender: X-ME-Proxy-Cause: dmFkZTFz76pZzhxp2vNF/gWStBIOUjMN/pXLUy74sJ6Q0oDU4Xw7fBJIWB5gb3IzAXFTbO hj/OmNELfd/2QK6xO2Ip7VasN7iTvwvDMZLNux1CB8E/O5vR6nWOwdNaxwFxqyLn7+mFnt D0if/rEWH2bt/ZnuBl3EWnR0t4q4F8BeKBpoALBv5hlsJp55xbuKEe1dH3It+tkkg7+lI2 cBz3bXZcQk+tXNz2hOgygjtTAzAg6xkQWxS3wmPyrt9H1cYxa0B1M22AV20b8WjTPvOjky ZrCWpO4o2ZkJJNxpVVum66O5G+51ZXi52gTk7pxos5yNSjXqhIHElTCn9GLwz5YTVXJtLp M7Bl9y0MggzDfjny/29klM9WfgX/5C3jQ7r2i3Nbk5GQlH9sE7KrsW7uwOm75nlZT0QBjA YVCEvPXbpnmlqlceCKw0lXByFdUoEPsdghfkDQXkV+Q42GmLNp3bIF+PmnpTOpsQIhgh01 bf4knDRtT8U9G2X+dP+MqJb76LfEFHeP24K6OtAzB0scKZrdVIBS0kFClxSbiXH1ot4z2e I23KQyBvRPNTygT7lMKEtzbviW2tvcW3biG7pT673vJQOeFe63jrsFaZ1Q/84Y4olksUkD N/9xJQpM3CasQUG4HvV4Xn8b2KUiUoG7Zp6luqaLa8y+ImVHXLyVK2efXXeQ X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.ams.internal (Postfix, from userid 501) id DD8D232A009C; Wed, 2 Dec 2026 17:53:25 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-ThreadId: ApAsq4-PLDFJ Date: Wed, 02 Dec 2026 23:53:03 +0100 From: "Arnd Bergmann" To: "Catalin Marinas" , "Arnd Bergmann" Cc: linux-arm-kernel@lists.infradead.org, apais@microsoft.com, "Christian Borntraeger" , "Fuad Tabba" , hargar@linux.microsoft.com, "Joey Gouly" , "Marc Zyngier" , "Mark Rutland" , "Navneet Singh" , "Oliver Upton" , rlmenge@gmail.com, "Siddharth Chintamaneni" , "Steffen Eiden" , "Suzuki K Poulose" , "Sven Schnelle" , "Will Deacon" , "Zenghui Yu" , "Zhou Wang" , kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Message-Id: <0f482f23-53fc-4537-a11e-85ef20ce9859@app.fastmail.com> In-Reply-To: References: <20261126155339.1349218-1-arnd@kernel.org> <20261126155339.1349218-3-arnd@kernel.org> Subject: Re: [PATCH v2 2/3] arm64: add HWCAP3_LS64_ACCDATA Content-Type: text/plain Content-Transfer-Encoding: 7bit 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