Skip to content

Commit

Permalink
target/i386: Extract x86_need_replay_interrupt() from accel/tcg/
Browse files Browse the repository at this point in the history
Move this x86-specific code out of the generic accel/tcg/.

Reviewed-by: Anton Johansson <anjo@rev.ng>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240124101639.30056-8-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
philmd authored and rth7680 committed Jan 29, 2024
1 parent 0fdc69b commit 6ae7548
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 0 additions & 4 deletions accel/tcg/cpu-exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,13 +773,9 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
*/
static inline bool need_replay_interrupt(CPUState *cpu, int interrupt_request)
{
#if defined(TARGET_I386)
return !(interrupt_request & CPU_INTERRUPT_POLL);
#else
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 */

Expand Down
1 change: 1 addition & 0 deletions target/i386/tcg/helper-tcg.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ QEMU_BUILD_BUG_ON(TCG_PHYS_ADDR_BITS > TARGET_PHYS_ADDR_SPACE_BITS);
*/
void x86_cpu_do_interrupt(CPUState *cpu);
#ifndef CONFIG_USER_ONLY
bool x86_need_replay_interrupt(int interrupt_request);
bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req);
#endif

Expand Down
10 changes: 10 additions & 0 deletions target/i386/tcg/sysemu/seg_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ void x86_cpu_do_interrupt(CPUState *cs)
}
}

bool x86_need_replay_interrupt(int interrupt_request)
{
/*
* 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.
*/
return !(interrupt_request & CPU_INTERRUPT_POLL);
}

bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
{
X86CPU *cpu = X86_CPU(cs);
Expand Down
1 change: 1 addition & 0 deletions target/i386/tcg/tcg-cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ static const TCGCPUOps x86_tcg_ops = {
.do_unaligned_access = x86_cpu_do_unaligned_access,
.debug_excp_handler = breakpoint_handler,
.debug_check_breakpoint = x86_debug_check_breakpoint,
.need_replay_interrupt = x86_need_replay_interrupt,
#endif /* !CONFIG_USER_ONLY */
};

Expand Down

0 comments on commit 6ae7548

Please sign in to comment.