KVM: s390: Simplify SIGP Set Arch handling
authorEric Farman <farman@linux.ibm.com>
Fri, 8 Oct 2021 20:31:07 +0000 (22:31 +0200)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Mon, 25 Oct 2021 07:20:39 +0000 (09:20 +0200)
commit8eeba194a32e0f50329354a696baaa2e3d9accc5
tree1063e1235c7dd645a92d643e11ee45a9b1a4546e
parentf0a1a0615a6ff6d38af2c65a522698fb4bb85df6
KVM: s390: Simplify SIGP Set Arch handling

The Principles of Operations describe the various reasons that
each individual SIGP orders might be rejected, and the status
bit that are set for each condition.

For example, for the Set Architecture order, it states:

  "If it is not true that all other CPUs in the configu-
   ration are in the stopped or check-stop state, ...
   bit 54 (incorrect state) ... is set to one."

However, it also states:

  "... if the CZAM facility is installed, ...
   bit 55 (invalid parameter) ... is set to one."

Since the Configuration-z/Architecture-Architectural Mode (CZAM)
facility is unconditionally presented, there is no need to examine
each VCPU to determine if it is started/stopped. It can simply be
rejected outright with the Invalid Parameter bit.

Fixes: b697e435aeee ("KVM: s390: Support Configuration z/Architecture Mode")
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Link: https://lore.kernel.org/r/20211008203112.1979843-2-farman@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/sigp.c