On 5/19/22 03:40, Peter Maydell wrote:
Not all the code that looks at the sve vector length goes through sve_zcr_len_for_el(), though. In particular, this is setting up ZCR_EL1 for usermode, and all the code under linux-user/ that wants to know the vector length does it with "env->vfp.zcr_el[1] & 0xf".
Oops, yes. Linux-user should be checking ZCR_LEN from env->hflags.
Incidentally, do_prctl_set_vl() also sets zcr_el[1] and it doesn't call aarch64_sve_zcr_get_valid_len(). Should it, or is it doing an equivalent check anyway?
I think this got missed when we introduced the set of valid lengths -- it's still assuming all lengths less than maximum are valid.
I'll add a couple of cleanup patches for this. r~