From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Otte Subject: Re: [PATCH 3/6] kvm-s390: make sigp restart return busy when stop pending Date: Mon, 06 Feb 2012 12:53:42 +0100 Message-ID: <4F2FBF46.2090604@de.ibm.com> References: <1328522347-54635-1-git-send-email-borntraeger@de.ibm.com> <1328522347-54635-4-git-send-email-borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Marcelo Tossati , Alexander Graf , Jens Freimann , Cornelia Huck , Heiko Carstens , Martin Schwidefsky , KVM To: Christian Borntraeger Return-path: Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:34789 "EHLO e06smtp17.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753954Ab2BFLxt (ORCPT ); Mon, 6 Feb 2012 06:53:49 -0500 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 6 Feb 2012 11:53:47 -0000 Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q16Brh6A2547860 for ; Mon, 6 Feb 2012 11:53:43 GMT Received: from d06av04.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q16BrhAp016494 for ; Mon, 6 Feb 2012 04:53:43 -0700 In-Reply-To: <1328522347-54635-4-git-send-email-borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Am 06.02.2012 10:59, schrieb Christian Borntraeger: > +static int __sigp_restart(struct kvm_vcpu *vcpu, u16 cpu_addr) > +{ > + int rc = 0; > + struct kvm_s390_float_interrupt *fi =&vcpu->kvm->arch.float_int; > + > + spin_lock(&fi->lock); > + if (fi->local_int[cpu_addr]->action_bits& ACTION_STOP_ON_STOP) > + rc = 2; /* busy */ > + else > + VCPU_EVENT(vcpu, 4, "sigp restart %x to handle userspace", > + cpu_addr); > + spin_unlock(&fi->lock); > + > + return rc; > +} > local_int->action_bits is protected by the local int lock of subject CPU, as one can see in patch #2 of this series. This is racy.