Skip to content

Commit 8eeba19

Browse files
efarmanborntraeger
authored andcommitted
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: b697e43 ("KVM: s390: Support Configuration z/Architecture Mode") Signed-off-by: Eric Farman <[email protected]> Reviewed-by: Thomas Huth <[email protected]> Reviewed-by: Claudio Imbrenda <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Reviewed-by: Christian Borntraeger <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Borntraeger <[email protected]>
1 parent f0a1a06 commit 8eeba19

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

arch/s390/kvm/sigp.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -151,22 +151,10 @@ static int __sigp_stop_and_store_status(struct kvm_vcpu *vcpu,
151151
static int __sigp_set_arch(struct kvm_vcpu *vcpu, u32 parameter,
152152
u64 *status_reg)
153153
{
154-
unsigned int i;
155-
struct kvm_vcpu *v;
156-
bool all_stopped = true;
157-
158-
kvm_for_each_vcpu(i, v, vcpu->kvm) {
159-
if (v == vcpu)
160-
continue;
161-
if (!is_vcpu_stopped(v))
162-
all_stopped = false;
163-
}
164-
165154
*status_reg &= 0xffffffff00000000UL;
166155

167156
/* Reject set arch order, with czam we're always in z/Arch mode. */
168-
*status_reg |= (all_stopped ? SIGP_STATUS_INVALID_PARAMETER :
169-
SIGP_STATUS_INCORRECT_STATE);
157+
*status_reg |= SIGP_STATUS_INVALID_PARAMETER;
170158
return SIGP_CC_STATUS_STORED;
171159
}
172160

0 commit comments

Comments
 (0)