[PATCH v4 1/2] KVM: arm64: Expose FEAT_LSFE to guests

Mark Brown posted 2 patches 1 week, 6 days ago
[PATCH v4 1/2] KVM: arm64: Expose FEAT_LSFE to guests
Posted by Mark Brown 1 week, 6 days ago
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
Re: [PATCH v4 1/2] KVM: arm64: Expose FEAT_LSFE to guests
Posted by Oliver Upton 1 week, 6 days ago
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
Re: [PATCH v4 1/2] KVM: arm64: Expose FEAT_LSFE to guests
Posted by Mark Brown 1 week, 6 days ago
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.
Re: (subset) [PATCH v4 1/2] KVM: arm64: Expose FEAT_LSFE to guests
Posted by Marc Zyngier 1 week, 5 days ago
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.