Re: in-kernel interrupt controller steering

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

 




----- 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.

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?

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux