Skip to content

Commit ccc1c25

Browse files
mingqiangchilijinxia
authored andcommitted
hv:Use exception vector MACRO instead of hardcode
Now use hardcode when inject GP/NMI to guest, replace it with MACRO. Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
1 parent 975484a commit ccc1c25

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hypervisor/arch/x86/interrupt.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ static int vcpu_do_pending_gp(__unused struct vcpu *vcpu)
210210
/* GP vector = 13 */
211211
exec_vmwrite(VMX_ENTRY_INT_INFO_FIELD,
212212
VMX_INT_INFO_VALID |
213-
((VMX_INT_TYPE_HW_EXP | EXCEPTION_ERROR_CODE_VALID) <<8) | 13);
213+
((VMX_INT_TYPE_HW_EXP | EXCEPTION_ERROR_CODE_VALID) << 8) |
214+
IDT_GP);
215+
214216
return 0;
215217
}
216218

@@ -357,7 +359,7 @@ int acrn_do_intr_process(struct vcpu *vcpu)
357359
if (bitmap_test_and_clear(ACRN_REQUEST_NMI, pending_intr_bits)) {
358360
/* Inject NMI vector = 2 */
359361
exec_vmwrite(VMX_ENTRY_INT_INFO_FIELD,
360-
VMX_INT_INFO_VALID | (VMX_INT_TYPE_NMI << 8) | 2);
362+
VMX_INT_INFO_VALID | (VMX_INT_TYPE_NMI << 8) | IDT_NMI);
361363

362364
/* Intel SDM 10.8.1
363365
* NMI, SMI, INIT, ExtINT, or SIPI directly deliver to CPU

0 commit comments

Comments
 (0)