快速链接:
.
👉👉👉 个人博客笔记导读目录(全部) 👈👈👈
在ARM architecture系统中,除了有IRQ、FIQ,还有VIRQ、VFIQ
那么怎样才能产生VFIQ、VIRQ呢?
方法一: 给寄存器HCR_EL2的下列的比特置1,就能产生一个虚拟中断到PSTATE Masking
• VI = Setting this bit registers a vIRQ.
• VF = Setting this bit registers a vFIQ.
• VSE = Setting this bit registers a vSError
产生虚拟中断后,该中断处于pending状态
方法二:使用gic控制器产生一个虚拟中断
The hypervisor can map the virtual CPU interface into a VM, allowing software in that VM to communicate directly with the GIC
The diagram illustrates these steps:
- The physical peripheral asserts its interrupt signal into the GIC.
- The GIC generates a physical interrupt exception, either IRQ or FIQ, which gets routed to EL2 by
the configuration of HCR_EL2.IMO/FMO. The hypervisor identifies the peripheral and
determines that it has been assigned to a VM. It checks which vCPU the interrupt should be
forwarded to.- The hypervisor configures the GIC to forward the physical interrupt as a virtual interrupt to the
vCPU. The GIC will then assert the vIRQ or vFIQ signal, but the processor will ignore this signal
while it is executing in EL2.- The hypervisor returns control to the vCPU.
- Now that the processor is in the vCPU (EL0 or EL1), the virtual interrupt from the GIC can be
taken. This virtual interrupt is subject to the PSTATE exception masks