[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 58/60] softmmu: fix watchpoint processing in icount mode
From: |
Richard Henderson |
Subject: |
[PULL v2 58/60] softmmu: fix watchpoint processing in icount mode |
Date: |
Thu, 28 Oct 2021 21:33:27 -0700 |
From: Pavel Dovgalyuk <pavel.dovgalyuk@ispras.ru>
Watchpoint processing code restores vCPU state twice:
in tb_check_watchpoint and in cpu_loop_exit_restore/cpu_restore_state.
Normally it does not affect anything, but in icount mode instruction
counter is incremented twice and becomes incorrect.
This patch eliminates unneeded CPU state restore.
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <163542168516.2127597.8781375223437124644.stgit@pasha-ThinkPad-X280>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
softmmu/physmem.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index 555c907f67..d58752678d 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -938,18 +938,16 @@ void cpu_check_watchpoint(CPUState *cpu, vaddr addr,
vaddr len,
cpu->watchpoint_hit = wp;
mmap_lock();
+ /* This call also restores vCPU state */
tb_check_watchpoint(cpu, ra);
if (wp->flags & BP_STOP_BEFORE_ACCESS) {
cpu->exception_index = EXCP_DEBUG;
mmap_unlock();
- cpu_loop_exit_restore(cpu, ra);
+ cpu_loop_exit(cpu);
} else {
/* Force execution of one insn next time. */
cpu->cflags_next_tb = 1 | curr_cflags(cpu);
mmap_unlock();
- if (ra) {
- cpu_restore_state(cpu, ra, true);
- }
cpu_loop_exit_noexc(cpu);
}
}
--
2.25.1
- [PULL v2 45/60] tcg/optimize: Expand fold_addsub2_i32 to 64-bit ops, (continued)
- [PULL v2 45/60] tcg/optimize: Expand fold_addsub2_i32 to 64-bit ops, Richard Henderson, 2021/10/29
- [PULL v2 48/60] tcg/optimize: Stop forcing z_mask to "garbage" for 32-bit values, Richard Henderson, 2021/10/29
- [PULL v2 60/60] softmmu: fix for "after access" watchpoints, Richard Henderson, 2021/10/29
- [PULL v2 44/60] tcg/optimize: Expand fold_mulu2_i32 to all 4-arg multiplies, Richard Henderson, 2021/10/29
- [PULL v2 47/60] tcg: Extend call args using the correct opcodes, Richard Henderson, 2021/10/29
- [PULL v2 46/60] tcg/optimize: Sink commutative operand swapping into fold functions, Richard Henderson, 2021/10/29
- [PULL v2 51/60] tcg/optimize: Use fold_xi_to_x for div, Richard Henderson, 2021/10/29
- [PULL v2 52/60] tcg/optimize: Use fold_xx_to_i for rem, Richard Henderson, 2021/10/29
- [PULL v2 55/60] tcg/optimize: Propagate sign info for setcond, Richard Henderson, 2021/10/29
- [PULL v2 54/60] tcg/optimize: Propagate sign info for logical operations, Richard Henderson, 2021/10/29
- [PULL v2 58/60] softmmu: fix watchpoint processing in icount mode,
Richard Henderson <=
- [PULL v2 50/60] tcg/optimize: Use fold_xi_to_x for mul, Richard Henderson, 2021/10/29
- [PULL v2 53/60] tcg/optimize: Optimize sign extensions, Richard Henderson, 2021/10/29
- [PULL v2 49/60] tcg/optimize: Use fold_xx_to_i for orc, Richard Henderson, 2021/10/29
- [PULL v2 57/60] tcg/optimize: Propagate sign info for shifting, Richard Henderson, 2021/10/29
- [PULL v2 56/60] tcg/optimize: Propagate sign info for bit counting, Richard Henderson, 2021/10/29
- [PULL v2 59/60] softmmu: remove useless condition in watchpoint check, Richard Henderson, 2021/10/29
- Re: [PULL v2 00/60] tcg patch queue, Richard Henderson, 2021/10/29