]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
s390: do not bypass BPENTER for interrupt system calls
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 27 Apr 2018 05:36:55 +0000 (07:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 29 Apr 2018 05:50:03 +0000 (07:50 +0200)
[ Upstream commit d5feec04fe578c8dbd9e2e1439afc2f0af761ed4 ]

The system call path can be interrupted before the switch back to the
standard branch prediction with BPENTER has been done. The critical
section cleanup code skips forward to .Lsysc_do_svc and bypasses the
BPENTER. In this case the kernel and all subsequent code will run with
the limited branch prediction.

Fixes: eacf67eb9b32 ("s390: run user space and KVM guests with modified branch prediction")
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/kernel/entry.S

index beda1c33ca12666d4478253b7728b7d2c4b1194f..2c71cdf2a4f0a013c4a665b35bb631a07c30c25f 100644 (file)
@@ -1299,7 +1299,8 @@ cleanup_critical:
        srag    %r9,%r9,23
        jz      0f
        mvc     __TI_last_break(8,%r12),16(%r11)
-0:     # set up saved register r11
+0:     BPENTER __TI_flags(%r12),_TIF_ISOLATE_BP
+       # set up saved register r11
        lg      %r15,__LC_KERNEL_STACK
        la      %r9,STACK_FRAME_OVERHEAD(%r15)
        stg     %r9,24(%r11)            # r11 pt_regs pointer