[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 15/40] accel: Simplify cpu_has_work()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v6 15/40] accel: Simplify cpu_has_work() |
Date: |
Fri, 24 Sep 2021 11:38:22 +0200 |
Now that all accelerators implement a has_work() handler, we can
simplify cpu_has_work() by removing the non-NULL handler check.
Add an assertion in cpus_register_accel() for future accelerators.
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
softmmu/cpus.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/softmmu/cpus.c b/softmmu/cpus.c
index bb16a25bcef..bbb83d5982a 100644
--- a/softmmu/cpus.c
+++ b/softmmu/cpus.c
@@ -251,10 +251,7 @@ void cpu_interrupt(CPUState *cpu, int mask)
bool cpu_has_work(CPUState *cpu)
{
- if (cpus_accel->has_work && cpus_accel->has_work(cpu)) {
- return true;
- }
- return false;
+ return cpus_accel->has_work(cpu);
}
static int do_vm_stop(RunState state, bool send_stop)
@@ -613,6 +610,7 @@ void cpus_register_accel(const AccelOpsClass *ops)
/* Mandatory non-NULL handlers */
assert(ops->create_vcpu_thread != NULL);
+ assert(ops->has_work != NULL);
cpus_accel = ops;
}
--
2.31.1
- [PATCH v6 05/40] hw/core: Move cpu_common_has_work() to cpu_has_work(), (continued)
- [PATCH v6 05/40] hw/core: Move cpu_common_has_work() to cpu_has_work(), Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 06/40] accel: Introduce AccelOpsClass::has_work(), Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 07/40] accel/kvm: Implement AccelOpsClass::has_work(), Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 08/40] accel/whpx: Implement AccelOpsClass::has_work(), Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 09/40] accel/hvf: Implement AccelOpsClass::has_work(), Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 10/40] accel/xen: Implement AccelOpsClass::has_work(), Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 11/40] accel/hax: Implement AccelOpsClass::has_work(), Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 12/40] accel/nvmm: Implement AccelOpsClass::has_work(), Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 13/40] accel/qtest: Implement AccelOpsClass::has_work(), Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 14/40] accel/tcg: Implement AccelOpsClass::has_work(), Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 15/40] accel: Simplify cpu_has_work(),
Philippe Mathieu-Daudé <=
- [PATCH v6 16/40] accel/tcg: Introduce TCGCPUOps::has_work(), Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 17/40] target/arm: Explicit v7M cores use arm_cpu_has_work as CPUClass:has_work, Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 18/40] target/arm: Restrict has_work() handler to sysemu and TCG, Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 19/40] target/avr: Restrict has_work() handler to sysemu, Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 21/40] target/hexagon: Remove unused has_work() handler, Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 20/40] target/cris: Restrict has_work() handler to sysemu, Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 22/40] target/hppa: Restrict has_work() handler to sysemu, Philippe Mathieu-Daudé, 2021/09/24
- [PATCH v6 23/40] target/i386: Restrict has_work() handler to sysemu and TCG, Philippe Mathieu-Daudé, 2021/09/24