Hi Everyone,
Its true that Hypervisor inserts interrupt in the virtual machine.
But, GICv4 also tells that it supports direct injection of virtual interrupts which means that, interrupt can be inserted directly to VM from Redistributor without involvement of Hypervisor.
Indicated by Register : ICH_VTR_EL2
Field : nV4
If this field bit is:
0 - Supports Direct Injection of Virtual Interrupts
1 - Does not Support Direct Injection of Virtual Interrupts.
So, from above statement can you please help me in understanding about,
- In what scenarios does this direct injection of Virtual Interrupts happen..?
- Is that okay, if Hypervisor is not updated about the virtual interrupt and virtual interrupt is directly inserted from Redistributor to VM.
- Can you also please tell me what is the advantage of having this feature.
Above doubts arose as per my understanding on reading GICv4 Document. If i am missing any clarity please excuse & suggest me. I am happy to take anything.
Thanks in advance,
Rakesh.
Hi Martin,
I do have a very small doubt regarding this same topic.
As you said above--
" If the target vCPU is running when the interrupt occurs, the virtual interrupt gets inserted without any additional Hypervisor involvement. If not, the virtual interrupt gets recorded as being pending for next time the vCPU is run."
From this i can understand that during DIVL HYPERVISOR is not at all involved.
- But, my doubt is that, do we need to update any of the hypervisor registers during DIVL.
- This question arose as I have gone through the below descriptions in ARM GICv4 Doc.
============================================================
8.4.8 ICH_VMCR_EL2, Interrupt Controller Virtual Machine Control Register
The ICH_VMCR_EL2 characteristics are:
Purpose
Enables the hypervisor to save and restore the virtual machine view of the GIC state.
- It is said that, Register Fields of this register are ALIAS of the Respective Register field bits ICV_*_EL1.
- Does this mean that Hypervisor registers are always updated.?
Please correct me if I wrong.
Thanks,
Just for clarity, DIVL doesn't remove the hypervisor entirely. It's the hypervisor which sets up the mapping between physical events and virtual interrupts, and handles scheduling. DIVL means we don't need to re-enter the hypervisor to forward a virtual interrupt.
- But, my doubt is that, do we need to update any of the hypervisor registers during DIVL.- This question arose as I have gone through the below descriptions in ARM GICv4 Doc.============================================================8.4.8 ICH_VMCR_EL2, Interrupt Controller Virtual Machine Control RegisterThe ICH_VMCR_EL2 characteristics are:PurposeEnables the hypervisor to save and restore the virtual machine view of the GIC state.============================================================- It is said that, Register Fields of this register are ALIAS of the Respective Register field bits ICV_*_EL1.
In order to context switch between vCPUs, the hypervisor needs to be able save/restore vCPU state. This includes the state of the virtual CPU Interface (ICV registers).
The way this is done is by having aliasing between the ICV (vCPU view) and ICH (Hypervisor).
It depends on how you think about it. You could think of it as a write to ICV updating ICH, or a read/write to ICH accessing the state of ICV. But either way, at the point you enter the hypervisor the ICH registers will have an up to date view of the vCPU state.
This makes me clear.
Thanks alot martin for sparing your valuable time for me.