From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvrFJ-0001O1-NM for qemu-devel@nongnu.org; Mon, 30 Jul 2012 10:47:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SvrFF-0000Il-FJ for qemu-devel@nongnu.org; Mon, 30 Jul 2012 10:46:57 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:40171) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvrFF-0000IU-2V for qemu-devel@nongnu.org; Mon, 30 Jul 2012 10:46:53 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 30 Jul 2012 15:46:51 +0100 Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6UEkmw12973744 for ; Mon, 30 Jul 2012 15:46:48 +0100 Received: from d06av09.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6UEkmgq015513 for ; Mon, 30 Jul 2012 08:46:48 -0600 Message-ID: <50169E57.5010203@de.ibm.com> Date: Mon, 30 Jul 2012 16:46:47 +0200 From: Christian Borntraeger MIME-Version: 1.0 References: <1343115430-34285-1-git-send-email-borntraeger@de.ibm.com> <1343115430-34285-5-git-send-email-borntraeger@de.ibm.com> <9EB25248-1A13-4519-A034-DE1707D7FE61@suse.de> In-Reply-To: <9EB25248-1A13-4519-A034-DE1707D7FE61@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/7] s390: sclp event support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-devel , blauwirbel@gmail.com, Heinz Graalfs , Jens Freimann , afaerber@suse.de On 30/07/12 15:24, Alexander Graf wrote: Thanks for the review. Here is just a short answer regarding the interrupt, we will adress the other comments in a later mail. >> void sclp_service_interrupt(uint32_t sccb) >> { >> - if (!sccb) { >> + SCLPEventFacility *ef = sbus->event_facility->instance; >> + int event_pending = sbus->event_facility->event_pending(ef); >> + >> + if (!event_pending && !sccb) { >> return; >> } > > Uh. So when there's no event pending no sclp call may trigger an interrupt? No. If there is no event pending AND no sccb was specified, then we have nothing to report --> no interrupt. An service interrupt has a 32bit value as payload. Bits 0-28 (in IBM speak, 31-3 in Linux speak) contain the sccb address (if any), the other bits are special. The LSB describes if there are still events pending. So an unsolicited interrupt will only set the LSB. An answer to a service call will always contain the sccb and might have the lsb set if there are events pending. >> - s390_sclp_extint(sccb & ~3); >> + s390_sclp_extint((sccb & ~3) + event_pending); > > event_pending returns a bool, right? Please make this code a bit less magical :). Something like "event_pending?1:0" ?