[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/9] accel/tcg: Introduce TCGCPUOps::need_replay_interrupt() hand
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 6/9] accel/tcg: Introduce TCGCPUOps::need_replay_interrupt() handler |
Date: |
Wed, 24 Jan 2024 11:16:36 +0100 |
In order to make accel/tcg/ target agnostic,
introduce the need_replay_interrupt() handler.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/core/tcg-cpu-ops.h | 5 +++++
accel/tcg/cpu-exec.c | 5 ++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h
index 479713a36e..2fae3ac70f 100644
--- a/include/hw/core/tcg-cpu-ops.h
+++ b/include/hw/core/tcg-cpu-ops.h
@@ -170,6 +170,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 b10472cbc7..4ab7d6c896 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -778,7 +778,10 @@ static inline bool need_replay_interrupt(CPUClass *cc, int
interrupt_request)
#if defined(TARGET_I386)
return !(interrupt_request & CPU_INTERRUPT_POLL);
#else
- return true;
+ if (!cc->tcg_ops->need_replay_interrupt) {
+ return true;
+ }
+ return cc->tcg_ops->need_replay_interrupt(interrupt_request);
#endif
}
#endif /* !CONFIG_USER_ONLY */
--
2.41.0
- Re: [PATCH 5/9] accel/tcg: Hoist CPUClass arg to functions with external linkage, (continued)
- [PATCH 7/9] target/i386: Extract x86_need_replay_interrupt() from accel/tcg/, Philippe Mathieu-Daudé, 2024/01/24
- [PATCH 8/9] accel/tcg: Introduce TCGCPUOps::cpu_exec_halt() handler, Philippe Mathieu-Daudé, 2024/01/24
- [PATCH 6/9] accel/tcg: Introduce TCGCPUOps::need_replay_interrupt() handler,
Philippe Mathieu-Daudé <=
- [PATCH 9/9] target/i386: Extract x86_cpu_exec_halt() from accel/tcg/, Philippe Mathieu-Daudé, 2024/01/24
- Re: [PATCH 0/9] accel/tcg: Extract some x86-specific code, Philippe Mathieu-Daudé, 2024/01/24
- Re: [PATCH 0/9] accel/tcg: Extract some x86-specific code, Richard Henderson, 2024/01/27