From: "Arnd Bergmann" <arnd@arndb.de>
To: "Zhou Wang" <wangzhou1@hisilicon.com>, "Marc Zyngier" <maz@kernel.org>
Cc: "Catalin Marinas" <catalin.marinas@arm.com>,
"Will Deacon" <will@kernel.org>,
"Oliver Upton" <oliver.upton@linux.dev>,
"Joey Gouly" <joey.gouly@arm.com>,
"Suzuki K Poulose" <suzuki.poulose@arm.com>,
"Zenghui Yu" <yuzenghui@huawei.com>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
"Yicong Yang" <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: Thu, 27 Nov 2025 16:37:42 +0100 [thread overview]
Message-ID: <7d2ea8c6-e54f-4a57-843c-e0c6c33c02c5@app.fastmail.com> (raw)
In-Reply-To: <e6cffbce-7cd4-3fe3-a9bd-935efedaebd0@hisilicon.com>
On Thu, Nov 27, 2025, at 04:51, Zhou Wang wrote:
> On 2025/11/18 15:36, Arnd Bergmann wrote:
>> On Tue, Nov 18, 2025, at 03:31, Zhou Wang wrote:
>>
>> The easiest setup I can think of that still supports your machine
>> would look something like:
>>
>> - have the kernel choose between st64bv and st64bv0 at early boot,
>> based on platform configuration, use st64bv0 by default if
>> available in hardware and not disabled in EL3, EL2 or kernel
>> command line.
>> - Change pasid handling in iommu_sva_bind_device() so drivers
>> have to explicitly request one of the modes before establishing
>> a pasid, refuse this on incompatible systems, update the
>> three existing callers (idxd, amdxdna, uacce) accordingly.
>> - on systems with st64bv but no st64bv0, enable st64bv for
>> all CPUs at boot time to avoid context switch overhead, but
>> forbid mapping shared hardware workqueues into userspace.
>> - postpone full support for st64bv0 until we have a device that
>> actually uses this and can be tested. I think most of it is
>> already there in the iommu code, but the ACCDATA setup needs
>> to be integrated into the switch_mm()/__switch_to() code
>> and possibly a trap handler like on x86.
>
> Hi Arnd,
>
> Sorry for late to reply, I double checked with our SoC and device
> colleagues, currently only st64b has been used in our system.
>
> So I think we could upstream FEAT_LS64 firstly as it seems easy
> to be merged. After this, we continue to discuss FEAT_LS64V and
> FEAT_LS64_ACCDATA solution if there is a real system need them.
As I understand it, using ST64B is usually more efficient than
ST64BV if you can use either, since it is a normal posted bus
transaction rather than a synchronous atomic. If that works for
you, I think what we should plan for is to let you use ST64B
on this particular hardware and never support ST64BV from
userspace, the same way we do it on Intel hardware with ENQCMD.
As there are already CPUs out there that do include ST64BV0,
I think we also want to support those soon. Not having to
support both ST64BV and ST64BV0 from userspace makes it a lot
easier, but I think we'd still want to only enable ST64BV0
on a per-task base when mapping a shared workqueued into the
user address space on a task that has an active mm->iommu_mm.
If that makes sense to you, I can try to come up with a
prototype based on your current patches to add the context
switching and enable logic.
Arnd
next prev parent reply other threads:[~2025-11-27 15:38 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
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 [this message]
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=7d2ea8c6-e54f-4a57-843c-e0c6c33c02c5@app.fastmail.com \
--to=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=prime.zeng@hisilicon.com \
--cc=suzuki.poulose@arm.com \
--cc=wangzhou1@hisilicon.com \
--cc=will@kernel.org \
--cc=xuwei5@huawei.com \
--cc=yangyccccc@gmail.com \
--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