[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 30/71] target/arm: Implement SMSTART, SMSTOP
From: |
Peter Maydell |
Subject: |
Re: [PATCH 30/71] target/arm: Implement SMSTART, SMSTOP |
Date: |
Mon, 6 Jun 2022 17:50:13 +0100 |
On Thu, 2 Jun 2022 at 23:09, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> These two instructions are aliases of MSR (immediate).
> Use the two helpers to properly implement svcr_write.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> +/* ResetSVEState */
> +void arm_reset_sve_state(CPUARMState *env)
> +{
> + memset(env->vfp.zregs, 0, sizeof(env->vfp.zregs));
> + memset(env->vfp.pregs, 0, sizeof(env->vfp.pregs));
> + vfp_set_fpcr(env, 0x0800009f);
> +}
Would be helpful to have a brief comment reminding the reader
that this includes clearing FFR because QEMU keeps that in
pregs[16].
> +
> +void helper_set_pstate_sm(CPUARMState *env, uint32_t i)
> +{
> + if (i == FIELD_EX64(env->svcr, SVCR, SM)) {
> + return;
> + }
> + env->svcr ^= R_SVCR_SM_MASK;
> + arm_reset_sve_state(env);
> +}
> +
> +void helper_set_pstate_za(CPUARMState *env, uint32_t i)
> +{
> + if (i == FIELD_EX64(env->svcr, SVCR, ZA)) {
> + return;
> + }
> + env->svcr ^= R_SVCR_ZA_MASK;
> +
> + /*
> + * ResetSMEState.
> + *
> + * SetPSTATE_ZA zeros on enable and disable. It would appear that we
> + * can zero this only on enable: while disabled, the storage is
> + * inaccessible and the value does not matter. We're not saving the
> + * storage in vmstate when disabled either.
> + */
Correct. You can drop the "It would appear" :-)
> + if (i) {
> + memset(env->zarray, 0, sizeof(env->zarray));
> + }
> +}
Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
- [PATCH 25/71] target/arm: Add SVCR, (continued)
- [PATCH 25/71] target/arm: Add SVCR, Richard Henderson, 2022/06/02
- [PATCH 24/71] target/arm: Add ARM_CP_SME, Richard Henderson, 2022/06/02
- [PATCH 27/71] target/arm: Add SMIDR_EL1, SMPRI_EL1, SMPRIMAP_EL2, Richard Henderson, 2022/06/02
- [PATCH 29/71] target/arm: Add the SME ZA storage to CPUARMState, Richard Henderson, 2022/06/02
- [PATCH 30/71] target/arm: Implement SMSTART, SMSTOP, Richard Henderson, 2022/06/02
- Re: [PATCH 30/71] target/arm: Implement SMSTART, SMSTOP,
Peter Maydell <=
- [PATCH 33/71] target/arm: Generalize cpu_arm_{get,set}_vq, Richard Henderson, 2022/06/02
- [PATCH 31/71] target/arm: Move error for sve%d property to arm_cpu_sve_finalize, Richard Henderson, 2022/06/02
- [PATCH 32/71] target/arm: Create ARMVQMap, Richard Henderson, 2022/06/02
- [PATCH 35/71] target/arm: Move arm_cpu_*_finalize to internals.h, Richard Henderson, 2022/06/02
- [PATCH 36/71] target/arm: Unexport aarch64_add_*_properties, Richard Henderson, 2022/06/02