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é <phi...@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 <a...@rev.ng>
- Re: [PATCH 2/9] accel/tcg: Rename tcg_cpus_de... Anton Johansson via
- Re: [PATCH 2/9] accel/tcg: Rename tcg_cpus_de... Richard Henderson
- [PATCH 3/9] accel/tcg: Rename tcg_cpus_exec() ->... Philippe Mathieu-Daudé
- Re: [PATCH 3/9] accel/tcg: Rename tcg_cpus_ex... Anton Johansson via
- Re: [PATCH 3/9] accel/tcg: Rename tcg_cpus_ex... Richard Henderson
- [PATCH 5/9] accel/tcg: Hoist CPUClass arg to funct... Philippe Mathieu-Daudé
- Re: [PATCH 5/9] accel/tcg: Hoist CPUClass arg... Anton Johansson via
- Re: [PATCH 5/9] accel/tcg: Hoist CPUClass arg... Richard Henderson
- Re: [PATCH 5/9] accel/tcg: Hoist CPUClass... Philippe Mathieu-Daudé
- [PATCH 8/9] accel/tcg: Introduce TCGCPUOps::cpu_ex... Philippe Mathieu-Daudé
- Re: [PATCH 8/9] accel/tcg: Introduce TCGCPUOp... Anton Johansson via
- Re: [PATCH 8/9] accel/tcg: Introduce TCGCPUOp... Richard Henderson
- Re: [PATCH 0/9] accel/tcg: Extract some x86-specif... Philippe Mathieu-Daudé
- [PATCH 4/9] accel/tcg: Un-inline icount_exit_reque... Philippe Mathieu-Daudé
- Re: [PATCH 4/9] accel/tcg: Un-inline icount_e... Anton Johansson via
- Re: [PATCH 4/9] accel/tcg: Un-inline icount_e... Richard Henderson
- [PATCH 6/9] accel/tcg: Introduce TCGCPUOps::need_r... Philippe Mathieu-Daudé
- Re: [PATCH 6/9] accel/tcg: Introduce TCGCPUOp... Anton Johansson via
- Re: [PATCH 6/9] accel/tcg: Introduce TCGCPUOp... Richard Henderson
- Re: [PATCH 6/9] accel/tcg: Introduce TCGCPUOp... Pavel Dovgalyuk
- [PATCH 9/9] target/i386: Extract x86_cpu_exec_halt... Philippe Mathieu-Daudé