qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] spapr-pci: enable adding PHB via -device


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH] spapr-pci: enable adding PHB via -device
Date: Tue, 21 Jan 2014 08:56:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Alexey Kardashevskiy <address@hidden> writes:

> On 01/21/2014 02:27 AM, Markus Armbruster wrote:
>> Alexey Kardashevskiy <address@hidden> 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 <address@hidden>
>> 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 <address@hidden>
>>     Reviewed-by: Marcel Apfelbaum <address@hidden>
>>     Signed-off-by: Andreas Färber <address@hidden>
>> 
>> 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 :)

>>> This is not much use for emulated PHB but it is absolutely required
>>> for VFIO as we put an IOMMU group onto a separate PHB on SPAPR.
>>>
>>> Cc: Markus Armbruster <address@hidden>
>>> Signed-off-by: Alexey Kardashevskiy <address@hidden>
>>> ---
>>>
>>> Are -device and device_add considered synonims? SPAPR PHB can be added
>>> via the command line just fine but cannot from device_add as
>>> "Bus 'main-system-bus' does not support hotplugging".
>> 
>> -device is cold plug, device_add is hot plug.  device_add could be
>> improved to do cold plug when used before the machine starts.
>
>
> Soooo? We figured that out on IRC :) At the moment it is regression -
> -device used to work for PHB and now it does not.

IRC is ephemeral, the list is not.

> Alex Graf applied to his ppc-next, just to be clear - are you ack'ing or
> nack'ing this patch?

I'm certainly not vetoing anything here!

> In any cace, what do you think I should change in what I do in spapr_pci.c?
> I most probably will, just need some directions.

Nothing, unless further discussion leads to action items.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]