intercept.c (bbb20089a3275a19e475dbc21320c3742e3ca423) intercept.c (9ace903d171db7dc2fed96e44ac62b6f4c3ccb3d)
1/*
2 * intercept.c - in-kernel handling for sie intercepts
3 *
4 * Copyright IBM Corp. 2008
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License (version 2 only)
8 * as published by the Free Software Foundation.

--- 114 unchanged lines hidden (view full) ---

123 default:
124 break; /* nothing */
125 }
126 return 0;
127}
128
129static int handle_stop(struct kvm_vcpu *vcpu)
130{
1/*
2 * intercept.c - in-kernel handling for sie intercepts
3 *
4 * Copyright IBM Corp. 2008
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License (version 2 only)
8 * as published by the Free Software Foundation.

--- 114 unchanged lines hidden (view full) ---

123 default:
124 break; /* nothing */
125 }
126 return 0;
127}
128
129static int handle_stop(struct kvm_vcpu *vcpu)
130{
131 int rc;
131 int rc = 0;
132
133 vcpu->stat.exit_stop_request++;
134 atomic_clear_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags);
135 spin_lock_bh(&vcpu->arch.local_int.lock);
136 if (vcpu->arch.local_int.action_bits & ACTION_STORE_ON_STOP) {
137 vcpu->arch.local_int.action_bits &= ~ACTION_STORE_ON_STOP;
138 rc = __kvm_s390_vcpu_store_status(vcpu,
139 KVM_S390_STORE_STATUS_NOADDR);
140 if (rc >= 0)
141 rc = -ENOTSUPP;
142 }
143
132
133 vcpu->stat.exit_stop_request++;
134 atomic_clear_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags);
135 spin_lock_bh(&vcpu->arch.local_int.lock);
136 if (vcpu->arch.local_int.action_bits & ACTION_STORE_ON_STOP) {
137 vcpu->arch.local_int.action_bits &= ~ACTION_STORE_ON_STOP;
138 rc = __kvm_s390_vcpu_store_status(vcpu,
139 KVM_S390_STORE_STATUS_NOADDR);
140 if (rc >= 0)
141 rc = -ENOTSUPP;
142 }
143
144 if (vcpu->arch.local_int.action_bits & ACTION_RELOADVCPU_ON_STOP) {
145 vcpu->arch.local_int.action_bits &= ~ACTION_RELOADVCPU_ON_STOP;
146 rc = SIE_INTERCEPT_RERUNVCPU;
147 vcpu->run->exit_reason = KVM_EXIT_INTR;
148 }
149
144 if (vcpu->arch.local_int.action_bits & ACTION_STOP_ON_STOP) {
145 vcpu->arch.local_int.action_bits &= ~ACTION_STOP_ON_STOP;
146 VCPU_EVENT(vcpu, 3, "%s", "cpu stopped");
147 rc = -ENOTSUPP;
150 if (vcpu->arch.local_int.action_bits & ACTION_STOP_ON_STOP) {
151 vcpu->arch.local_int.action_bits &= ~ACTION_STOP_ON_STOP;
152 VCPU_EVENT(vcpu, 3, "%s", "cpu stopped");
153 rc = -ENOTSUPP;
148 } else
149 rc = 0;
154 }
155
150 spin_unlock_bh(&vcpu->arch.local_int.lock);
151 return rc;
152}
153
154static int handle_validity(struct kvm_vcpu *vcpu)
155{
156 int viwhy = vcpu->arch.sie_block->ipb >> 16;
157 int rc;

--- 76 unchanged lines hidden ---
156 spin_unlock_bh(&vcpu->arch.local_int.lock);
157 return rc;
158}
159
160static int handle_validity(struct kvm_vcpu *vcpu)
161{
162 int viwhy = vcpu->arch.sie_block->ipb >> 16;
163 int rc;

--- 76 unchanged lines hidden ---