i386: hvf: inject General Protection Fault when vmexit through vmcall

This patch injects a GP fault when the guest vmexit's by executing a
vmcall instruction.

Signed-off-by: Sergio Andres Gomez Del Real <Sergio.G.DelReal@gmail.com>
Message-Id: <20170913090522.4022-15-Sergio.G.DelReal@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Sergio Andres Gomez Del Real 2017-09-13 04:05:22 -05:00 committed by Paolo Bonzini
parent b7394c8394
commit 3010460fb9
1 changed files with 3 additions and 1 deletions

View File

@ -902,7 +902,9 @@ int hvf_vcpu_exec(CPUState *cpu)
macvm_set_rip(cpu, rip + ins_len);
break;
case VMX_REASON_VMCALL:
/* TODO: inject #GP fault */
env->exception_injected = EXCP0D_GPF;
env->has_error_code = true;
env->error_code = 0;
break;
default:
error_report("%llx: unhandled exit %llx\n", rip, exit_reason);