Skip to content

Commit

Permalink
add new parameter "was_force_resumed" to vmexit_handler::handle_guest…
Browse files Browse the repository at this point in the history
…_resume() method

if was_force_resumed == true, then vmexit handler was resumed using vcpu_t::guest_resume() was called
  • Loading branch information
wbenny committed Oct 31, 2019
1 parent 7922700 commit 1d6b3d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/hvpp/hvpp/vcpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,11 @@ void vcpu_t::entry_host() noexcept
if (!resume_context_.capture())
{
handler_.handle(*this);

if (state_ != state::terminated)
{
handler_.handle_guest_resume(*this, false);
}
}
else
{
Expand All @@ -843,7 +848,7 @@ void vcpu_t::entry_host() noexcept
stacked_lock_guard_pop();
}

handler_.handle_guest_resume(*this);
handler_.handle_guest_resume(*this, true);
}

if (state_ == state::terminated)
Expand Down
3 changes: 2 additions & 1 deletion src/hvpp/hvpp/vmexit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ void vmexit_handler::handle(vcpu_t& vp) noexcept
(this->*handlers_[handler_index])(vp);
}

void vmexit_handler::handle_guest_resume(vcpu_t& vp) noexcept
void vmexit_handler::handle_guest_resume(vcpu_t& vp, bool was_force_resumed) noexcept
{
(void)(vp);
(void)(was_force_resumed);
}

//
Expand Down
2 changes: 1 addition & 1 deletion src/hvpp/hvpp/vmexit.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class vmexit_handler
// Use `auto _ = vp.stacked_lock_guard(lock)' for acquiring spinlocks.
// Spinlocks that are locked this way are by always unlocked.
//
virtual void handle_guest_resume(vcpu_t& vp) noexcept;
virtual void handle_guest_resume(vcpu_t& vp, bool was_force_resumed) noexcept;

protected:
//
Expand Down

0 comments on commit 1d6b3d0

Please sign in to comment.