On Wed, Mar 06, 2013 at 10:40:18AM +0100, Paolo Bonzini wrote: > Il 05/03/2013 16:25, Gleb Natapov ha scritto: > >> 1) We need to set the generic interrupt type of the system before we > >> create vcpus. > >> > >> This is a new ioctl that sets the overall system interrupt controller type > >> to a specific model. This used so that when we create vcpus, we can create > >> the appended "local interrupt controller" state without the actual > >> interrupt controller device available yet. It is also used later to switch > >> between interrupt controller implementations. > >> > >> This interrupt type is write once and frozen after the first vcpu got > >> created. > > > > Why explicit ioctl is needed? Why not require specific irqchip to be > > created before first vcpu. The device created determines system interrupt > > controller type. > > QEMU creates CPUs before devices, and CPUs need to know what kind of > local interrupt controller to create. Similar to how in-kernel LAPIC > state is created long before the userspace device that proxies the LAPIC. > So what is the difference between calling this special ioctl before creating vcpus and calling create device ioctl instead and create QEMU proxy device at whatever point in time QEMU wants to create it?
> I think the above design makes sense. The alternative would be to > entirely separate the creation of CPUs and devices. You could even > support heterogeneous systems with some in-kernel irqchips and some > userspace irqchips; sounds cool, but useless too. Not so useless. It may make sense for x86 to emulate only ioapic in kernel and leave PIC in userspace. -- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html