Date
1 - 6 of 6
Question about guest external interrupt
Oscar Jupp
To whom it may concern,
I have a question about guest external interrupt. The privileged ISA said: "GEILEN may be zero". If GEILEN is zero, is the implementation unable to receive guest external interrupts at all? Or can it be injected by software means? Any help would be greatly appreciated! Regards Oscar Jupp
|
||||||||||
|
||||||||||
On Thu, Nov 17, 2022 at 9:07 AM Oscar Jupp <jupposcar@...> wrote:
If GEILEN is zero then there are no guest external interrupts but software (i.e. hypervisor) can still inject external interrupts using hvip CSR. In other words, software-injected external interrupts are always available to a hypervisor using H-extension. Regards, Anup Any help would be greatly appreciated! Thank you |
||||||||||
|
||||||||||
Oscar Jupp
Dear Anup Patel,
Thank you very much for your reply. I would like to continue to ask: If GEILEN is 0, CSR hgeip and hgeie will always be all zero. Then, hip.SGEIP is always 0. You said: “software (i.e. hypervisor) can still inject external interrupts using hvip CSR. “ But hvip CSR can only make hip.VSSIP, hip.VSTIP and hip.VSEIP raised. It can not make hip.SGEIP be “1”. How does the implement recognize that this is a guest external interrupt. Regards, Oscar Jupp
---- Replied Message ----
On Thu, Nov 17, 2022 at 9:07 AM Oscar Jupp <jupposcar@...> wrote:
If GEILEN is zero then there are no guest external interrupts but software (i.e. hypervisor) can still inject external interrupts using hvip CSR. In other words, software-injected external interrupts are always available to a hypervisor using H-extension. Regards, Anup Any help would be greatly appreciated! Thank you |
||||||||||
|
||||||||||
External interrupts are passed through to the guest by setting `hip.VSEIP`, which the guest OS sees as `sip.SEIP`.
The hypervisor software decides which interrupts should be passed through to which guest OS. If the hardware has GEILEN>0 then the hypervisor software can configure `hstatus.VGEIN` and `hgeie` such that `hip.VSEIP` can be set by the external interrupt directly. 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`. Either way, the guest OS sees the same thing. |
||||||||||
|
||||||||||
Oscar Jupp
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
---- Replied Message ----
External interrupts are passed through to the guest by setting `hip.VSEIP`, which the guest OS sees as `sip.SEIP`.
The hypervisor software decides which interrupts should be passed through to which guest OS. If the hardware has GEILEN>0 then the hypervisor software can configure `hstatus.VGEIN` and `hgeie` such that `hip.VSEIP` can be set by the external interrupt directly. 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`. Either way, the guest OS sees the same thing. |
||||||||||
|
||||||||||
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:
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.
|
||||||||||
|