diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c --- a/sys/arm64/arm64/vfp.c +++ b/sys/arm64/arm64/vfp.c @@ -934,12 +934,15 @@ pcb = td->td_pcb; + if (td == curthread && (pcb->pcb_fpflags & PCB_FP_STARTED) != 0) + vfp_save_state(td, pcb); + /* If there is no SVE support in HW then we don't support NT_ARM_SVE */ if (pcb->pcb_sve_len == 0) return (false); sve_flags = 0; - if ((pcb->pcb_fpflags & PCB_FP_SVEVALID) == 0) { + if (pcb->pcb_svesaved == NULL) { /* If SVE hasn't been used yet provide the VFP registers */ buf_size = sizeof(struct fpreg); sve_flags |= SVEREG_FLAG_FP; @@ -947,17 +950,12 @@ /* We have SVE registers */ buf_size = sve_buf_size(td); sve_flags |= SVEREG_FLAG_SVE; - KASSERT(pcb->pcb_svesaved != NULL, ("%s: no saved sve", - __func__)); } if (buf != NULL) { KASSERT(*sizep == sizeof(struct svereg_header) + buf_size, ("%s: invalid size", __func__)); - if (td == curthread && (pcb->pcb_fpflags & PCB_FP_STARTED) != 0) - vfp_save_state(td, pcb); - header = buf; memset(header, 0, sizeof(*header));