[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 011/115] icount: fix shift=auto for record/replay
From: |
Paolo Bonzini |
Subject: |
[PULL 011/115] icount: fix shift=auto for record/replay |
Date: |
Thu, 11 Jun 2020 15:43:05 -0400 |
From: Pavel Dovgalyuk <Pavel.Dovgaluk@gmail.com>
This patch fixes shift=auto when record/replay is enabled.
Now user does not need to guess the best shift value.
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
--
v2:
moved icount_time_shift to vmstate subsection
Message-Id: <158988500050.15192.692077802469400393.stgit@pasha-ThinkPad-X280>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
cpus.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/cpus.c b/cpus.c
index 5670c96bcf..7ce0d569b3 100644
--- a/cpus.c
+++ b/cpus.c
@@ -379,7 +379,8 @@ static void icount_adjust(void)
seqlock_write_lock(&timers_state.vm_clock_seqlock,
&timers_state.vm_clock_lock);
- cur_time = cpu_get_clock_locked();
+ cur_time = REPLAY_CLOCK_LOCKED(REPLAY_CLOCK_VIRTUAL_RT,
+ cpu_get_clock_locked());
cur_icount = cpu_get_icount_locked();
delta = cur_icount - cur_time;
@@ -647,6 +648,11 @@ static bool adjust_timers_state_needed(void *opaque)
return s->icount_rt_timer != NULL;
}
+static bool shift_state_needed(void *opaque)
+{
+ return use_icount == 2;
+}
+
/*
* Subsection for warp timer migration is optional, because may not be created
*/
@@ -674,6 +680,17 @@ static const VMStateDescription
icount_vmstate_adjust_timers = {
}
};
+static const VMStateDescription icount_vmstate_shift = {
+ .name = "timer/icount/shift",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = shift_state_needed,
+ .fields = (VMStateField[]) {
+ VMSTATE_INT16(icount_time_shift, TimersState),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
/*
* This is a subsection for icount migration.
*/
@@ -690,6 +707,7 @@ static const VMStateDescription icount_vmstate_timers = {
.subsections = (const VMStateDescription*[]) {
&icount_vmstate_warp_timer,
&icount_vmstate_adjust_timers,
+ &icount_vmstate_shift,
NULL
}
};
--
2.26.2
- [PULL 000/115] Huge miscellaneous pull request for 2020-06-11, Paolo Bonzini, 2020/06/11
- [PULL 008/115] run-coverity-scan: support --update-tools-only --docker, Paolo Bonzini, 2020/06/11
- [PULL 002/115] docker.py/build: support binary files in --extra-files, Paolo Bonzini, 2020/06/11
- [PULL 004/115] run-coverity-scan: use docker.py, Paolo Bonzini, 2020/06/11
- [PULL 001/115] docker.py/build: support -t and -f arguments, Paolo Bonzini, 2020/06/11
- [PULL 011/115] icount: fix shift=auto for record/replay,
Paolo Bonzini <=
- [PULL 007/115] run-coverity-scan: download tools outside the container, Paolo Bonzini, 2020/06/11
- [PULL 006/115] run-coverity-scan: use --no-update-tools in docker run, Paolo Bonzini, 2020/06/11
- [PULL 003/115] run-coverity-scan: get Coverity token and email from special git config section, Paolo Bonzini, 2020/06/11
- [PULL 010/115] numa: prevent usage of -M memory-backend and -numa memdev at the same time, Paolo Bonzini, 2020/06/11
- [PULL 016/115] Makefile: Let the 'help' target list the helper targets, Paolo Bonzini, 2020/06/11
- [PULL 015/115] io/task: Move 'qom/object.h' header to source, Paolo Bonzini, 2020/06/11
- [PULL 021/115] i386: Hyper-V VMBus ACPI DSDT entry, Paolo Bonzini, 2020/06/11
- [PULL 018/115] vmbus: add vmbus protocol definitions, Paolo Bonzini, 2020/06/11
- [PULL 020/115] i386:pc: whitelist dynamic vmbus-bridge, Paolo Bonzini, 2020/06/11
- [PULL 028/115] hw/i386/vmport: Set EAX to -1 on failed and unsupported commands, Paolo Bonzini, 2020/06/11