[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 20/71] target/arm: Add ID_AA64SMFR0_EL1
From: |
Peter Maydell |
Subject: |
Re: [PATCH 20/71] target/arm: Add ID_AA64SMFR0_EL1 |
Date: |
Mon, 6 Jun 2022 14:05:06 +0100 |
On Thu, 2 Jun 2022 at 23:17, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> This register is allocated from the existing block of id registers,
> so it is already RES0 for cpus that do not implement SME.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> --- a/target/arm/kvm64.c
> +++ b/target/arm/kvm64.c
> @@ -682,13 +682,14 @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures
> *ahcf)
> ahcf->isar.id_aa64pfr0 = t;
>
> /*
> - * Before v5.1, KVM did not support SVE and did not expose
> - * ID_AA64ZFR0_EL1 even as RAZ. After v5.1, KVM still does
> - * not expose the register to "user" requests like this
> - * unless the host supports SVE.
> + * KVM began exposing the unallocated ID registers as RAZ in 4.15.
> + * Using SVE supported is an easy way to tell if these registers
> + * are exposed, since both of these depend on SVE anyway.
> */
This slightly loses context described in the old comment, though the
old comment isn't quite correct either. Between kernel commits 73433762fcae
(part of the initial implementation of SVE support) and f81cb2c3ad41 (which
fixed this bug), the kernel did indeed not expose ID_AA64ZFR0_EL1 as RAZ if
SVE was not implemented. So there's a range of kernels that had this
bug and for which we need to guard the access to ID_AA64ZFR0_EL1.
This isn't the case for ID_AA64SMFR0_EL1, though, which all kernels
should handle correctly (ignoring the pre-4.15 case).
So I think:
(1) we should read ID_AA64SMFR0_EL1 further up in the same code
block where we read all the other ID registers like id_aa64mmfr0 etc.
(2) separately, we should update this comment to read something like:
/*
* There is a range of kernels between kernel commit 73433762fcae
* and f81cb2c3ad41 which have a bug where the kernel doesn't expose
* SYS_ID_AA64ZFR0_EL1 via the ONE_REG API unless the VM has enabled
* SVE support, so we only read it here, rather than together with all
* the other ID registers earlier.
*/
Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
- [PATCH 05/71] target/arm: Add el_is_in_host, (continued)
- [PATCH 05/71] target/arm: Add el_is_in_host, Richard Henderson, 2022/06/02
- [PATCH 10/71] target/arm: Merge aarch64_sve_zcr_get_valid_len into caller, Richard Henderson, 2022/06/02
- [PATCH 12/71] target/arm: Rename sve_zcr_len_for_el to sve_vqm1_for_el, Richard Henderson, 2022/06/02
- [PATCH 11/71] target/arm: Use uint32_t instead of bitmap for sve vq's, Richard Henderson, 2022/06/02
- [PATCH 13/71] target/arm: Split out load/store primitives to sve_ldst_internal.h, Richard Henderson, 2022/06/02
- [PATCH 15/71] target/arm: Move expand_pred_b to vec_internal.h, Richard Henderson, 2022/06/02
- [PATCH 16/71] target/arm: Use expand_pred_b in mve_helper.c, Richard Henderson, 2022/06/02
- [PATCH 17/71] target/arm: Move expand_pred_h to vec_internal.h, Richard Henderson, 2022/06/02
- [PATCH 20/71] target/arm: Add ID_AA64SMFR0_EL1, Richard Henderson, 2022/06/02
- Re: [PATCH 20/71] target/arm: Add ID_AA64SMFR0_EL1,
Peter Maydell <=
- [PATCH 22/71] target/arm: Add SMEEXC_EL to TB flags, Richard Henderson, 2022/06/02
- [PATCH 28/71] target/arm: Add PSTATE.{SM,ZA} to TB flags, Richard Henderson, 2022/06/02
- [PATCH 18/71] target/arm: Export bfdotadd from vec_helper.c, Richard Henderson, 2022/06/02
- [PATCH 19/71] target/arm: Add isar_feature_aa64_sme, Richard Henderson, 2022/06/02
- [PATCH 14/71] target/arm: Export sve contiguous ldst support functions, Richard Henderson, 2022/06/02