From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NRkn3-0005tP-5b for qemu-devel@nongnu.org; Mon, 04 Jan 2010 06:08:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NRkmx-0005q8-Fp for qemu-devel@nongnu.org; Mon, 04 Jan 2010 06:07:59 -0500 Received: from [199.232.76.173] (port=34340 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRkmx-0005q2-Bn for qemu-devel@nongnu.org; Mon, 04 Jan 2010 06:07:55 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:44506) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NRkmw-0001sr-JA for qemu-devel@nongnu.org; Mon, 04 Jan 2010 06:07:55 -0500 Date: Mon, 4 Jan 2010 20:08:00 +0900 From: Isaku Yamahata Subject: Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable Message-ID: <20100104110800.GE4672@valinux.co.jp> References: <20100103172937.GB8508@redhat.com> <20100103174430.GA8522@redhat.com> <41679128-EE37-47DA-82F6-830A4C364183@suse.de> <20100103180609.GB8522@redhat.com> <472F306A-0699-401C-8E6A-8E79B86E4C95@suse.de> <1262551822.2173.267.camel@pasglop> <19BFDDD5-85E0-42EC-9D71-391CECC023F5@suse.de> <20100104104516.GD4672@valinux.co.jp> <19CAC3E3-2E27-4BCC-9AB3-875E5665ABBE@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19CAC3E3-2E27-4BCC-9AB3-875E5665ABBE@suse.de> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Blue Swirl , QEMU Developers , Aurelien Jarno , "Michael S. Tsirkin" On Mon, Jan 04, 2010 at 11:55:10AM +0100, Alexander Graf wrote: > > On 04.01.2010, at 11:45, Isaku Yamahata wrote: > > > On Mon, Jan 04, 2010 at 04:26:46AM +0100, Alexander Graf wrote: > >> > >> On 03.01.2010, at 21:50, Benjamin Herrenschmidt wrote: > >> > >>> On Sun, 2010-01-03 at 21:27 +0100, Alexander Graf wrote: > >>> > >>>> I think if unin_pci is the only user, it'd be better to do it hacky > >>>> inside unin_pci.c. But if there's a chance there's another user, it'd > >>>> be better to make it generic. > >>>> > >>>> Since this is the first time I ever stumbled across type 0 and type 1 > >>>> PCI config space addresses, I simply don't know if there are any. Blue > >>>> Swirls comment indicated that there are. Ben also sounded as if it's > >>>> rather common to not use the x86 format. On the other hand, it looks > >>>> like nobody in qemu needed it so far - and we're implementing ARM, > >>>> MIPS and all other sorts of platforms. > >>>> > >>>> So if anyone with knowledge in PCI could shed some light here, please > >>>> do so. > >>> > >>> My feeling is that what you're better off doing is to have the qemu core > >>> take an abstract struct to identify a device config space location, that > >>> consists of separate fields for: > >>> > >>> - The PCI domain (which is what host bridge it hangs off since bus > >>> numbers are not unique between domains) > >>> > >>> - The bus number > >> > >> Hm, I think it'd make more sense to just store a PCIBus pointer in there. We could then fetch the bus and domain id from there. > >> > >> I'll write something up :-). > >> > >> > >> Alex > >> > > > > Does the following patch help? > > I did only compile test though. > > I sent out v2 already, which contains a complete resolution framework. It also allows for incremental cleanup of the users, as I'd rather like to see everyone use pci_host instead of hacky homegrown functions. But I don't think changing all at once is going to fly wrt reviewablity. Agreed. Anyway that patch is just for discussion, not for commit. If wanted, I'm willing to split it up into a series of patches or rebase it on top of your patches. (Or throw it away) > I'd be really glad if you could take a glimpse at my version. You're definitely more knowledgable in the PCI areas than me :-). I verified that it fixes Uninorth and x86 still works. I'll have a look at it tomorrow. -- yamahata