accel/hvf: Include missing 'hw/core/cpu.h' header
PATCH 1/1 accel/hvf: Include missing 'hw/core/cpu.h' header
Since commit d5bd8d8267e ("hvf: only update sysreg from owning thread") hvf-all.c accesses the run_on_cpu_data type and calls run_on_cpu(), both defined in the "hw/core/cpu.h" header. Fortunately, it is indirectly included via:
"system/hvf.h"
-> "target/arm/cpu.h"
-> "target/arm/cpu-qom.h"
-> "hw/core/cpu.h""system/hvf.h" however doesn't need "target/arm/cpu.h" and we want to remove it there. In order to do that we first need to include it in the hvf-all.c file.
--- accel/hvf/hvf-all.c | 1 + 1 file changed, 1 insertion(+)
accel/hvf/hvf-all.c +1 -0
@@ -12,6 +12,7 @@#include "qemu/error-report.h" #include "system/hvf.h" #include "system/hvf_int.h" +#include "hw/core/cpu.h" const char *hvf_return_string (hv_return_t ret) {
Signature · 1 line
2.47.1
Quoted 5 lines · Philippe Mathieu-Daudé
Since commit
d5bd8d8267e("hvf: only update sysreg from owning thread")hvf-all.caccesses therun_on_cpu_datatype and callsrun_on_cpu(), both defined in the "hw/core/cpu.h" header. Fortunately, it is indirectly included via:
Quoted 8 lines
"system/hvf.h" -> "target/arm/cpu.h" -> "target/arm/cpu-qom.h" -> "hw/core/cpu.h""
system/hvf.h" however doesn't need "target/arm/cpu.h" and we want to remove it there. In order to do that we first need to include it in thehvf-all.cfile.
include it in hvf-all.c, otherwise we get:
../accel/hvf/hvf-all.c:61:54: error: unknown type name 'run_on_cpu_data'
61 | static void do_hvf_update_guest_debug(CPUState *cpu,run_on_cpu_data arg)
| ^../accel/hvf/hvf-all.c:68:5: error: call to undeclared function 'run_on_cpu'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
68 | run_on_cpu(cpu, do_hvf_update_guest_debug, RUN_ON_CPU_NULL);
| ^../accel/hvf/hvf-all.c:68:48: error: use of undeclared identifier 'RUN_ON_CPU_NULL'
68 | run_on_cpu(cpu, do_hvf_update_guest_debug, RUN_ON_CPU_NULL);
| ^
3 errors generated.
Quoted 20 lines
Cc Mads Ynddal <[email protected]>Reported-by Stefan Hajnoczi <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- accel/hvf/hvf-all.c | 1 + 1 file changed, 1 insertion(+)accel/hvf/hvf-all.c +1
-0@@ -12,6 +12,7 @@#include "qemu/error-report.h" #include "system/hvf.h" #include "system/hvf_int.h" +#include "hw/core/cpu.h" const char *hvf_return_string (hv_return_t ret) {
Quoted 26 lines · Philippe Mathieu-Daudé
Since commit
d5bd8d8267e("hvf: only update sysreg from owning thread")hvf-all.caccesses therun_on_cpu_datatype and callsrun_on_cpu(), both defined in the "hw/core/cpu.h" header. Fortunately, it is indirectly included via:"system/hvf.h" -> "target/arm/cpu.h" -> "target/arm/cpu-qom.h" -> "hw/core/cpu.h""
system/hvf.h" however doesn't need "target/arm/cpu.h" and we want to remove it there. In order to do that we first need to include it in thehvf-all.cfile.Cc Mads Ynddal <[email protected]>Reported-by Stefan Hajnoczi <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- accel/hvf/hvf-all.c | 1 + 1 file changed, 1 insertion(+)accel/hvf/hvf-all.c +0
-0
accel/hvf/hvf-all.c line 18
Quoted 7 lines
accel/hvf/hvf-all.c +1
-0@@ -12,6 +12,7 @@#include "qemu/error-report.h" #include "system/hvf.h" #include "system/hvf_int.h" +#include "hw/core/cpu.h" const char *hvf_return_string (hv_return_t ret) {
Quoted 27 lines
Since commit
d5bd8d8267e("hvf: only update sysreg from owning thread")hvf-all.caccesses therun_on_cpu_datatype and callsrun_on_cpu(), both defined in the "hw/core/cpu.h" header. Fortunately, it is indirectly included via:"
system/hvf.h"
-> "target/arm/cpu.h"-> "target/arm/cpu-qom.h" -> "hw/core/cpu.h""
system/hvf.h" however doesn't need "target/arm/cpu.h" and we want to remove it there. In order to do that we first need to include it in thehvf-all.cfile.Cc Mads Ynddal <[email protected]>Reported-by Stefan Hajnoczi <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
accel/hvf/hvf-all.c| 1 +1 file changed, 1 insertion(+)accel/hvf/hvf-all.c +0
-0
accel/hvf/hvf-all.c line 18
Quoted 7 lines
accel/hvf/hvf-all.c +1
-0@@ -12,6 +12,7 @@#include "qemu/error-report.h" #include "system/hvf.h" #include "system/hvf_int.h" +#include "hw/core/cpu.h" const char *hvf_return_string (hv_return_t ret) {
Good catch, I should have included that in the initial patch.