]> www.infradead.org Git - nvme.git/commitdiff
s390/fpu: Re-add exception handling in load_fpu_state()
authorHeiko Carstens <hca@linux.ibm.com>
Thu, 25 Jul 2024 09:31:52 +0000 (11:31 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 31 Jul 2024 14:30:20 +0000 (16:30 +0200)
With the recent rewrite of the fpu code exception handling for the
lfpc instruction within load_fpu_state() was erroneously removed.

Add it again to prevent that loading invalid floating point register
values cause an unhandled specification exception.

Fixes: 8c09871a950a ("s390/fpu: limit save and restore to used registers")
Cc: stable@vger.kernel.org
Reported-by: Aristeu Rozanski <aris@redhat.com>
Tested-by: Aristeu Rozanski <aris@redhat.com>
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/fpu.c

index fa90bbdc5ef9467c70dcba01f11e2d2ed273e115..6f2e87920288ac6d377279470a1763805fb0b71a 100644 (file)
@@ -113,7 +113,7 @@ void load_fpu_state(struct fpu *state, int flags)
        int mask;
 
        if (flags & KERNEL_FPC)
-               fpu_lfpc(&state->fpc);
+               fpu_lfpc_safe(&state->fpc);
        if (!cpu_has_vx()) {
                if (flags & KERNEL_VXR_V0V7)
                        load_fp_regs_vx(state->vxrs);