Re: [GIT PULL] AlacrityVM guest drivers for 2.6.33

From: Gregory Haskins
Date: Mon Dec 21 2009 - 11:57:18 EST


On 12/21/09 11:40 AM, Avi Kivity wrote:
> On 12/21/2009 06:37 PM, Anthony Liguori wrote:
>> Since virtio-pci supports MSI-X, there should be no IO exits on
>> host->guest notification other than EOI in the virtual APIC. This is
>> a light weight exit today and will likely disappear entirely with
>> newer hardware.
>
> I'm working on disappearing EOI exits on older hardware as well. Same
> idea as the old TPR patching, without most of the magic.
>

While I applaud any engineering effort that results in more optimal
execution, if you are talking about what we have discussed in the past
its not quite in the same league as my proposal.

You are talking about the ability to optimize the final EOI if there are
no pending interrupts remaining, right? The problem with this approach
is it addresses the wrong side of the curve: That is, it optimizes the
code as its about to go io-idle. You still have to take an extra exit
for each injection during the heat of battle, which is when you actually
need it most.

To that front, what I have done is re-used the lockless shared-memory
concept for even "interrupt injection". Lockless shared-memory rings
have the property that both producer and consumer can simultaneously
manipulate the ring. So what we do in alacrityvm is deliver shm-signals
(shm-signal == "interrupt" in vbus) over a ring so that the host can
inject a signal to a running vcpu and a vcpu can complete an
ack/re-inject cycle directly from vcpu context. Therefore, we only need
a physical IDT injection when the vcpu is io-idle transitioning to
io-busy, and remain completely in parallel guest/host context until we
go idle again.

That said, your suggestion would play nicely with the above mentioned
scheme, so I look forward to seeing it in the tree. Feel free to send
me patches for testing.

Kind Regards,
-Greg

Attachment: signature.asc
Description: OpenPGP digital signature