Arjan van de Ven wrote:
Can't it be done by a helper function using a timer and a signal (or whatever mechanism we use to wake up vcpus)?one could do that but it's not optimal; if the process DOES get waken up earlier, it should take the interrupt then immediately, so that itdoesn't have to wake up again when the timer fires.(in fact it would be nice if the guest could somehow poll at the irq mask at waking from idle, so that it wouldn't need a vmexit/entry for every such interrupt, but just do the right thing for all pending work) In addition, yes it'll be a helper function, but since all drivers will want the functionality its probably best off in the generic code
That's what Xen does (I'm not sure about the timer, but they do avoid unnecessary interrupts). As you can have memory shared between the guest and host, it's quite simple:
0. host puts data in ring 1. host sets interrupt timer 2. guest wakes up for unrelated reasons 3. guest sees data in ring, consumes it, and bumps the consumer pointer 4. timer fires, host sees consumer == producer, no need to issue interrupt They have that code abstracted out and reusable by multiple drivers. -- error compiling committee.c: too many arguments to function - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- References:
- [PATCH 0/13] kvm updates for 2.6.21
- From: Avi Kivity <[email protected]>
- [PATCH 10/13] KVM: Wire up hypercall handlers to a central arch-independent location
- From: Avi Kivity <[email protected]>
- Re: [PATCH 10/13] KVM: Wire up hypercall handlers to a central arch-independent location
- From: Pavel Machek <[email protected]>
- Re: [PATCH 10/13] KVM: Wire up hypercall handlers to a central arch-independent location
- From: Avi Kivity <[email protected]>
- RE: [kvm-devel] [PATCH 10/13] KVM: Wire up hypercall handlers to a central arch-independent location
- From: "Dor Laor" <[email protected]>
- RE: [kvm-devel] [PATCH 10/13] KVM: Wire up hypercall handlers to a central arch-independent location
- From: Arjan van de Ven <[email protected]>
- Re: [kvm-devel] [PATCH 10/13] KVM: Wire up hypercall handlers to a central arch-independent location
- From: Avi Kivity <[email protected]>
- Re: [kvm-devel] [PATCH 10/13] KVM: Wire up hypercall handlers to a central arch-independent location
- From: Arjan van de Ven <[email protected]>
- Re: [kvm-devel] [PATCH 10/13] KVM: Wire up hypercall handlers to a central arch-independent location
- From: Avi Kivity <[email protected]>
- Re: [kvm-devel] [PATCH 10/13] KVM: Wire up hypercall handlers to a central arch-independent location
- From: Arjan van de Ven <[email protected]>
- Re: [kvm-devel] [PATCH 10/13] KVM: Wire up hypercall handlers to a central arch-independent location
- From: Avi Kivity <[email protected]>
- Re: [kvm-devel] [PATCH 10/13] KVM: Wire up hypercall handlers to a central arch-independent location
- From: Arjan van de Ven <[email protected]>
- [PATCH 0/13] kvm updates for 2.6.21
- Prev by Date: Re: NO_HZ: timer interrupt stuck [Re: Linux 2.6.21-rc1]
- Next by Date: Re: Weird hard disk noise on shutdown (bug #7674)
- Previous by thread: Re: [kvm-devel] [PATCH 10/13] KVM: Wire up hypercall handlers to a central arch-independent location
- Next by thread: Re: [kvm-devel] [PATCH 10/13] KVM: Wire up hypercall handlers to a central arch-independent location
- Index(es):