On 08/02/2017 08:58, Peter Xu wrote: > This idea was invoked when I was trying to solve an emulated VT-d issue > when guest kernel setup incorrect IRTE. When that happens, instead of > raising error immediately, what we should do is to keep the error, and > inject this error to vIOMMU when the specific interrupt is triggered. > > However this is very hard to be achieved since for now vIOMMU is working > in userspace, while currently there is no simple way that kernel irq can > talk to a userspace program. > > With this patch, we can easily provide such a way that when guest fault > irq is triggered, kernel can notify user program by signaling the > corresponding eventfd handle I think I understand the scenario, but I don't understand why it needs kernel intervention. Why couldn't this be handled entirely in userspace, without ever setting up a GSI route or irqfd in KVM? In other words, you're doing write(irqfd) read(irq fault eventfd) | ^ v | KVM -------> KVM_GSI_ROUTING_EVENTFD but why is this needed as opposed to just write(irqfd) ------> read(irq fault eventfd) ? Thanks, Paolo