summaryrefslogtreecommitdiff
path: root/arch/arm64/kvm/arm.c
diff options
context:
space:
mode:
authorOliver Upton <oliver.upton@linux.dev>2023-09-20 19:50:31 +0000
committerOliver Upton <oliver.upton@linux.dev>2023-09-21 18:13:28 +0000
commitbe9c0c018389e0722a97ac5cd3152afff1111e37 (patch)
tree0eac554530e24e12598a4c2ab5a0021bee14be64 /arch/arm64/kvm/arm.c
parent9116db11feb521d9eaa850d3a6a8b713f59c6971 (diff)
KVM: arm64: Hoist SVE check into KVM_ARM_VCPU_INIT ioctl handler
Test that the system supports SVE before ever getting to kvm_reset_vcpu(). Link: https://lore.kernel.org/r/20230920195036.1169791-4-oliver.upton@linux.dev Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'arch/arm64/kvm/arm.c')
-rw-r--r--arch/arm64/kvm/arm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index 18cbd3c9a4d7..e73e134fa2fa 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -1200,6 +1200,9 @@ static unsigned long system_supported_vcpu_features(void)
if (!kvm_arm_support_pmu_v3())
clear_bit(KVM_ARM_VCPU_PMU_V3, &features);
+ if (!system_supports_sve())
+ clear_bit(KVM_ARM_VCPU_SVE, &features);
+
return features;
}