These two patch will demonstrate our thoughts of how edge-interrupt can be handled in Xen.
Following the dicussion with MSI in recent mail threads, edge-interrupt can be handled like this:
1> ACK (write EOI) for the first interrupt.
2> If the second comes and the first is still in service, mask the interrupt.
3> unmask the interupt when all work is done.
While this is clear in native linux kernel, it is not so in Xen. Because Xen does not require the guest use EOI hypercall for edge interrupt and hence does not know when guest has finished handling to edge interrupt, we have problems in how to judge 2> and 3>.
We solve the problem in this way:
Move pirq_needs_eoi from dom0's owe memory to share page.
Xen will chage the bit in pirq_needs_eoi dynamically.
Xen uses pending status to judge whether the first one is handled.
On receiving EOI hypercall from guest, unmask the interrupt.
Do you think this approach is viable?
The two patches are for xen and kernel respectively.
Xen-devel mailing list