aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2024-02-03 11:45:00 +0100
committerHeiko Carstens <hca@linux.ibm.com>2024-02-16 14:30:14 +0100
commitb6b842becd734301349b2fbe8d31099ea3d22a0f (patch)
tree6b14f3c53bcb0b3dbf5d101d887dc55be6d63e8a /arch/s390
parent9e96afab8c0fadafc3fa2dbb2f233a641d7fe229 (diff)
downloadlinux-b6b842becd734301349b2fbe8d31099ea3d22a0f.tar.gz
s390/fpu: use KERNEL_VXR_LOW instead of KERNEL_VXR_V0V7
Use KERNEL_VXR_LOW instead of KERNEL_VXR_V0V7 for configurations without vector registers in order to decide if floating point registers need to be saved and restored. Kernel FPU areas which use floating point registers are supposed to use the KERNEL_FPR mask, however users may also open-code this and specify KERNEL_VXR_V0V7 and/or KERNEL_VXR_V8V15. If only KERNEL_VXR_V8V15 is specified floating point registers wouldn't be saved and restored. Improve this and check for both bits. There are currently no users where this would fix a bug. Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/fpu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/kernel/fpu.c b/arch/s390/kernel/fpu.c
index a4f3449cc8141..21c9885cfb211 100644
--- a/arch/s390/kernel/fpu.c
+++ b/arch/s390/kernel/fpu.c
@@ -25,7 +25,7 @@ void __kernel_fpu_begin(struct kernel_fpu *state, u32 flags)
asm volatile("stfpc %0" : "=Q" (state->fpc));
if (!cpu_has_vx()) {
- if (flags & KERNEL_VXR_V0V7) {
+ if (flags & KERNEL_VXR_LOW) {
/* Save floating-point registers */
asm volatile("std 0,%0" : "=Q" (state->fprs[0]));
asm volatile("std 1,%0" : "=Q" (state->fprs[1]));
@@ -107,7 +107,7 @@ void __kernel_fpu_end(struct kernel_fpu *state, u32 flags)
asm volatile("lfpc %0" : : "Q" (state->fpc));
if (!cpu_has_vx()) {
- if (flags & KERNEL_VXR_V0V7) {
+ if (flags & KERNEL_VXR_LOW) {
/* Restore floating-point registers */
asm volatile("ld 0,%0" : : "Q" (state->fprs[0]));
asm volatile("ld 1,%0" : : "Q" (state->fprs[1]));