assert_kdb (user_mode);
if (EXPECT_FALSE(!(ctxt->state(true) & Thread_ext_vcpu_enabled)))
- return -L4_err::EInval;
+ {
+ ctxt->arch_load_vcpu_kern_state(vcpu, true);
+ return -L4_err::EInval;
+ }
Vmcb *vmcb_s = reinterpret_cast<Vmcb*>(reinterpret_cast<char *>(vcpu) + 0x400);
for (;;)
&& (vcpu->sticky_flags & Vcpu_state::Sf_irq_pending))
{
vmcb_s->control_area.exitcode = 0x60;
+ ctxt->arch_load_vcpu_kern_state(vcpu, true);
return 1; // return 1 to indicate pending IRQs (IPCs)
}
// test for error or non-IRQ exit reason
if (r <= 0)
- return r;
+ {
+ ctxt->arch_load_vcpu_kern_state(vcpu, true);
+ return r;
+ }
// check for IRQ exits and allow to handle the IRQ
if (r == 1)
Thread *t = nonull_static_cast<Thread*>(ctxt);
if (t->continuation_test_and_restore())
- t->fast_return_to_user(vcpu->_entry_ip, vcpu->_entry_sp,
- t->vcpu_state().usr().get());
+ {
+ ctxt->arch_load_vcpu_kern_state(vcpu, true);
+ t->fast_return_to_user(vcpu->_entry_ip, vcpu->_entry_sp,
+ t->vcpu_state().usr().get());
+ }
}
}