From cb51d67c8df138fbed816f91004d2640ef7e51bc Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Tue, 11 Nov 2014 13:16:52 +0100 Subject: [PATCH] vbox: don't enforce instruction emulation after recall event Fixes #1284 --- repos/ports/src/virtualbox/nova/vcpu.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/repos/ports/src/virtualbox/nova/vcpu.h b/repos/ports/src/virtualbox/nova/vcpu.h index bdb97853a..b9795288d 100644 --- a/repos/ports/src/virtualbox/nova/vcpu.h +++ b/repos/ports/src/virtualbox/nova/vcpu.h @@ -131,6 +131,8 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher void * _stack_reply; jmp_buf _env; + bool _last_exit_was_recall; + void switch_to_hw() { unsigned long value; @@ -171,9 +173,11 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher } /* are we forced to go back to emulation mode ? */ - if (!continue_hw_accelerated(utcb)) + if (!continue_hw_accelerated(utcb)) { + _last_exit_was_recall = true; /* go back to emulation mode */ _fpu_save_and_longjmp(); + } /* check whether we have to request irq injection window */ utcb->mtd = Nova::Mtd::FPU; @@ -695,6 +699,8 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher _current_vm = pVM; _current_vcpu = pVCpu; + _last_exit_was_recall = false; + /* switch to hardware accelerated mode */ switch_to_hw(); @@ -735,7 +741,7 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher next_utcb.mtd |= Mtd::STA; } - return VINF_EM_RAW_EMULATE_INSTR; + return _last_exit_was_recall ? VINF_SUCCESS : VINF_EM_RAW_EMULATE_INSTR; } };