[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 14/51] target/arm: Generalize cpu_arm_{get, set}_default_vec_l
From: |
Richard Henderson |
Subject: |
[PATCH v3 14/51] target/arm: Generalize cpu_arm_{get, set}_default_vec_len |
Date: |
Mon, 20 Jun 2022 10:51:58 -0700 |
Rename from cpu_arm_{get,set}_sve_default_vec_len,
and take the pointer to default_vq from opaque.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/cpu64.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index 1a3cb953bf..b15a0d398a 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -638,11 +638,11 @@ static void cpu_arm_set_sve(Object *obj, bool value,
Error **errp)
#ifdef CONFIG_USER_ONLY
/* Mirror linux /proc/sys/abi/sve_default_vector_length. */
-static void cpu_arm_set_sve_default_vec_len(Object *obj, Visitor *v,
- const char *name, void *opaque,
- Error **errp)
+static void cpu_arm_set_default_vec_len(Object *obj, Visitor *v,
+ const char *name, void *opaque,
+ Error **errp)
{
- ARMCPU *cpu = ARM_CPU(obj);
+ uint32_t *ptr_default_vq = opaque;
int32_t default_len, default_vq, remainder;
if (!visit_type_int32(v, name, &default_len, errp)) {
@@ -651,7 +651,7 @@ static void cpu_arm_set_sve_default_vec_len(Object *obj,
Visitor *v,
/* Undocumented, but the kernel allows -1 to indicate "maximum". */
if (default_len == -1) {
- cpu->sve_default_vq = ARM_MAX_VQ;
+ *ptr_default_vq = ARM_MAX_VQ;
return;
}
@@ -675,15 +675,15 @@ static void cpu_arm_set_sve_default_vec_len(Object *obj,
Visitor *v,
return;
}
- cpu->sve_default_vq = default_vq;
+ *ptr_default_vq = default_vq;
}
-static void cpu_arm_get_sve_default_vec_len(Object *obj, Visitor *v,
- const char *name, void *opaque,
- Error **errp)
+static void cpu_arm_get_default_vec_len(Object *obj, Visitor *v,
+ const char *name, void *opaque,
+ Error **errp)
{
- ARMCPU *cpu = ARM_CPU(obj);
- int32_t value = cpu->sve_default_vq * 16;
+ uint32_t *ptr_default_vq = opaque;
+ int32_t value = *ptr_default_vq * 16;
visit_type_int32(v, name, &value, errp);
}
@@ -706,8 +706,9 @@ void aarch64_add_sve_properties(Object *obj)
#ifdef CONFIG_USER_ONLY
/* Mirror linux /proc/sys/abi/sve_default_vector_length. */
object_property_add(obj, "sve-default-vector-length", "int32",
- cpu_arm_get_sve_default_vec_len,
- cpu_arm_set_sve_default_vec_len, NULL, NULL);
+ cpu_arm_get_default_vec_len,
+ cpu_arm_set_default_vec_len, NULL,
+ &cpu->sve_default_vq);
#endif
}
--
2.34.1
- [PATCH v3 02/51] target/arm: Add SMEEXC_EL to TB flags, (continued)
- [PATCH v3 02/51] target/arm: Add SMEEXC_EL to TB flags, Richard Henderson, 2022/06/20
- [PATCH v3 07/51] target/arm: Add SMIDR_EL1, SMPRI_EL1, SMPRIMAP_EL2, Richard Henderson, 2022/06/20
- [PATCH v3 04/51] target/arm: Add ARM_CP_SME, Richard Henderson, 2022/06/20
- [PATCH v3 06/51] target/arm: Add SMCR_ELx, Richard Henderson, 2022/06/20
- [PATCH v3 10/51] target/arm: Implement SMSTART, SMSTOP, Richard Henderson, 2022/06/20
- [PATCH v3 08/51] target/arm: Add PSTATE.{SM,ZA} to TB flags, Richard Henderson, 2022/06/20
- [PATCH v3 09/51] target/arm: Add the SME ZA storage to CPUARMState, Richard Henderson, 2022/06/20
- [PATCH v3 11/51] target/arm: Move error for sve%d property to arm_cpu_sve_finalize, Richard Henderson, 2022/06/20
- [PATCH v3 12/51] target/arm: Create ARMVQMap, Richard Henderson, 2022/06/20
- [PATCH v3 14/51] target/arm: Generalize cpu_arm_{get, set}_default_vec_len,
Richard Henderson <=
- [PATCH v3 16/51] target/arm: Unexport aarch64_add_*_properties, Richard Henderson, 2022/06/20
- [PATCH v3 13/51] target/arm: Generalize cpu_arm_{get,set}_vq, Richard Henderson, 2022/06/20
- [PATCH v3 17/51] target/arm: Add cpu properties for SME, Richard Henderson, 2022/06/20
- [PATCH v3 19/51] target/arm: Add SVL to TB flags, Richard Henderson, 2022/06/20
- [PATCH v3 20/51] target/arm: Move pred_{full, gvec}_reg_{offset, size} to translate-a64.h, Richard Henderson, 2022/06/20
- [PATCH v3 18/51] target/arm: Introduce sve_vqm1_for_el_sm, Richard Henderson, 2022/06/20
- [PATCH v3 22/51] target/arm: Trap AdvSIMD usage when Streaming SVE is active, Richard Henderson, 2022/06/20