On 10/11/23 00:24, Cornelia Huck wrote:
We can use read_sys_reg64 to get the SVE_VLS register instead of
calling GET_ONE_REG directly.
Suggested-by: Gavin Shan <gshan@xxxxxxxxxx>
Signed-off-by: Cornelia Huck <cohuck@xxxxxxxxxx>
---
target/arm/kvm64.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
Reviewed-by: Gavin Shan <gshan@xxxxxxxxxx>
diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c
index 558c0b88dd69..d40c89a84752 100644
--- a/target/arm/kvm64.c
+++ b/target/arm/kvm64.c
@@ -500,10 +500,6 @@ uint32_t kvm_arm_sve_get_vls(CPUState *cs)
.target = -1,
.features[0] = (1 << KVM_ARM_VCPU_SVE),
};
- struct kvm_one_reg reg = {
- .id = KVM_REG_ARM64_SVE_VLS,
- .addr = (uint64_t)&vls[0],
- };
int fdarray[3], ret;
probed = true;
@@ -512,7 +508,7 @@ uint32_t kvm_arm_sve_get_vls(CPUState *cs)
error_report("failed to create scratch VCPU with SVE enabled");
abort();
}
- ret = ioctl(fdarray[2], KVM_GET_ONE_REG, ®);
+ ret = read_sys_reg64(fdarray[2], &vls[0], KVM_REG_ARM64_SVE_VLS);
kvm_arm_destroy_scratch_host_vcpu(fdarray);
if (ret) {
error_report("failed to get KVM_REG_ARM64_SVE_VLS: %s",