From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxH2W-0007H8-8n for qemu-devel@nongnu.org; Fri, 03 Aug 2012 08:31:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SxH2P-00085A-3y for qemu-devel@nongnu.org; Fri, 03 Aug 2012 08:31:36 -0400 Received: from e06smtp18.uk.ibm.com ([195.75.94.114]:45450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SxH2O-00083a-RF for qemu-devel@nongnu.org; Fri, 03 Aug 2012 08:31:29 -0400 Received: from /spool/local by e06smtp18.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 3 Aug 2012 13:31:25 +0100 Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q73CVF4h39387264 for ; Fri, 3 Aug 2012 12:31:15 GMT 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 q73CVLYX012023 for ; Fri, 3 Aug 2012 06:31:21 -0600 Message-ID: <501BC499.7090908@de.ibm.com> Date: Fri, 03 Aug 2012 14:31:21 +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> <5017D6BF.3010106@suse.de> In-Reply-To: <5017D6BF.3010106@suse.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 4/7] s390: sclp event support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Andreas_F=E4rber?= Cc: blauwirbel@gmail.com, Heinz Graalfs , Alexander Graf , Jens Freimann , qemu-devel On 31/07/12 14:59, Andreas Färber wrote: >> +typedef struct EventTypes { >> + BusState qbus; >> + SCLPEventFacility *event_facility; >> +} EventTypes; >> + >> +struct SCLPEventFacility { >> + EventTypes sbus; >> + DeviceState *qdev; >> + /* guest' receive mask */ >> + unsigned int receive_mask; >> +}; > > The naming here strikes me as particularly odd... > > IIUC this Event Facility is a device sitting on the SCLP bus. > > But why does it expose a bus named "EventTypes"? Busses are usually > named ...Bus (PCIBus, IDEBus, etc.). So is this actually a bus? If not, > and if all you need is an SCLP-specific list API, maybe compare the > sPAPR hypercall registration API. So let me explain it and then we can see what is the right thing to do: The sclp itself is a service processor that will handle service calls and can send service interrupts. Most service calls deal with one specific thing: reading info, cpu hotplug, memory hotplug etc. Some of the service calls are special, because they form an event subsystem: Events are features that can notify the guest asynchronously. (e.g. system_powerdown is wired to signal quiesce which will be seen as ctrl-alt-del in the guest, or several console types where the input is sent as an event). The service calls are read_event_data, write_event_data and write_event_mask. write_event_mask is used by the guest to notify the host about its event capabilities and to the query the host events. read_event_data allows a guest to get event data - iow host2guest data. guest2host traffic also goes via the event mechanism, e.g. console output is send via write_event_data. So each event implements several callbacks: event_pending to tell that this event is pending, read event data to fill in the buffer with the event data, write_event_data if the event allows guest2host traffic. There are also two bits per event that tell if that specific event will allow read/write event data. Since some of the events implement complex things (console) a bus seemed appropriate, but there are of course other ways of implementing. Comments? Christian