On 08.07.2013, at 15:08, Peter Maydell wrote:

> On 8 July 2013 13:59, Alexander Graf <ag...@suse.de> wrote:
>> On 08.07.2013, at 14:57, Alexander Graf wrote:
>>> On 27.06.2013, at 15:04, Peter Maydell wrote:
>>>> The basic idea is that the board instantiates some transports,
>>> 
>>> I really dislike that idea. Couldn't you also create a new
>>> bus for your vexpress platform and add a virtio-mmio-vexpress
>>> device that automatically allocates an interrupt from the main
>>> PIC on instantiation? That way you could create transports
>>> using -device.
> 
> This doesn't seem to gain anything except that the user has
> to use -device twice rather than once.

Yes, it does. You can have other devices than just virtio ones on those IRQ 
lines. Assigned devices for example.

> 
>>> Combine that with automatic fdt generation and you get fully
>>> command line scaling device creation.
>> 
>> Ah, you already have the fdt generation bit. So you're really
>> only missing the automatic irq allocation to make it actually
>> user friendly and flexible.
> 
> It's not clear to me how you can automatically allocate an IRQ:
> there just aren't that many available, and I'm already a bit

For a first draft, how about your allocator returns those 4 consecutively? For 
the PV machine things will become more obvious. Maybe we could even share the 
same bus type between your PV machine, vexpress and the e500 machines?

> nervous about stealing 4, because we might run into issues if
> newer versions of h/w use those IRQs for something else. One
> approach would be to have all virtio transports share an IRQ
> line (the spec currently forbids this; I need to test if it
> would actually work in practice...)
> 
> As far as I know there's no way to find out at board
> construction how many virtio devices you might want.

Hence you shouldn't create them :).


Alex


Reply via email to