mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
powerpc: Fix altivec disabling in set_mcontext()
We somewhat blindly copy the srr1 from the new context to the trap frame, but disable FPU and VSX unconditionally, relying on the trap to re-enable them. This works because the FPU manages the VSX extended FP registers, which is governed by the PCB_FPFREGS flag. However, with altivec, we would blindly disable PSL_VEC, without touching PCB_VEC. Handle this case by disabling altivec in both srr1 and pcb_flags, if the mcontext doesn't have _MC_AV_VALID set. Reported by: pkubaj
This commit is contained in:
parent
21935a41fd
commit
31091dea96
1 changed files with 3 additions and 0 deletions
|
|
@ -526,6 +526,9 @@ set_mcontext(struct thread *td, mcontext_t *mcp)
|
|||
pcb->pcb_vec.vscr = mcp->mc_vscr;
|
||||
pcb->pcb_vec.vrsave = mcp->mc_vrsave;
|
||||
memcpy(pcb->pcb_vec.vr, mcp->mc_avec, sizeof(mcp->mc_avec));
|
||||
} else {
|
||||
tf->srr1 &= ~PSL_VEC;
|
||||
pcb->pcb_flags &= ~PCB_VEC;
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue