On Fri, Mar 06, 2026 at 05:01:06PM +0000, Mark Brown wrote:
> +#define vcpu_max_vl(vcpu) max(vcpu_sve_max_vl(vcpu), vcpu_sme_max_vl(vcpu))
> +#define vcpu_max_vq(vcpu) sve_vq_from_vl(vcpu_max_vl(vcpu))
> +
> +/* Current for the hypervisor */

Not sure what this means, isn't it also current for the guest?

> +#define vcpu_cur_sve_vl(vcpu) (vcpu_in_streaming_mode(vcpu) ? \
> +                            vcpu_sme_max_vl(vcpu) : vcpu_sve_max_vl(vcpu))
> +
> +/* Pointer to the vcpu's SVE FFR for sve_{save,load}_state() */
> +#define vcpu_sve_pffr(vcpu) (kern_hyp_va((vcpu)->arch.sve_state) +   \
> +                          sve_ffr_offset(vcpu_cur_sve_vl(vcpu)))
>  
>  #define vcpu_sve_zcr_elx(vcpu)                                               
> \
>       (unlikely(is_hyp_ctxt(vcpu)) ? ZCR_EL2 : ZCR_EL1)
> diff --git a/arch/arm64/include/uapi/asm/kvm.h 
> b/arch/arm64/include/uapi/asm/kvm.h
> index c67564f02981..498a49a61487 100644
> --- a/arch/arm64/include/uapi/asm/kvm.h
> +++ b/arch/arm64/include/uapi/asm/kvm.h
> @@ -354,6 +354,15 @@ struct kvm_arm_counter_offset {
>  #define KVM_ARM64_SVE_VLS_WORDS      \
>       ((KVM_ARM64_SVE_VQ_MAX - KVM_ARM64_SVE_VQ_MIN) / 64 + 1)
>  
> +/* SME registers */
> +#define KVM_REG_ARM64_SME            (0x17 << KVM_REG_ARM_COPROC_SHIFT)
> +
> +/* Vector lengths pseudo-register: */
> +#define KVM_REG_ARM64_SME_VLS                (KVM_REG_ARM64 | 
> KVM_REG_ARM64_SME | \
> +                                      KVM_REG_SIZE_U512 | 0xfffe)
> +#define KVM_ARM64_SME_VLS_WORDS      \
> +     ((KVM_ARM64_SVE_VQ_MAX - KVM_ARM64_SVE_VQ_MIN) / 64 + 1)

I think this could be removed: it's never used and the doc describes only
SVE_VLS_WORDS for both SME and SVE. Maybe we could have a "VEC_VLS_WORDS"
alias but using the SVE one seems fine to me.

Rest looks good

Thanks,
Jean`

Reply via email to