KVM: s390: handle stop irqs without action_bits
This patch removes the famous action_bits and moves the handling of SIGP STOP AND STORE STATUS directly into the SIGP STOP interrupt. The new local interrupt infrastructure is used to track pending stop requests. STOP irqs are the only irqs that don't get actively delivered. They remain pending until the stop function is executed (=stop intercept). If another STOP irq is already pending, -EBUSY will now be returned (needed for the SIGP handling code). Migration of pending SIGP STOP (AND STORE STATUS) orders should now be supported out of the box. Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
This commit is contained in:

committed by
Christian Borntraeger

parent
2822545f9f
commit
6cddd432e3
@@ -68,18 +68,23 @@ static int handle_noop(struct kvm_vcpu *vcpu)
|
||||
|
||||
static int handle_stop(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
|
||||
int rc = 0;
|
||||
unsigned int action_bits;
|
||||
uint8_t flags, stop_pending;
|
||||
|
||||
vcpu->stat.exit_stop_request++;
|
||||
trace_kvm_s390_stop_request(vcpu->arch.local_int.action_bits);
|
||||
|
||||
action_bits = vcpu->arch.local_int.action_bits;
|
||||
/* avoid races with the injection/SIGP STOP code */
|
||||
spin_lock(&li->lock);
|
||||
flags = li->irq.stop.flags;
|
||||
stop_pending = kvm_s390_is_stop_irq_pending(vcpu);
|
||||
spin_unlock(&li->lock);
|
||||
|
||||
if (!(action_bits & ACTION_STOP_ON_STOP))
|
||||
trace_kvm_s390_stop_request(stop_pending, flags);
|
||||
if (!stop_pending)
|
||||
return 0;
|
||||
|
||||
if (action_bits & ACTION_STORE_ON_STOP) {
|
||||
if (flags & KVM_S390_STOP_FLAG_STORE_STATUS) {
|
||||
rc = kvm_s390_vcpu_store_status(vcpu,
|
||||
KVM_S390_STORE_STATUS_NOADDR);
|
||||
if (rc)
|
||||
|
Reference in New Issue
Block a user