mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-19 12:12:16 +00:00
refine external interrupt VM exit handler
- According to Intel SDM 24.9.2,Vol3, should check the validity of "VM-exit interruption information" before extracting the vector of interrupt. Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
parent
e12210a014
commit
a1e324cbfd
@ -266,16 +266,25 @@ int interrupt_window_vmexit_handler(struct vcpu *vcpu)
|
|||||||
|
|
||||||
int external_interrupt_vmexit_handler(struct vcpu *vcpu)
|
int external_interrupt_vmexit_handler(struct vcpu *vcpu)
|
||||||
{
|
{
|
||||||
int vector = exec_vmread(VMX_EXIT_INT_INFO) & 0xFF;
|
uint32_t intr_info;
|
||||||
struct intr_ctx ctx;
|
struct intr_ctx ctx;
|
||||||
|
|
||||||
ctx.vector = vector;
|
intr_info = exec_vmread(VMX_EXIT_INT_INFO);
|
||||||
|
if ((!(intr_info & VMX_INT_INFO_VALID)) ||
|
||||||
|
(((intr_info & VMX_INT_TYPE_MASK) >> 8)
|
||||||
|
!= VMX_INT_TYPE_EXT_INT)) {
|
||||||
|
pr_err("Invalid VM exit interrupt info:%x", intr_info);
|
||||||
|
VCPU_RETAIN_RIP(vcpu);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.vector = intr_info & 0xFF;
|
||||||
|
|
||||||
dispatch_interrupt(&ctx);
|
dispatch_interrupt(&ctx);
|
||||||
|
|
||||||
VCPU_RETAIN_RIP(vcpu);
|
VCPU_RETAIN_RIP(vcpu);
|
||||||
|
|
||||||
TRACE_2L(TRC_VMEXIT_EXTERNAL_INTERRUPT, vector, 0);
|
TRACE_2L(TRC_VMEXIT_EXTERNAL_INTERRUPT, ctx.vector, 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user