]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: s390: fix guarded storage control register handling
authorHeiko Carstens <hca@linux.ibm.com>
Thu, 15 Apr 2021 08:01:27 +0000 (10:01 +0200)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Thu, 15 Apr 2021 13:35:38 +0000 (15:35 +0200)
commita7d3759a178247723c0b85b0f00e3d8ff44b9889
tree9d8abaa6692d72930a6a105e7edcfbecd0b29ce1
parent466991c00f43bacb9c68d3c897b6da9a6eaeb11c
KVM: s390: fix guarded storage control register handling

store_regs_fmt2() has an ordering problem: first the guarded storage
facility is enabled on the local cpu, then preemption disabled, and
then the STGSC (store guarded storage controls) instruction is
executed.

If the process gets scheduled away between enabling the guarded
storage facility and before preemption is disabled, this might lead to
a special operation exception and therefore kernel crash as soon as
the process is scheduled back and the STGSC instruction is executed.

Fixes: 90eab7c635fd ("KVM: s390: gs support for kvm guests")
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Cc: <stable@vger.kernel.org> # 4.12
Link: https://lore.kernel.org/r/20210415080127.1061275-1-hca@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/kvm-s390.c