* [PATCH v4 0/2] arm64: Support FEAT_LSFE (Large System Float Extension)
@ 2025-09-18 19:42 Mark Brown
2025-09-18 19:42 ` [PATCH v4 1/2] KVM: arm64: Expose FEAT_LSFE to guests Mark Brown
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Mark Brown @ 2025-09-18 19:42 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Jonathan Corbet, Marc Zyngier,
Oliver Upton, Joey Gouly, Suzuki K Poulose, Shuah Khan
Cc: linux-arm-kernel, linux-doc, linux-kernel, kvmarm,
linux-kselftest, Mark Brown
FEAT_LSFE is optional from v9.5, it adds new instructions for atomic
memory operations with floating point values. We have no immediate use
for it in kernel, provide a hwcap so userspace can discover it and allow
the ID register field to be exposed to KVM guests.
Signed-off-by: Mark Brown <broonie@kernel.org>
---
Changes in v4:
- Rebase onto arm64/for-next/cpufeature, note that both patches have
build dependencies on this.
- Drop unneeded cc clobber in hwcap.
- Use STRFADD as the instruction probed in hwcap.
- Link to v3: https://lore.kernel.org/r/20250818-arm64-lsfe-v3-0-af6f4d66eb39@kernel.org
Changes in v3:
- Rebase onto v6.17-rc1.
- Link to v2: https://lore.kernel.org/r/20250703-arm64-lsfe-v2-0-eced80999cb4@kernel.org
Changes in v2:
- Fix result of vi dropping in hwcap test.
- Link to v1: https://lore.kernel.org/r/20250627-arm64-lsfe-v1-0-68351c4bf741@kernel.org
---
Mark Brown (2):
KVM: arm64: Expose FEAT_LSFE to guests
kselftest/arm64: Add lsfe to the hwcaps test
arch/arm64/kvm/sys_regs.c | 4 +++-
tools/testing/selftests/arm64/abi/hwcap.c | 21 +++++++++++++++++++++
2 files changed, 24 insertions(+), 1 deletion(-)
---
base-commit: 220928e52cb03d223b3acad3888baf0687486d21
change-id: 20250625-arm64-lsfe-0810cf98adc2
Best regards,
--
Mark Brown <broonie@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v4 1/2] KVM: arm64: Expose FEAT_LSFE to guests
2025-09-18 19:42 [PATCH v4 0/2] arm64: Support FEAT_LSFE (Large System Float Extension) Mark Brown
@ 2025-09-18 19:42 ` Mark Brown
2025-09-18 20:57 ` Oliver Upton
2025-09-19 14:43 ` (subset) " Marc Zyngier
2025-09-18 19:42 ` [PATCH v4 2/2] kselftest/arm64: Add lsfe to the hwcaps test Mark Brown
2025-09-19 18:38 ` [PATCH v4 0/2] arm64: Support FEAT_LSFE (Large System Float Extension) Will Deacon
2 siblings, 2 replies; 7+ messages in thread
From: Mark Brown @ 2025-09-18 19:42 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Jonathan Corbet, Marc Zyngier,
Oliver Upton, Joey Gouly, Suzuki K Poulose, Shuah Khan
Cc: linux-arm-kernel, linux-doc, linux-kernel, kvmarm,
linux-kselftest, Mark Brown
FEAT_LSFE (Large System Float Extension), providing atomic floating point
memory operations, is optional from v9.5. This feature adds no new
architectural state, expose the relevant ID register field to guests so
they can discover it.
Signed-off-by: Mark Brown <broonie@kernel.org>
---
arch/arm64/kvm/sys_regs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
index 82ffb3b3b3cf..08e2cb94bff3 100644
--- a/arch/arm64/kvm/sys_regs.c
+++ b/arch/arm64/kvm/sys_regs.c
@@ -1642,7 +1642,8 @@ static u64 __kvm_read_sanitised_id_reg(const struct kvm_vcpu *vcpu,
val &= ~ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_WFxT);
break;
case SYS_ID_AA64ISAR3_EL1:
- val &= ID_AA64ISAR3_EL1_FPRCVT | ID_AA64ISAR3_EL1_FAMINMAX;
+ val &= ID_AA64ISAR3_EL1_FPRCVT | ID_AA64ISAR3_EL1_LSFE |
+ ID_AA64ISAR3_EL1_FAMINMAX;
break;
case SYS_ID_AA64MMFR2_EL1:
val &= ~ID_AA64MMFR2_EL1_CCIDX_MASK;
@@ -2991,6 +2992,7 @@ static const struct sys_reg_desc sys_reg_descs[] = {
ID_AA64ISAR2_EL1_APA3 |
ID_AA64ISAR2_EL1_GPA3)),
ID_WRITABLE(ID_AA64ISAR3_EL1, (ID_AA64ISAR3_EL1_FPRCVT |
+ ID_AA64ISAR3_EL1_LSFE |
ID_AA64ISAR3_EL1_FAMINMAX)),
ID_UNALLOCATED(6,4),
ID_UNALLOCATED(6,5),
--
2.47.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v4 2/2] kselftest/arm64: Add lsfe to the hwcaps test
2025-09-18 19:42 [PATCH v4 0/2] arm64: Support FEAT_LSFE (Large System Float Extension) Mark Brown
2025-09-18 19:42 ` [PATCH v4 1/2] KVM: arm64: Expose FEAT_LSFE to guests Mark Brown
@ 2025-09-18 19:42 ` Mark Brown
2025-09-19 18:38 ` [PATCH v4 0/2] arm64: Support FEAT_LSFE (Large System Float Extension) Will Deacon
2 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2025-09-18 19:42 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Jonathan Corbet, Marc Zyngier,
Oliver Upton, Joey Gouly, Suzuki K Poulose, Shuah Khan
Cc: linux-arm-kernel, linux-doc, linux-kernel, kvmarm,
linux-kselftest, Mark Brown
This feature has no traps associated with it so the SIGILL is not reliable.
Signed-off-by: Mark Brown <broonie@kernel.org>
---
tools/testing/selftests/arm64/abi/hwcap.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c
index 002ec38a8bbb..0f9a64932481 100644
--- a/tools/testing/selftests/arm64/abi/hwcap.c
+++ b/tools/testing/selftests/arm64/abi/hwcap.c
@@ -17,6 +17,8 @@
#include <asm/sigcontext.h>
#include <asm/unistd.h>
+#include <linux/auxvec.h>
+
#include "../../kselftest.h"
#define TESTS_PER_HWCAP 3
@@ -169,6 +171,18 @@ static void lse128_sigill(void)
: "cc", "memory");
}
+static void lsfe_sigill(void)
+{
+ float __attribute__ ((aligned (16))) mem;
+ register float *memp asm ("x0") = &mem;
+
+ /* STFADD H0, [X0] */
+ asm volatile(".inst 0x7c20801f"
+ : "+r" (memp)
+ :
+ : "memory");
+}
+
static void lut_sigill(void)
{
/* LUTI2 V0.16B, { V0.16B }, V[0] */
@@ -762,6 +776,13 @@ static const struct hwcap_data {
.cpuinfo = "lse128",
.sigill_fn = lse128_sigill,
},
+ {
+ .name = "LSFE",
+ .at_hwcap = AT_HWCAP3,
+ .hwcap_bit = HWCAP3_LSFE,
+ .cpuinfo = "lsfe",
+ .sigill_fn = lsfe_sigill,
+ },
{
.name = "LUT",
.at_hwcap = AT_HWCAP2,
--
2.47.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v4 1/2] KVM: arm64: Expose FEAT_LSFE to guests
2025-09-18 19:42 ` [PATCH v4 1/2] KVM: arm64: Expose FEAT_LSFE to guests Mark Brown
@ 2025-09-18 20:57 ` Oliver Upton
2025-09-18 21:17 ` Mark Brown
2025-09-19 14:43 ` (subset) " Marc Zyngier
1 sibling, 1 reply; 7+ messages in thread
From: Oliver Upton @ 2025-09-18 20:57 UTC (permalink / raw)
To: Mark Brown
Cc: Catalin Marinas, Will Deacon, Jonathan Corbet, Marc Zyngier,
Joey Gouly, Suzuki K Poulose, Shuah Khan, linux-arm-kernel,
linux-doc, linux-kernel, kvmarm, linux-kselftest
On Thu, Sep 18, 2025 at 08:42:06PM +0100, Mark Brown wrote:
> FEAT_LSFE (Large System Float Extension), providing atomic floating point
> memory operations, is optional from v9.5. This feature adds no new
> architectural state, expose the relevant ID register field to guests so
> they can discover it.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
We also need a test in set_id_regs.c selftest for the writability of
this new feature field.
Otherwise:
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Thanks,
Oliver
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4 1/2] KVM: arm64: Expose FEAT_LSFE to guests
2025-09-18 20:57 ` Oliver Upton
@ 2025-09-18 21:17 ` Mark Brown
0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2025-09-18 21:17 UTC (permalink / raw)
To: Oliver Upton
Cc: Catalin Marinas, Will Deacon, Jonathan Corbet, Marc Zyngier,
Joey Gouly, Suzuki K Poulose, Shuah Khan, linux-arm-kernel,
linux-doc, linux-kernel, kvmarm, linux-kselftest
[-- Attachment #1: Type: text/plain, Size: 235 bytes --]
On Thu, Sep 18, 2025 at 01:57:13PM -0700, Oliver Upton wrote:
> We also need a test in set_id_regs.c selftest for the writability of
> this new feature field.
Sure. We seem to be missing some existing fields from that register
too.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: (subset) [PATCH v4 1/2] KVM: arm64: Expose FEAT_LSFE to guests
2025-09-18 19:42 ` [PATCH v4 1/2] KVM: arm64: Expose FEAT_LSFE to guests Mark Brown
2025-09-18 20:57 ` Oliver Upton
@ 2025-09-19 14:43 ` Marc Zyngier
1 sibling, 0 replies; 7+ messages in thread
From: Marc Zyngier @ 2025-09-19 14:43 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon, Jonathan Corbet, Oliver Upton,
Joey Gouly, Suzuki K Poulose, Shuah Khan, Mark Brown
Cc: linux-arm-kernel, linux-doc, linux-kernel, kvmarm,
linux-kselftest
On Thu, 18 Sep 2025 20:42:06 +0100, Mark Brown wrote:
> FEAT_LSFE (Large System Float Extension), providing atomic floating point
> memory operations, is optional from v9.5. This feature adds no new
> architectural state, expose the relevant ID register field to guests so
> they can discover it.
>
>
Applied to next, thanks!
[1/2] KVM: arm64: Expose FEAT_LSFE to guests
commit: 5d20605c8e7930254f7bee41336e421be247181c
Cheers,
M.
--
Without deviation from the norm, progress is not possible.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4 0/2] arm64: Support FEAT_LSFE (Large System Float Extension)
2025-09-18 19:42 [PATCH v4 0/2] arm64: Support FEAT_LSFE (Large System Float Extension) Mark Brown
2025-09-18 19:42 ` [PATCH v4 1/2] KVM: arm64: Expose FEAT_LSFE to guests Mark Brown
2025-09-18 19:42 ` [PATCH v4 2/2] kselftest/arm64: Add lsfe to the hwcaps test Mark Brown
@ 2025-09-19 18:38 ` Will Deacon
2 siblings, 0 replies; 7+ messages in thread
From: Will Deacon @ 2025-09-19 18:38 UTC (permalink / raw)
To: Catalin Marinas, Jonathan Corbet, Marc Zyngier, Oliver Upton,
Joey Gouly, Suzuki K Poulose, Shuah Khan, Mark Brown
Cc: kernel-team, Will Deacon, linux-arm-kernel, linux-doc,
linux-kernel, kvmarm, linux-kselftest
On Thu, 18 Sep 2025 20:42:05 +0100, Mark Brown wrote:
> FEAT_LSFE is optional from v9.5, it adds new instructions for atomic
> memory operations with floating point values. We have no immediate use
> for it in kernel, provide a hwcap so userspace can discover it and allow
> the ID register field to be exposed to KVM guests.
>
>
Applied selftest update to arm64 (for-next/selftests), thanks!
[2/2] kselftest/arm64: Add lsfe to the hwcaps test
https://git.kernel.org/arm64/c/777fb19ed8d6
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-09-19 18:38 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-18 19:42 [PATCH v4 0/2] arm64: Support FEAT_LSFE (Large System Float Extension) Mark Brown
2025-09-18 19:42 ` [PATCH v4 1/2] KVM: arm64: Expose FEAT_LSFE to guests Mark Brown
2025-09-18 20:57 ` Oliver Upton
2025-09-18 21:17 ` Mark Brown
2025-09-19 14:43 ` (subset) " Marc Zyngier
2025-09-18 19:42 ` [PATCH v4 2/2] kselftest/arm64: Add lsfe to the hwcaps test Mark Brown
2025-09-19 18:38 ` [PATCH v4 0/2] arm64: Support FEAT_LSFE (Large System Float Extension) Will Deacon
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).