linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Add support for FEAT_{LS64, LS64_V} and related tests
@ 2025-03-31  9:43 Yicong Yang
  2025-03-31  9:43 ` [PATCH v2 1/6] arm64: Provide basic EL2 setup for FEAT_{LS64, LS64_V} usage at EL0/1 Yicong Yang
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Yicong Yang @ 2025-03-31  9:43 UTC (permalink / raw)
  To: catalin.marinas, will, maz, oliver.upton, corbet,
	linux-arm-kernel, kvmarm, linux-kselftest, linux-doc
  Cc: joey.gouly, suzuki.poulose, yuzenghui, shuah, jonathan.cameron,
	shameerali.kolothum.thodi, linuxarm, prime.zeng, xuwei5,
	yangyicong, tangchengchang

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}.
Add support for Armv8.7 FEAT_{LS64, LS64_V}:
- Add identifying and enabling in the cpufeature list
- Expose the support of these features to userspace through HWCAP3
  and cpuinfo
- Add related hwcap test
- Handle the trap of unsupported memory (normal/uncacheable) access in a VM

A real scenario for this feature is that the userspace driver can make use of
this to implement direct WQE (workqueue entry) - a mechanism to fill WQE
directly into the hardware.

This patchset also complement with Marc's patchset v2[1] for handling LS64*
trapped if not advertised for a VM.

[1] https://lore.kernel.org/linux-arm-kernel/20250310122505.2857610-1-maz@kernel.org/

Tested with updated hwcap test:
On host:
root@localhost:/tmp# dmesg | grep "All CPU(s) started"
[    0.504846] CPU: All CPU(s) started at EL2
root@localhost:/tmp# ./hwcap
[...]
# LS64 present
ok 217 cpuinfo_match_LS64
ok 218 sigill_LS64
ok 219 # SKIP sigbus_LS64
# LS64_V present
ok 220 cpuinfo_match_LS64_V
ok 221 sigill_LS64_V
ok 222 # SKIP sigbus_LS64_V
# 115 skipped test(s) detected. Consider enabling relevant config options to improve coverage.
# Totals: pass:107 fail:0 xfail:0 xpass:0 skip:115 error:0

On guest:
root@localhost:/# dmesg | grep "All CPU(s) started"
[    0.205580] CPU: All CPU(s) started at EL1
root@localhost:/mnt# ./hwcap
[...]
# LS64 present
ok 217 cpuinfo_match_LS64
ok 218 sigill_LS64
ok 219 # SKIP sigbus_LS64
# LS64_V present
ok 220 cpuinfo_match_LS64_V
ok 221 sigill_LS64_V
ok 222 # SKIP sigbus_LS64_V
# 115 skipped test(s) detected. Consider enabling relevant config options to improve coverage.
# Totals: pass:107 fail:0 xfail:0 xpass:0 skip:115 error:0

Change since v1:
- Drop the suppport for LS64_ACCDATA
- handle the DABT of unsupported memory type after checking the memory attributes
Link: https://lore.kernel.org/linux-arm-kernel/20241202135504.14252-1-yangyicong@huawei.com/

Yicong Yang (6):
  arm64: Provide basic EL2 setup for FEAT_{LS64, LS64_V} usage at EL0/1
  arm64: Add support for FEAT_{LS64, LS64_V}
  KVM: arm64: Enable FEAT_{LS64, LS64_V} in the supported guest
  kselftest/arm64: Add HWCAP test for FEAT_{LS64, LS64_V}
  arm64: Add ESR.DFSC definition of unsupported exclusive or atomic
    access
  KVM: arm64: Handle DABT caused by LS64* instructions on unsupported
    memory

 Documentation/arch/arm64/booting.rst      | 12 +++
 Documentation/arch/arm64/elf_hwcaps.rst   |  6 ++
 arch/arm64/include/asm/el2_setup.h        | 12 ++-
 arch/arm64/include/asm/esr.h              |  8 ++
 arch/arm64/include/asm/hwcap.h            |  2 +
 arch/arm64/include/asm/kvm_emulate.h      |  7 ++
 arch/arm64/include/uapi/asm/hwcap.h       |  2 +
 arch/arm64/kernel/cpufeature.c            | 51 +++++++++++++
 arch/arm64/kernel/cpuinfo.c               |  2 +
 arch/arm64/kvm/inject_fault.c             | 35 +++++++++
 arch/arm64/kvm/mmu.c                      | 37 +++++++++-
 arch/arm64/tools/cpucaps                  |  2 +
 tools/testing/selftests/arm64/abi/hwcap.c | 90 +++++++++++++++++++++++
 13 files changed, 264 insertions(+), 2 deletions(-)

-- 
2.24.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-04-29 14:47 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-31  9:43 [PATCH v2 0/6] Add support for FEAT_{LS64, LS64_V} and related tests Yicong Yang
2025-03-31  9:43 ` [PATCH v2 1/6] arm64: Provide basic EL2 setup for FEAT_{LS64, LS64_V} usage at EL0/1 Yicong Yang
2025-04-03  9:04   ` Suzuki K Poulose
2025-04-07  3:50     ` Yicong Yang
2025-04-29 14:47       ` Will Deacon
2025-04-29 14:47   ` Will Deacon
2025-03-31  9:43 ` [PATCH v2 2/6] arm64: Add support for FEAT_{LS64, LS64_V} Yicong Yang
2025-03-31  9:43 ` [PATCH v2 3/6] KVM: arm64: Enable FEAT_{LS64, LS64_V} in the supported guest Yicong Yang
2025-03-31  9:43 ` [PATCH v2 4/6] kselftest/arm64: Add HWCAP test for FEAT_{LS64, LS64_V} Yicong Yang
2025-03-31  9:43 ` [PATCH v2 5/6] arm64: Add ESR.DFSC definition of unsupported exclusive or atomic access Yicong Yang
2025-04-01 16:15   ` Oliver Upton
2025-04-07  3:33     ` Yicong Yang
2025-03-31  9:43 ` [PATCH v2 6/6] KVM: arm64: Handle DABT caused by LS64* instructions on unsupported memory Yicong Yang
2025-04-01 16:13   ` Oliver Upton
2025-04-07  3:33     ` Yicong Yang
2025-04-07  5:35       ` Oliver Upton
2025-04-08  8:11         ` Yicong Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).