]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: s390: sthyi: fix specification exception detection
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Thu, 3 Aug 2017 12:27:30 +0000 (14:27 +0200)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Mon, 21 Aug 2017 13:34:54 +0000 (15:34 +0200)
commit133d12ee1abf1326a825758c2ca8759843cf47df
tree3afa2096610f6a5f76f8234c0e10ee3233003c71
parentafaf9e51b771bb4aebae9edb7895fc3bc29952b7
KVM: s390: sthyi: fix specification exception detection

sthyi should only generate a specification exception if the function
code is zero and the response buffer is not on a 4k boundary.

The current code would also test for unknown function codes if the
response buffer, that is currently only defined for function code 0,
is not on a 4k boundary and incorrectly inject a specification
exception instead of returning with condition code 3 and return code 4
(unsupported function code).

Fix this by moving the boundary check.

Fixes: 2450ce82d300 ("KVM: s390: Add sthyi emulation")
Cc: <stable@vger.kernel.org> # 4.8+
Reviewed-by: Janosch Frank <frankja@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/sthyi.c