[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 27/31] accel/tcg: Introduce TCGCPUOps::need_replay_interrupt() han
From: |
Richard Henderson |
Subject: |
[PULL 27/31] accel/tcg: Introduce TCGCPUOps::need_replay_interrupt() handler |
Date: |
Tue, 30 Jan 2024 09:01:17 +1000 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
In order to make accel/tcg/ target agnostic,
introduce the need_replay_interrupt() handler.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Message-Id: <20240124101639.30056-7-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/hw/core/tcg-cpu-ops.h | 5 +++++
accel/tcg/cpu-exec.c | 8 +++++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h
index 3ed279836f..013867b890 100644
--- a/include/hw/core/tcg-cpu-ops.h
+++ b/include/hw/core/tcg-cpu-ops.h
@@ -166,6 +166,11 @@ struct TCGCPUOps {
*/
bool (*io_recompile_replay_branch)(CPUState *cpu,
const TranslationBlock *tb);
+ /**
+ * @need_replay_interrupt: Return %true if @interrupt_request
+ * needs to be recorded for replay purposes.
+ */
+ bool (*need_replay_interrupt)(int interrupt_request);
#endif /* !CONFIG_USER_ONLY */
#endif /* NEED_CPU_H */
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 3aebf46849..34d10eb173 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -771,12 +771,14 @@ static inline bool cpu_handle_exception(CPUState *cpu,
int *ret)
* "real" interrupt event later. It does not need to be recorded for
* replay purposes.
*/
-static inline bool need_replay_interrupt(int interrupt_request)
+static inline bool need_replay_interrupt(CPUState *cpu, int interrupt_request)
{
#if defined(TARGET_I386)
return !(interrupt_request & CPU_INTERRUPT_POLL);
#else
- return true;
+ const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops;
+ return !tcg_ops->need_replay_interrupt
+ || tcg_ops->need_replay_interrupt(interrupt_request);
#endif
}
#endif /* !CONFIG_USER_ONLY */
@@ -864,7 +866,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
if (tcg_ops->cpu_exec_interrupt &&
tcg_ops->cpu_exec_interrupt(cpu, interrupt_request)) {
- if (need_replay_interrupt(interrupt_request)) {
+ if (need_replay_interrupt(cpu, interrupt_request)) {
replay_interrupt();
}
/*
--
2.34.1
- [PULL 20/31] accel/tcg: Rename tcg_ss[] -> tcg_specific_ss[] in meson, (continued)
- [PULL 20/31] accel/tcg: Rename tcg_ss[] -> tcg_specific_ss[] in meson, Richard Henderson, 2024/01/29
- [PULL 25/31] target/loongarch: Constify loongarch_tcg_ops, Richard Henderson, 2024/01/29
- [PULL 28/31] target/i386: Extract x86_need_replay_interrupt() from accel/tcg/, Richard Henderson, 2024/01/29
- [PULL 22/31] accel/tcg: Rename tcg_cpus_exec() -> tcg_cpu_exec(), Richard Henderson, 2024/01/29
- [PULL 29/31] accel/tcg: Inline need_replay_interrupt, Richard Henderson, 2024/01/29
- [PULL 24/31] include/qemu: Add TCGCPUOps typedef to typedefs.h, Richard Henderson, 2024/01/29
- [PULL 23/31] accel/tcg: Un-inline icount_exit_request() for clarity, Richard Henderson, 2024/01/29
- [PULL 31/31] target/i386: Extract x86_cpu_exec_halt() from accel/tcg/, Richard Henderson, 2024/01/29
- [PULL 30/31] accel/tcg: Introduce TCGCPUOps::cpu_exec_halt() handler, Richard Henderson, 2024/01/29
- [PULL 26/31] accel/tcg: Use CPUState.cc instead of CPU_GET_CLASS in cpu-exec.c, Richard Henderson, 2024/01/29
- [PULL 27/31] accel/tcg: Introduce TCGCPUOps::need_replay_interrupt() handler,
Richard Henderson <=
- Re: [PULL 00/31] tcg patch queue, Peter Maydell, 2024/01/31