Re: [RFC PATCH] kvm: Extend irqfd to support level interrupts

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

 



On Mon, 2012-06-18 at 17:33 +0300, Avi Kivity wrote:
> On 06/18/2012 05:27 PM, Alex Williamson wrote:
> > On Mon, 2012-06-18 at 13:14 +0300, Avi Kivity wrote:
> >> On 06/18/2012 01:11 PM, Michael S. Tsirkin wrote:
> >> 
> >> >> (vhost,
> >> >> msi-less ivshmem clone)?
> >> > 
> >> > I guess vhost can poll eventfd and reinject an interrupt.
> >> > Of course to bypass qemu completely we also need to support reads over
> >> > ioeventfd somehow.
> >> > 
> >> 
> >> eventfd is not suitable for level triggered interrupts as far as I can
> >> tell.  It's about passing edges, and level interrupts aren't.  We need
> >> something like a pipe for communicating state (or just use KVM_IRQ_LINE).
> > 
> > Isn't level just two edges with a state in between?  Sure we may be
> > unnecessarily de-asserting for brief periods, but for an external
> > assigned device, we don't know whether it's unnecessary.  Thanks,
> 
> For an assigned device you have someone maintaining the state and keep
> pushing you edges as long as it's up.  So it's okay for you to keep
> deasserting the interrupt as the device will fix it up for you.  For an
> emulated device, you don't, so it isn't.

An emulated device doesn't know enough about it's own state to figure
out whether it should re-assert an interrupt?  Somehow I'm doubtful of
that.  What would be on the other end of that pipe if an emulated device
doesn't know when it's interrupting and when it's done?  Anyway, they're
probably not using an IRQFD to start with.

What I'm proposing emulates level signaling using something like this:

<device>: "Hey, push the button (assert interrupt)!"
<kvm>: "Bob (the guest) told me to let go of the button (deassert interrupt), let me know if I should push it again"

Another valid emulation of that is:

<device>: "Hey, push the button!"
<device>: "Let go of the button"

Nobody currently needs the latter, but the latter doesn't replace the
former for device assignment.  I can rename variables and flags to make
it more compatible with some future implementation of the latter if
that's helpful.

> btw, technically we're in the wrong here.  An interrupt handler may read
> the irr and see an incorrect value.  Of course no one does that so we
> can get away with it.

Hmm, you're speaking of existing irr emulation?  I don't see how this
makes anything less accurate or prevents the irr from being emulated
accurately through this patch.  Thanks,

Alex

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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux