Skip to content

Commit c09b9aa

Browse files
JasonChenCJlijinxia
authored andcommitted
exception: only trap #MC
HV only print out message for #MC then inject it back to guest. Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
1 parent d8d6176 commit c09b9aa

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

hypervisor/arch/x86/interrupt.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,12 @@ int exception_vmexit_handler(struct vcpu *vcpu)
476476
vcpu->arch_vcpu.exception_info.exception = exception_vector;
477477
vcpu->arch_vcpu.exception_info.error = int_err_code;
478478

479+
if (exception_vector == IDT_MC) {
480+
/* just print error message for #MC, it then will be injected
481+
* back to guest */
482+
pr_fatal("Exception #MC got from guest!");
483+
}
484+
479485
TRACE_4I(TRC_VMEXIT_EXCEPTION_OR_NMI,
480486
exception_vector, int_err_code, 2, 0);
481487

hypervisor/arch/x86/vmx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,9 +974,9 @@ static void init_exec_ctrl(struct vcpu *vcpu)
974974

975975
/* Set up guest exception mask bitmap setting a bit * causes a VM exit
976976
* on corresponding guest * exception - pg 2902 24.6.3
977-
* enable VM exit on MC and DB
977+
* enable VM exit on MC only
978978
*/
979-
value32 = (1 << IDT_MC) | (1u << IDT_DB);
979+
value32 = (1 << IDT_MC);
980980
exec_vmwrite(VMX_EXCEPTION_BITMAP, value32);
981981

982982
/* Set up page fault error code mask - second paragraph * pg 2902

0 commit comments

Comments
 (0)