+Peter, Paolo, Richard
On 2/7/26 15:51, Daniel Henrique Barboza wrote:
riscv_cpu_has_work() uses a handful of irq pending functions from
cpu_helper.c. There is a very high possibility that KVM doesn't need
the current implermentation of has_work(), but the common accel code
needs an implementation of this callback (see cpu_exec_class_post_init)
otherwise the KVM driver won't initialize.
See commits 408b2b3d9df ("accel/tcg: Make TCGCPUOps::cpu_exec_halt
return bool for whether to halt") and 0487c631801 ("accel/tcg: Make
TCGCPUOps::cpu_exec_halt mandatory").
Looking at cpu_thread_is_idle(), TCG could register its
AccelOpsClass::cpu_thread_is_idle handler as !cpu_exec_halt, allowing
to restrict cpu_has_work() to TCG?
Move the relevant irq helpers to cpu.c to allow KVM to keep using the
current has_work implementation, allowing --disable-tcg to work. We'll
circle it back to evaluate a proper KVM implementation for it in a later
date.
Signed-off-by: Daniel Henrique Barboza <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
---
target/riscv/cpu.c | 187 ++++++++++++++++++++++++++++++++++
target/riscv/cpu.h | 5 +
target/riscv/tcg/cpu_helper.c | 187 ----------------------------------
3 files changed, 192 insertions(+), 187 deletions(-)