HomeFreeBSD

powerpc: Fix altivec disabling in set_mcontext()

Description

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

Details

Provenance
jhibbitsAuthored on
Parents
rS357606: cxgbe(4): Add native netmap support to the main interface.
Branches
Unknown
Tags
Unknown