Re: Question about guest external interrupt


Scott Johnson
 

They are all external interrupts to the physical machine. The hypervisor software will decide which, if any, of these external interrupts should be passed through to which guest OS, and direct the appropriate ones through hardware (if GEILEN>0) or software (if GEILEN=0).

This is explained in the privileged spec under hgeip:

If a RISC-V platform supports placing a physical device under the direct control of a guest OS with

minimal hypervisor intervention (known as pass-through or direct assignment between a virtual machine

and the physical device), then, in such circumstance, interrupts from the device are intended

for a specific virtual machine.



I would imagine the hypervisor software will have some kind of UI or API for the user to associate a particular hardware device with a particular guest OS. This enables higher performance than the alternative of virtualizing every device so they can be shared across all guests.

GEILEN>0 enables this pass-through to be higher performance because it doesn’t require the intervention of the hypervisor software on every single interrupt.



On Nov 17, 2022, at 9:02 PM, jupposcar <jupposcar@...> wrote:

Dear Scott Johnson,
Thank you very much!
You said: “If the hardware has GEILEN=0 then the external interrupt will first go to the hypervisor software, which can pass through the interrupt to the guest by setting `hvip.VSEIP`.”
Do you mean that the hypervisor can distinguish between the external interrupt to the physical machine and external interrupt to the guest?
How does the hypervisor know which interrupt is a external interrupt to the physical machine? Or is it a external interrupt to the guest?

Regards,
Oscar Jupp

Join tech-privileged@lists.riscv.org to automatically receive all group messages.