accel/tcg: Introduce TCGCPUOps::need_replay_interrupt() handler
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>
This commit is contained in:
parent
991bd65ddd
commit
0fdc69b76e
@ -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
|
* "real" interrupt event later. It does not need to be recorded for
|
||||||
* replay purposes.
|
* 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)
|
#if defined(TARGET_I386)
|
||||||
return !(interrupt_request & CPU_INTERRUPT_POLL);
|
return !(interrupt_request & CPU_INTERRUPT_POLL);
|
||||||
#else
|
#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
|
||||||
}
|
}
|
||||||
#endif /* !CONFIG_USER_ONLY */
|
#endif /* !CONFIG_USER_ONLY */
|
||||||
@ -864,7 +866,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu,
|
|||||||
|
|
||||||
if (tcg_ops->cpu_exec_interrupt &&
|
if (tcg_ops->cpu_exec_interrupt &&
|
||||||
tcg_ops->cpu_exec_interrupt(cpu, interrupt_request)) {
|
tcg_ops->cpu_exec_interrupt(cpu, interrupt_request)) {
|
||||||
if (need_replay_interrupt(interrupt_request)) {
|
if (need_replay_interrupt(cpu, interrupt_request)) {
|
||||||
replay_interrupt();
|
replay_interrupt();
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -166,6 +166,11 @@ struct TCGCPUOps {
|
|||||||
*/
|
*/
|
||||||
bool (*io_recompile_replay_branch)(CPUState *cpu,
|
bool (*io_recompile_replay_branch)(CPUState *cpu,
|
||||||
const TranslationBlock *tb);
|
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 /* !CONFIG_USER_ONLY */
|
||||||
#endif /* NEED_CPU_H */
|
#endif /* NEED_CPU_H */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user