Skip to content

Commit e6b2dab

Browse files
hcahcaAlexander Gordeev
authored andcommitted
s390/vx: fix save/restore of fpu kernel context
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: 7f79695 ("s390/fpu: improve kernel_fpu_[begin|end]") Signed-off-by: Heiko Carstens <[email protected]> Reviewed-by: Hendrik Brueckner <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
1 parent b1a6a1a commit e6b2dab

File tree

1 file changed

+1
-1
lines changed
  • arch/s390/include/asm/fpu

1 file changed

+1
-1
lines changed

arch/s390/include/asm/fpu/api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static inline int test_fp_ctl(u32 fpc)
7979
#define KERNEL_VXR_HIGH (KERNEL_VXR_V16V23|KERNEL_VXR_V24V31)
8080

8181
#define KERNEL_VXR (KERNEL_VXR_LOW|KERNEL_VXR_HIGH)
82-
#define KERNEL_FPR (KERNEL_FPC|KERNEL_VXR_V0V7)
82+
#define KERNEL_FPR (KERNEL_FPC|KERNEL_VXR_LOW)
8383

8484
struct kernel_fpu;
8585

0 commit comments

Comments
 (0)