public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel•org>
To: Zhou Wang <wangzhou1@hisilicon•com>
Cc: <catalin.marinas@arm•com>, <will@kernel•org>,
	<oliver.upton@linux•dev>, <joey.gouly@arm•com>,
	<suzuki.poulose@arm•com>, <yuzenghui@huawei•com>, <arnd@arndb•de>,
	<linux-arm-kernel@lists•infradead.org>, <kvmarm@lists•linux.dev>,
	<yangyccccc@gmail•com>, <prime.zeng@hisilicon•com>,
	<xuwei5@huawei•com>
Subject: Re: [PATCH v7 5/7] arm64: Add support for FEAT_{LS64, LS64_V}
Date: Tue, 11 Nov 2025 11:15:25 +0000	[thread overview]
Message-ID: <861pm4vn02.wl-maz@kernel.org> (raw)
In-Reply-To: <20251107072127.448953-6-wangzhou1@hisilicon.com>

On Fri, 07 Nov 2025 07:21:25 +0000,
Zhou Wang <wangzhou1@hisilicon•com> wrote:
> 
> From: Yicong Yang <yangyicong@hisilicon•com>
> 
> Armv8.7 introduces single-copy atomic 64-byte loads and stores
> instructions and its variants named under FEAT_{LS64, LS64_V}.
> These features are identified by ID_AA64ISAR1_EL1.LS64 and the
> use of such instructions in userspace (EL0) can be trapped. In
> order to support the use of corresponding instructions in userspace:
> - Make ID_AA64ISAR1_EL1.LS64 visbile to userspace
> - Add identifying and enabling in the cpufeature list
> - Expose these support of these features to userspace through HWCAP3
>   and cpuinfo
> 
> ld64b/st64b (FEAT_LS64) and st64bv (FEAT_LS64_V) is intended for
> special memory (device memory) so requires support by the CPU, system
> and target memory location (device that support these instructions).
> The HWCAP3_{LS64, LS64_V} implies the support of CPU and system (since
> no identification method from system, so SoC vendors should advertise
> support in the CPU if system also support them).

But this doesn't mean that the system actually supports this. It is
also trivial for EL0 to spoof a PASID using ST64BV, by populating the
bottom 32bit with whatever it wants (hiding ST64BV0 doesn't prevent
this).

In all honestly, I'm starting to think that we cannot safely expose
this to userspace, at least not without strong guarantees coming from
the system itself.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.


  parent reply	other threads:[~2025-11-11 11:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07  7:21 [PATCH v7 0/7] Add support for FEAT_{LS64, LS64_V} and related tests Zhou Wang
2025-11-07  7:21 ` [PATCH v7 1/7] KVM: arm64: Add exit to userspace on {LD,ST}64B* outside of memslots Zhou Wang
2025-11-07 11:48   ` Suzuki K Poulose
2025-11-07 11:49     ` Suzuki K Poulose
2025-11-11  2:12     ` Zhou Wang
2025-11-07  7:21 ` [PATCH v7 2/7] KVM: arm64: Add documentation for KVM_EXIT_ARM_LDST64B Zhou Wang
2025-11-07  7:21 ` [PATCH v7 3/7] KVM: arm64: Handle DABT caused by LS64* instructions on unsupported memory Zhou Wang
2025-11-07  7:21 ` [PATCH v7 4/7] arm64: Provide basic EL2 setup for FEAT_{LS64, LS64_V} usage at EL0/1 Zhou Wang
2025-11-07  7:21 ` [PATCH v7 5/7] arm64: Add support for FEAT_{LS64, LS64_V} Zhou Wang
2025-11-07 12:05   ` Suzuki K Poulose
2025-11-11  3:40     ` Zhou Wang
2025-11-11 11:15   ` Marc Zyngier [this message]
2025-11-13 14:40     ` Zhou Wang
2025-11-13 16:26       ` Arnd Bergmann
2025-11-14  9:25         ` Zhou Wang
2025-11-14  9:37           ` Arnd Bergmann
2025-11-18  2:31             ` Zhou Wang
2025-11-18  7:36               ` Arnd Bergmann
2025-11-27  3:51                 ` Zhou Wang
2025-11-27 15:37                   ` Arnd Bergmann
2025-12-05  6:47                     ` Zhou Wang
2025-12-05  7:09                       ` Arnd Bergmann
2025-11-07  7:21 ` [PATCH v7 6/7] KVM: arm64: Enable FEAT_{LS64, LS64_V} in the supported guest Zhou Wang
2025-11-07 18:53   ` Oliver Upton
2025-11-11  3:43     ` Zhou Wang
2025-11-07  7:21 ` [PATCH v7 7/7] kselftest/arm64: Add HWCAP test for FEAT_{LS64, LS64_V} Zhou Wang
2025-11-07  9:21   ` Arnd Bergmann
2025-11-07  9:23 ` [PATCH v7 0/7] Add support for FEAT_{LS64, LS64_V} and related tests Arnd Bergmann
2025-11-07 18:57 ` Oliver Upton

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=861pm4vn02.wl-maz@kernel.org \
    --to=maz@kernel$(echo .)org \
    --cc=arnd@arndb$(echo .)de \
    --cc=catalin.marinas@arm$(echo .)com \
    --cc=joey.gouly@arm$(echo .)com \
    --cc=kvmarm@lists$(echo .)linux.dev \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=oliver.upton@linux$(echo .)dev \
    --cc=prime.zeng@hisilicon$(echo .)com \
    --cc=suzuki.poulose@arm$(echo .)com \
    --cc=wangzhou1@hisilicon$(echo .)com \
    --cc=will@kernel$(echo .)org \
    --cc=xuwei5@huawei$(echo .)com \
    --cc=yangyccccc@gmail$(echo .)com \
    --cc=yuzenghui@huawei$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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