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>
This commit is contained in:
Jason Chen CJ 2018-05-21 14:37:51 +08:00 committed by lijinxia
parent d8d6176266
commit c09b9aa9c1
2 changed files with 8 additions and 2 deletions

View File

@ -476,6 +476,12 @@ int exception_vmexit_handler(struct vcpu *vcpu)
vcpu->arch_vcpu.exception_info.exception = exception_vector;
vcpu->arch_vcpu.exception_info.error = int_err_code;
if (exception_vector == IDT_MC) {
/* just print error message for #MC, it then will be injected
* back to guest */
pr_fatal("Exception #MC got from guest!");
}
TRACE_4I(TRC_VMEXIT_EXCEPTION_OR_NMI,
exception_vector, int_err_code, 2, 0);

View File

@ -974,9 +974,9 @@ static void init_exec_ctrl(struct vcpu *vcpu)
/* Set up guest exception mask bitmap setting a bit * causes a VM exit
* on corresponding guest * exception - pg 2902 24.6.3
* enable VM exit on MC and DB
* enable VM exit on MC only
*/
value32 = (1 << IDT_MC) | (1u << IDT_DB);
value32 = (1 << IDT_MC);
exec_vmwrite(VMX_EXCEPTION_BITMAP, value32);
/* Set up page fault error code mask - second paragraph * pg 2902