• Heiko Carstens's avatar
    s390/vx: fix save/restore of fpu kernel context · e6b2dab4
    Heiko Carstens authored
    The KERNEL_FPR mask only contains a flag for the first eight vector
    registers. However floating point registers overlay parts of the first
    sixteen vector registers.
    
    This could lead to vector register corruption if a kernel fpu context uses
    any of the vector registers 8 to 15 and is interrupted or calls a
    KERNEL_FPR context. If that context uses also vector registers 8 to 15,
    their contents will be corrupted on return.
    
    Luckily this is currently not a real bug, since the kernel has only one
    KERNEL_FPR user with s390_adjust_jiffies() and it is only using floating
    point registers 0 to 2.
    
    Fix this by using the correct bits for KERNEL_FPR.
    
    Fixes: 7f79695c ("s390/fpu: improve kernel_fpu_[begin|end]")
    Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
    Reviewed-by: default avatarHendrik Brueckner <brueckner@linux.ibm.com>
    Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
    e6b2dab4
api.h 3.77 KB