Skip to content

Commit 7710940

Browse files
yechun1lijinxia
authored andcommitted
apicv: only write VMX_ENTRY_EXCEPTION_EC when error code valid
if error code not valid, do not vmwrite VMX_ENTRY_EXCEPTION_EC. In cancel_event_injection, the inject_info.error_core is not assigned when error code not valid. Signed-off-by: Chris Ye <chris.ye@intel.com>
1 parent 2dfa5f6 commit 7710940

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hypervisor/arch/x86/interrupt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,9 @@ int acrn_handle_pending_request(struct vcpu *vcpu)
383383

384384
/* handling cancelled event injection when vcpu is switched out */
385385
if (vcpu->arch_vcpu.inject_event_pending) {
386-
exec_vmwrite(VMX_ENTRY_EXCEPTION_ERROR_CODE,
387-
vcpu->arch_vcpu.inject_info.error_code);
386+
if (vcpu->arch_vcpu.inject_info.intr_info & (EXCEPTION_ERROR_CODE_VALID << 8))
387+
exec_vmwrite(VMX_ENTRY_EXCEPTION_ERROR_CODE,
388+
vcpu->arch_vcpu.inject_info.error_code);
388389

389390
exec_vmwrite(VMX_ENTRY_INT_INFO_FIELD,
390391
vcpu->arch_vcpu.inject_info.intr_info);

0 commit comments

Comments
 (0)