[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/37] replay: don't record interrupt poll
From: |
Paolo Bonzini |
Subject: |
[PULL 24/37] replay: don't record interrupt poll |
Date: |
Tue, 6 Oct 2020 09:29:34 +0200 |
From: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>
Interrupt poll is not a real interrupt event. It is needed only for
thread safety. This interrupt is used for i386 and converted
to hardware interrupt by cpu_handle_interrupt function.
Therefore it is not needed to be recorded, because hardware
interrupt will be recorded after converting.
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
--
v4 changes:
- Condition check refactoring (suggested by Alex Bennée)
Message-Id: <160174517124.12451.12983410242461131737.stgit@pasha-ThinkPad-X280>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
accel/tcg/cpu-exec.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 0dbe67acf5..58aea605d8 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -436,8 +436,7 @@ static inline bool cpu_handle_halt(CPUState *cpu)
{
if (cpu->halted) {
#if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY)
- if ((cpu->interrupt_request & CPU_INTERRUPT_POLL)
- && replay_interrupt()) {
+ if (cpu->interrupt_request & CPU_INTERRUPT_POLL) {
X86CPU *x86_cpu = X86_CPU(cpu);
qemu_mutex_lock_iothread();
apic_poll_irq(x86_cpu->apic_state);
@@ -533,6 +532,20 @@ static inline bool cpu_handle_exception(CPUState *cpu, int
*ret)
return false;
}
+/*
+ * CPU_INTERRUPT_POLL is a virtual event which gets converted into a
+ * "real" interrupt event later. It does not need to be recorded for
+ * replay purposes.
+ */
+static inline bool need_replay_interrupt(int interrupt_request)
+{
+#if defined(TARGET_I386)
+ return !(interrupt_request & CPU_INTERRUPT_POLL);
+#else
+ return true;
+#endif
+}
+
static inline bool cpu_handle_interrupt(CPUState *cpu,
TranslationBlock **last_tb)
{
@@ -594,7 +607,9 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
and via longjmp via cpu_loop_exit. */
else {
if (cc->cpu_exec_interrupt(cpu, interrupt_request)) {
- replay_interrupt();
+ if (need_replay_interrupt(interrupt_request)) {
+ replay_interrupt();
+ }
/*
* After processing the interrupt, ensure an EXCP_DEBUG is
* raised when single-stepping so that GDB doesn't miss the
--
2.26.2
- [PULL 14/37] whpx: remove whpx specific functions from global includes, (continued)
- [PULL 14/37] whpx: remove whpx specific functions from global includes, Paolo Bonzini, 2020/10/06
- [PULL 16/37] kvm: remove kvm specific functions from global includes, Paolo Bonzini, 2020/10/06
- [PULL 17/37] kvm: kvm_init_vcpu take Error pointer, Paolo Bonzini, 2020/10/06
- [PULL 18/37] accel/tcg: use current_machine as it is always set for softmmu, Paolo Bonzini, 2020/10/06
- [PULL 19/37] slirp: Convert Makefile bits to meson bits, Paolo Bonzini, 2020/10/06
- [PULL 20/37] dtc: Convert Makefile bits to meson bits, Paolo Bonzini, 2020/10/06
- [PULL 23/37] configure: don't enable ASLR for --enable-debug Windows builds, Paolo Bonzini, 2020/10/06
- [PULL 22/37] configure: consistently pass CFLAGS/CXXFLAGS/LDFLAGS to meson, Paolo Bonzini, 2020/10/06
- [PULL 25/37] replay: provide an accessor for rr filename, Paolo Bonzini, 2020/10/06
- [PULL 21/37] configure: do not clobber environment CFLAGS/CXXFLAGS/LDFLAGS, Paolo Bonzini, 2020/10/06
- [PULL 24/37] replay: don't record interrupt poll,
Paolo Bonzini <=
- [PULL 26/37] qcow2: introduce icount field for snapshots, Paolo Bonzini, 2020/10/06
- [PULL 27/37] migration: introduce icount field for snapshots, Paolo Bonzini, 2020/10/06
- [PULL 28/37] qapi: introduce replay.json for record/replay-related stuff, Paolo Bonzini, 2020/10/06
- [PULL 29/37] replay: introduce info hmp/qmp command, Paolo Bonzini, 2020/10/06
- [PULL 30/37] replay: introduce breakpoint at the specified step, Paolo Bonzini, 2020/10/06
- [PULL 35/37] replay: describe reverse debugging in docs/replay.txt, Paolo Bonzini, 2020/10/06
- [PULL 32/37] replay: flush rr queue before loading the vmstate, Paolo Bonzini, 2020/10/06
- [PULL 31/37] replay: implement replay-seek command, Paolo Bonzini, 2020/10/06
- [PULL 33/37] gdbstub: add reverse step support in replay mode, Paolo Bonzini, 2020/10/06