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=1796252024; b=bpRtdPMHiuHnOZI2qW5KPBSg5SKJU7M7fL/nYXGYXUavBie+5dWbZRaY6UODt7AycD63 z+vCVZGwpmbFFZVqskp17A2VqgD0e9uLDPoZwXQKqA2FEtaqJinA/V7Rc/qW4CKYBKrzK cIYZG/2lxoaOGROPbwfk32X23OMZhxKXDr+wGfZcodjWjdCeVsCT/RIPYRHo26ijnO2g0 f/6SrLNJk7qBd46C5eZzqhKZcA5rJQk8z3kqQzxt80jGHfWQeX1IWyuji5ZlxoLeUhfuS AFWMZ1JXKCIfpuB8iteJofX5DOWlz+qv8pmsygVFIkV4N149W8NDc49gk1f1ji8DUOA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796252024; 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=W873Y90dmVXveOo4YU/9EblRNgUjg0YqAjCSh9W+NWzAuTJh7L4Hb8/0KaRqfVB/qFxE GEKgk1LXqmLcGBbIW8I5qjhxH/gcbwfKJmkaobg/Q2Yk2ajjrQFBptK7RIr7sAVAToYOk CcADbThKCg9G2A2GKL6wnLfRlAY1GsrnsHtrabtO8y1XIKzONbS31A5ow3QXR1wIrU208 39LDJi1+y7kHEtIxFcC8GaazzXQZKwAzrP6qG2J8HovYnLCAC6R59m+ThcEEjypORZ33x bl45T3IO2XefiCkqcSRrXSk/jyCk2uJjp9Azx3PQ2jiLYFuFHb9VYe1b9vZDq2U2i8g== 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) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20C37606A32C for ; Wed, 2 Dec 2026 22:53:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 20C37606A32C 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 132CEEC0326 for ; Wed, 2 Dec 2026 17:53:42 -0500 (EST) Received: from ams-imap-03 ([10.64.2.23]) by ams-compute-02.internal (MEProxy); Wed, 02 Dec 2026 17:53:43 -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=PGt2bWFybUBsaXN0cy5saW51eC5kZXY+; s=fm3:rsa-sha256:X9jP/onielJFBE92vtozMQYh2oFB1WP9aWkpb0HtVU/v7Qe ZEzsxbWuwDS8ThfiVLi9XMSbOau/auyaIcNNePJ4xXZ4d6p2ci2rD9Yk42EZhS6I RKJnbN/Z074M0KgU1ONs5GjrEqKJtOAal44irMUpfs/3arDIBX/Sf/G/0AJl1bXX rYC/yuQrM15j2CV+ZHcTOEUe6dUaiW+T47rYsxbg58N/6RrKWVFsoLLFUiNambtD XpHVX6uyc5nV6TN4dxbmhXksITWGHoYw/2qkoOZC7kL2cKMmuCGqgNLofA2gCWhk Ntoy7+JiV0SLQ8nwASx0lv1zuFNDXey9v3E2q4w==; 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: kvmarm@lists.linux.dev 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