]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
powerpc: Fix inconsistent Altivec handling in set_mcontext
authorShawn Anastasio <sanastasio@raptorengineering.com>
Fri, 3 Nov 2023 17:40:18 +0000 (14:40 -0300)
committerAlfredo Dal'Ava Junior <alfredo@FreeBSD.org>
Fri, 3 Nov 2023 17:55:04 +0000 (14:55 -0300)
commit270f75cf3433807d124cdf1f0072ab801532f425
treeabc4ee8a68949f30b61bf7aaf208782863b8ead4
parent1f90b4edffe815aebb35e74b79e10593b31f6b75
powerpc: Fix inconsistent Altivec handling in set_mcontext

When support for fpu_kern_enter/fpu_kern_leave was added to powerpc,
set_mcontext was updated to handle Altivec state restoration in the same
way that the FPU state by lazily restoring the context on the first
trap. However the function was not correctly updated to unconditionally
clear the PCB_VEC and PSL_VEC bits from the pcb's flags and srr1
respectively which can sometimes result in a mismatch between a
process's MSR[VEC] state and its pcb_flags.

Fix this by simply clearing the VEC flags unconditionally in
set_mcontext, which is already done for FPU/VSX.

Fixes: a6662c37b6ffe ("powerpc: Implement fpu_kern_enter/fpu_kern_leave")
Reviewed by: alfredo
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D42417
sys/powerpc/powerpc/exec_machdep.c