From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtFSt-0003C8-3F for qemu-devel@nongnu.org; Tue, 25 Nov 2014 07:43:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XtFSk-0007XC-0t for qemu-devel@nongnu.org; Tue, 25 Nov 2014 07:43:31 -0500 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:44352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtFSj-0007X3-O9 for qemu-devel@nongnu.org; Tue, 25 Nov 2014 07:43:21 -0500 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Nov 2014 12:43:19 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 96CFD1B08070 for ; Tue, 25 Nov 2014 12:43:32 +0000 (GMT) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sAPChIC857081988 for ; Tue, 25 Nov 2014 12:43:18 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sAPChH8G027472 for ; Tue, 25 Nov 2014 05:43:17 -0700 Date: Tue, 25 Nov 2014 13:43:17 +0100 From: Frank Blaschka Message-ID: <20141125124317.GA28363@tuxmaker.boeblingen.de.ibm.com> References: <1415629216-59652-1-git-send-email-blaschka@linux.vnet.ibm.com> <1415629216-59652-2-git-send-email-blaschka@linux.vnet.ibm.com> <5460D648.4020804@suse.de> <20141118125059.GA10967@tuxmaker.boeblingen.de.ibm.com> <546B7B38.2060004@suse.de> <20141125101102.GA8659@tuxmaker.boeblingen.de.ibm.com> <54747289.8070205@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54747289.8070205@suse.de> Subject: Re: [Qemu-devel] [PATCH 1/3] s390: Add PCI bus support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: peter.maydell@linaro.org, Frank Blaschka , james.hogan@imgtec.com, mtosatti@redhat.com, qemu-devel@nongnu.org, borntraeger@de.ibm.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, rth@twiddle.net On Tue, Nov 25, 2014 at 01:14:01PM +0100, Alexander Graf wrote: > > > On 25.11.14 11:11, Frank Blaschka wrote: > > On Tue, Nov 18, 2014 at 06:00:40PM +0100, Alexander Graf wrote: > >> > >> > >> On 18.11.14 13:50, Frank Blaschka wrote: > >>> On Mon, Nov 10, 2014 at 04:14:16PM +0100, Alexander Graf wrote: > >>>> > >>>> > >>>> On 10.11.14 15:20, Frank Blaschka wrote: > >>>>> From: Frank Blaschka > >>>>> > >>>>> This patch implements a pci bus for s390x together with infrastructure > >>>>> to generate and handle hotplug events, to configure/unconfigure via > >>>>> sclp instruction, to do iommu translations and provide s390 support for > >>>>> MSI/MSI-X notification processing. > >>>>> > >>>>> Signed-off-by: Frank Blaschka > >> > >> [...] > >> > >>>>> diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c > >>>>> new file mode 100644 > >>>>> index 0000000..f2fa6ba > >>>>> --- /dev/null > >>>>> +++ b/hw/s390x/s390-pci-bus.c > >>>>> @@ -0,0 +1,485 @@ > >>>>> +/* > >>>>> + * s390 PCI BUS > >>>>> + * > >>>>> + * Copyright 2014 IBM Corp. > >>>>> + * Author(s): Frank Blaschka > >>>>> + * Hong Bo Li > >>>>> + * Yi Min Zhao > >>>>> + * > >>>>> + * This work is licensed under the terms of the GNU GPL, version 2 or (at > >>>>> + * your option) any later version. See the COPYING file in the top-level > >>>>> + * directory. > >>>>> + */ > >>>>> + > >>>>> +#include > >>>>> +#include > >>>>> +#include > >>>>> +#include > >>>>> +#include > >>>>> +#include "qemu/error-report.h" > >>>>> +#include "s390-pci-bus.h" > >>>>> + > >>>>> +/* #define DEBUG_S390PCI_BUS */ > >>>>> +#ifdef DEBUG_S390PCI_BUS > >>>>> +#define DPRINTF(fmt, ...) \ > >>>>> + do { fprintf(stderr, "S390pci-bus: " fmt, ## __VA_ARGS__); } while (0) > >>>>> +#else > >>>>> +#define DPRINTF(fmt, ...) \ > >>>>> + do { } while (0) > >>>>> +#endif > >>>>> + > >>>>> +static const unsigned long be_to_le = BITS_PER_LONG - 1; > >>>>> +static QTAILQ_HEAD(, SeiContainer) pending_sei = > >>>>> + QTAILQ_HEAD_INITIALIZER(pending_sei); > >>>>> +static QTAILQ_HEAD(, S390PCIBusDevice) device_list = > >>>>> + QTAILQ_HEAD_INITIALIZER(device_list); > >>>> > >>>> Please get rid of all statics ;). All state has to live in objects. > >>>> > >>> > >>> be_to_le was misleading and unnecesary will remove this one but > >>> static QTAILQ_HEAD seems to be a common practice for list anchors. > >>> If you really want me to change this do you have any prefered way, > >>> or can you point me to some code doing this? > >> > >> For PCI devices, I don't think you need a list at all. Your PHB device > >> should already have a proper qbus that knows about all its child devices. > > > > OK > > > >> > >> As for pending_sei, what is this about? > >> > > > > This is a queue to store events (StoreEventInformation) used for hotplug > > support. In case a device is pluged/unpluged an event is stored to this queue > > and the guest is notified. Then the guest pick up the event information via > > chsc instruction. > > Is this for overall CCW or only for PCI? Depending on the answer, you > can put the sei event list into the respective parent device. > An NT2 event is pci specific. So I moved the queue for NT2 events to the PHB as well. > > Alex >