On Wed, Mar 06, 2013 at 05:38:33AM -0500, Paolo Bonzini wrote: > > > ----- Messaggio originale ----- > > Da: "Gleb Natapov" <gleb@xxxxxxxxxx> > > A: "Paolo Bonzini" <pbonzini@xxxxxxxxxx> > > Cc: "Alexander Graf" <agraf@xxxxxxx>, kvm@xxxxxxxxxxxxxxx, kvm-ppc@xxxxxxxxxxxxxxx, "Stuart Yoder" > > <stuart.yoder@xxxxxxxxxxxxx>, "Scott Wood" <scottwood@xxxxxxxxxxxxx>, "Paul Mackerras" <paulus@xxxxxxxxx>, "Peter > > Maydell" <peter.maydell@xxxxxxxxxx> > > Inviato: Mercoledì, 6 marzo 2013 10:58:35 > > Oggetto: Re: in-kernel interrupt controller steering > > > > 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? > > Because you'd have to stash the handle that KVM_CREATE_DEVICE returns > somewhere, waiting for the QEMU device to be created. > OK, we try not to add interfaces for one userspace convenience though. Is this such insurmountable problem for QEMU? > Perhaps it's just a problem of naming, and KVM_CREATE_DEVICE is simply > not the right name for the interface. Once both KVM_CREATE_IRQCHIP_ARGS > and KVM_CREATE_DEVICE are added, it really will not create the device anymore. > Devices will be created by KVM_CREATE_IRQCHIP_ARGS, and possibly by > KVM_CREATE_VCPU. KVM_CREATE_DEVICE is really only returning an id. > > So we can have this instead: > - KVM_CREATE_IRQCHIP_ARGS becomes KVM_SET_IRQCHIP_TYPE (and "none" > can be a valid irqchip type). > > - KVM_CREATE_DEVICE becomes KVM_GET_IRQCHIP_DEVICE, and you pass it a > device type and possibly a VCPU number. > > It's mostly about names, but one important property is that > KVM_GET_IRQCHIP_DEVICE can be called at any time and, in fact, > multiple times. Gleb, do you like this more? > If you put it like this it sounds better (well you've just stashed the handle in kernel for QEMU convenience :)), but you've made the interface irqchips specific again and this is what we are trying to avoid. -- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html