]> git.proxmox.com Git - mirror_qemu.git/commitdiff
i386: hvf: inject General Protection Fault when vmexit through vmcall
authorSergio Andres Gomez Del Real <sergio.g.delreal@gmail.com>
Wed, 13 Sep 2017 09:05:22 +0000 (04:05 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 22 Dec 2017 14:01:48 +0000 (15:01 +0100)
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>
target/i386/hvf-all.c

index 1df13fbc195ea284b0483ae037b849aa54b9b574..126344f5be8255f49782aa3cf2c48d00f2e2091b 100644 (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);