[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 8/9] accel/tcg: Introduce TCGCPUOps::cpu_exec_halt() handler
|
From: |
Anton Johansson |
|
Subject: |
Re: [PATCH 8/9] accel/tcg: Introduce TCGCPUOps::cpu_exec_halt() handler |
|
Date: |
Wed, 24 Jan 2024 18:19:08 +0100 |
On 24/01/24, Philippe Mathieu-Daudé wrote:
> In order to make accel/tcg/ target agnostic,
> introduce the cpu_exec_halt() handler.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/hw/core/tcg-cpu-ops.h | 2 ++
> accel/tcg/cpu-exec.c | 3 +++
> 2 files changed, 5 insertions(+)
>
> diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h
> index 2fae3ac70f..3307338c80 100644
> --- a/include/hw/core/tcg-cpu-ops.h
> +++ b/include/hw/core/tcg-cpu-ops.h
> @@ -114,6 +114,8 @@ struct TCGCPUOps {
> void (*record_sigbus)(CPUState *cpu, vaddr addr,
> MMUAccessType access_type, uintptr_t ra);
> #else
> + /** @cpu_exec_halt: Callback for handling halt in cpu_exec */
> + void (*cpu_exec_halt)(CPUState *cpu);
> /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exec
> */
> bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request);
> /**
> diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
> index 5a978a9e72..390a9644da 100644
> --- a/accel/tcg/cpu-exec.c
> +++ b/accel/tcg/cpu-exec.c
> @@ -681,6 +681,9 @@ static inline bool cpu_handle_halt(CPUClass *cc, CPUState
> *cpu)
> bql_unlock();
> }
> #endif /* TARGET_I386 */
> + if (cc->tcg_ops->cpu_exec_halt) {
> + cc->tcg_ops->cpu_exec_halt(cpu);
> + }
> if (!cpu_has_work(cpu)) {
> return true;
> }
> --
> 2.41.0
>
Reviewed-by: Anton Johansson <anjo@rev.ng>
- [PATCH 5/9] accel/tcg: Hoist CPUClass arg to functions with external linkage, (continued)
- [PATCH 5/9] accel/tcg: Hoist CPUClass arg to functions with external linkage, Philippe Mathieu-Daudé, 2024/01/24
- [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é, 2024/01/24
- [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