Received: from eggs.gnu.org ([2001:4830:134:3::10]:59949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5Y8L-0004Ll-CH for qemu-devel@nongnu.org; Tue, 21 Jan 2014 05:00:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5Y8F-0006CL-Pt for qemu-devel@nongnu.org; Tue, 21 Jan 2014 05:00:37 -0500 Received: from mail-pb0-f49.google.com ([209.85.160.49]:48452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5Y8F-0006C9-Hn for qemu-devel@nongnu.org; Tue, 21 Jan 2014 05:00:31 -0500 Received: by mail-pb0-f49.google.com with SMTP id up15so7563980pbc.8 for ; Tue, 21 Jan 2014 02:00:30 -0800 (PST) Message-ID: <52DE4539.9080502@ozlabs.ru> Date: Tue, 21 Jan 2014 21:00:25 +1100 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1389605349-1989-1-git-send-email-aik@ozlabs.ru> <87a9eqbrn0.fsf@blackfin.pond.sub.org> <52DDCF46.7030209@ozlabs.ru> <87k3dtzs2v.fsf@blackfin.pond.sub.org> In-Reply-To: <87k3dtzs2v.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] spapr-pci: enable adding PHB via -device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Alexander Graf , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, =?UTF-8?B?QW5kcmVhcyBGw6Ry?= =?UTF-8?B?YmVy?= On 01/21/2014 06:56 PM, Markus Armbruster wrote: > Alexey Kardashevskiy writes: > >> On 01/21/2014 02:27 AM, Markus Armbruster wrote: >>> Alexey Kardashevskiy writes: >>> >>>> Recent changes introduced cannot_instantiate_with_device_add_yet >>>> and removed capability of adding yet another PCI host bridge via >>>> command line for SPAPR platform (POWERPC64 server). >>> >>> Specifically: >>> >>> commit 837d37167dc446af8a91189108b363c04609e296 >>> Author: Markus Armbruster >>> Date: Thu Nov 28 17:26:55 2013 +0100 >>> >>> sysbus: Set cannot_instantiate_with_device_add_yet >>> >>> device_add plugs devices into suitable bus. For "real" buses, that >>> actually connects the device. For sysbus, the connections need to be >>> made separately, and device_add can't do that. The device would be >>> left unconnected, and could not possibly work. >>> >>> Quite a few, but not all sysbus devices already set >>> cannot_instantiate_with_device_add_yet in their class init function. >>> >>> Set it in their abstract base's class init function >>> sysbus_device_class_init(), and remove the now redundant assignments >>> from device class init functions. >>> >>> Signed-off-by: Markus Armbruster >>> Reviewed-by: Marcel Apfelbaum >>> Signed-off-by: Andreas Färber >>> >>> Always good to point to specific commits in commit messages instead of >>> hand-waving "recent changes". >> >> >> My bad, I'll do this next time. Just lost myself in that patch series. >> >> >>>> This brings the capability back and puts SPAPR PHB into "bridge" >>>> category. >>> >>> Look, a sysbus device that grabs the resources it needs from its init() >>> callback instead of getting connected to them by the code that creates >>> it! I'm not sure that's proper, but if it works... Maybe Andreas >>> (cc'ed) can advise. >> >> Sorry, I am not following you. SPAPR PHB allocates resources (memory >> regions...) as (for example) E1000 ethernet device does. > > "Resources" was a poor choice of word. > > I'm talking about connections to other devices. An ordinary device on a > proper bus like PCI or USB gets all its connections via its bus. The > "sysbus" doesn't provide any connection opportunities for its devices. > Instead, the connections are made by the code creating the device. > > You tell me "-device spapr-pci-host-bridge" works (with your patch). > That either means it doesn't need any such connections, or it sets them > up itself somehow, or I'm missing something. The first two would be > unusual, the latter not so much :) It maps itself (MMIO/IO windows) into the guest physical RAM at some predefined addresses which are calculated from its @index property, and that is pretty much it. I am not sure what else connections it might ever need :) The rest is done via platform hyper- or rtas-calls, and this is that connection I guess. -- Alexey