mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
replay: interrupts and exceptions
This patch includes modifications of common cpu files. All interrupts and exceptions occured during recording are written into the replay log. These events allow correct replaying the execution by kicking cpu thread when one of these events is found in the log. Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Message-Id: <20150917162416.8676.57647.stgit@PASHA-ISP.def.inno> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
8b42704441
commit
6f0609697f
5 changed files with 146 additions and 10 deletions
|
@ -79,3 +79,70 @@ void replay_account_executed_instructions(void)
|
|||
replay_mutex_unlock();
|
||||
}
|
||||
}
|
||||
|
||||
bool replay_exception(void)
|
||||
{
|
||||
if (replay_mode == REPLAY_MODE_RECORD) {
|
||||
replay_save_instructions();
|
||||
replay_mutex_lock();
|
||||
replay_put_event(EVENT_EXCEPTION);
|
||||
replay_mutex_unlock();
|
||||
return true;
|
||||
} else if (replay_mode == REPLAY_MODE_PLAY) {
|
||||
bool res = replay_has_exception();
|
||||
if (res) {
|
||||
replay_mutex_lock();
|
||||
replay_finish_event();
|
||||
replay_mutex_unlock();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool replay_has_exception(void)
|
||||
{
|
||||
bool res = false;
|
||||
if (replay_mode == REPLAY_MODE_PLAY) {
|
||||
replay_account_executed_instructions();
|
||||
replay_mutex_lock();
|
||||
res = replay_next_event_is(EVENT_EXCEPTION);
|
||||
replay_mutex_unlock();
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
bool replay_interrupt(void)
|
||||
{
|
||||
if (replay_mode == REPLAY_MODE_RECORD) {
|
||||
replay_save_instructions();
|
||||
replay_mutex_lock();
|
||||
replay_put_event(EVENT_INTERRUPT);
|
||||
replay_mutex_unlock();
|
||||
return true;
|
||||
} else if (replay_mode == REPLAY_MODE_PLAY) {
|
||||
bool res = replay_has_interrupt();
|
||||
if (res) {
|
||||
replay_mutex_lock();
|
||||
replay_finish_event();
|
||||
replay_mutex_unlock();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool replay_has_interrupt(void)
|
||||
{
|
||||
bool res = false;
|
||||
if (replay_mode == REPLAY_MODE_PLAY) {
|
||||
replay_account_executed_instructions();
|
||||
replay_mutex_lock();
|
||||
res = replay_next_event_is(EVENT_INTERRUPT);
|
||||
replay_mutex_unlock();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue