]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.0.8/kvm-s390-fix-external-call-injection-without-sigp-interpretation.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.0.8 / kvm-s390-fix-external-call-injection-without-sigp-interpretation.patch
1 From b938eacea0b6881f2116a061e6da3ec840e75137 Mon Sep 17 00:00:00 2001
2 From: David Hildenbrand <dahi@linux.vnet.ibm.com>
3 Date: Thu, 30 Apr 2015 13:33:59 +0200
4 Subject: KVM: s390: fix external call injection without sigp interpretation
5
6 From: David Hildenbrand <dahi@linux.vnet.ibm.com>
7
8 commit b938eacea0b6881f2116a061e6da3ec840e75137 upstream.
9
10 Commit ea5f49692575 ("KVM: s390: only one external call may be pending
11 at a time") introduced a bug on machines that don't have SIGP
12 interpretation facility installed.
13 The injection of an external call will now always fail with -EBUSY
14 (if none is already pending).
15
16 This leads to the following symptoms:
17 - An external call will be injected but with the wrong "src cpu id",
18 as this id will not be remembered.
19 - The target vcpu will not be woken up, therefore the guest will hang if
20 it cannot deal with unexpected failures of the SIGP EXTERNAL CALL
21 instruction.
22 - If an external call is already pending, -EBUSY will not be reported.
23
24 Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
25 Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
26 Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
27 Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
28 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29
30 ---
31 arch/s390/kvm/interrupt.c | 2 +-
32 1 file changed, 1 insertion(+), 1 deletion(-)
33
34 --- a/arch/s390/kvm/interrupt.c
35 +++ b/arch/s390/kvm/interrupt.c
36 @@ -1037,7 +1037,7 @@ static int __inject_extcall(struct kvm_v
37 if (sclp_has_sigpif())
38 return __inject_extcall_sigpif(vcpu, src_id);
39
40 - if (!test_and_set_bit(IRQ_PEND_EXT_EXTERNAL, &li->pending_irqs))
41 + if (test_and_set_bit(IRQ_PEND_EXT_EXTERNAL, &li->pending_irqs))
42 return -EBUSY;
43 *extcall = irq->u.extcall;
44 atomic_set_mask(CPUSTAT_EXT_INT, li->cpuflags);