Commit a6cc3108 authored by David Hildenbrand's avatar David Hildenbrand Committed by Christian Borntraeger

KVM: s390: sigp: split handling of SIGP STOP (AND STORE STATUS)

In preparation for further code changes (e.g. getting rid of action_flags),
this patch splits the handling of the two sigp orders SIGP STOP and SIGP STOP
AND STORE STATUS by introducing a separate handler function for SIGP STOP AND
STORE STATUS.
Signed-off-by: default avatarDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Acked-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
parent 07b03035
...@@ -147,15 +147,27 @@ static int __inject_sigp_stop(struct kvm_vcpu *dst_vcpu, int action) ...@@ -147,15 +147,27 @@ static int __inject_sigp_stop(struct kvm_vcpu *dst_vcpu, int action)
return rc; return rc;
} }
static int __sigp_stop(struct kvm_vcpu *vcpu, struct kvm_vcpu *dst_vcpu, static int __sigp_stop(struct kvm_vcpu *vcpu, struct kvm_vcpu *dst_vcpu)
int action)
{ {
int rc; int rc;
rc = __inject_sigp_stop(dst_vcpu, action); rc = __inject_sigp_stop(dst_vcpu, ACTION_STOP_ON_STOP);
VCPU_EVENT(vcpu, 4, "sent sigp stop to cpu %x", dst_vcpu->vcpu_id); VCPU_EVENT(vcpu, 4, "sent sigp stop to cpu %x", dst_vcpu->vcpu_id);
if ((action & ACTION_STORE_ON_STOP) != 0 && rc == -ESHUTDOWN) { return rc;
}
static int __sigp_stop_and_store_status(struct kvm_vcpu *vcpu,
struct kvm_vcpu *dst_vcpu, u64 *reg)
{
int rc;
rc = __inject_sigp_stop(dst_vcpu, ACTION_STOP_ON_STOP |
ACTION_STORE_ON_STOP);
VCPU_EVENT(vcpu, 4, "sent sigp stop and store status to cpu %x",
dst_vcpu->vcpu_id);
if (rc == -ESHUTDOWN) {
/* If the CPU has already been stopped, we still have /* If the CPU has already been stopped, we still have
* to save the status when doing stop-and-store. This * to save the status when doing stop-and-store. This
* has to be done after unlocking all spinlocks. */ * has to be done after unlocking all spinlocks. */
...@@ -347,12 +359,11 @@ static int handle_sigp_dst(struct kvm_vcpu *vcpu, u8 order_code, ...@@ -347,12 +359,11 @@ static int handle_sigp_dst(struct kvm_vcpu *vcpu, u8 order_code,
break; break;
case SIGP_STOP: case SIGP_STOP:
vcpu->stat.instruction_sigp_stop++; vcpu->stat.instruction_sigp_stop++;
rc = __sigp_stop(vcpu, dst_vcpu, ACTION_STOP_ON_STOP); rc = __sigp_stop(vcpu, dst_vcpu);
break; break;
case SIGP_STOP_AND_STORE_STATUS: case SIGP_STOP_AND_STORE_STATUS:
vcpu->stat.instruction_sigp_stop_store_status++; vcpu->stat.instruction_sigp_stop_store_status++;
rc = __sigp_stop(vcpu, dst_vcpu, ACTION_STORE_ON_STOP | rc = __sigp_stop_and_store_status(vcpu, dst_vcpu, status_reg);
ACTION_STOP_ON_STOP);
break; break;
case SIGP_STORE_STATUS_AT_ADDRESS: case SIGP_STORE_STATUS_AT_ADDRESS:
vcpu->stat.instruction_sigp_store_status++; vcpu->stat.instruction_sigp_store_status++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment