cpus.c | 12 ------------ include/sysemu/hw_accel.h | 9 +++++++++ 2 files changed, 9 insertions(+), 12 deletions(-)
Keep the calls made to synchronize cpu by all hypervisors in one place
inside cpu_synchronize_* functions in include/sysemu/hw_accel.h
Cc: Richard Henderson <rth@twiddle.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com>
---
cpus.c | 12 ------------
include/sysemu/hw_accel.h | 9 +++++++++
2 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/cpus.c b/cpus.c
index e83f72b48b..026df0dc5f 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1021,10 +1021,6 @@ void cpu_synchronize_all_states(void)
CPU_FOREACH(cpu) {
cpu_synchronize_state(cpu);
- /* TODO: move to cpu_synchronize_state() */
- if (hvf_enabled()) {
- hvf_cpu_synchronize_state(cpu);
- }
}
}
@@ -1034,10 +1030,6 @@ void cpu_synchronize_all_post_reset(void)
CPU_FOREACH(cpu) {
cpu_synchronize_post_reset(cpu);
- /* TODO: move to cpu_synchronize_post_reset() */
- if (hvf_enabled()) {
- hvf_cpu_synchronize_post_reset(cpu);
- }
}
}
@@ -1047,10 +1039,6 @@ void cpu_synchronize_all_post_init(void)
CPU_FOREACH(cpu) {
cpu_synchronize_post_init(cpu);
- /* TODO: move to cpu_synchronize_post_init() */
- if (hvf_enabled()) {
- hvf_cpu_synchronize_post_init(cpu);
- }
}
}
diff --git a/include/sysemu/hw_accel.h b/include/sysemu/hw_accel.h
index d2ddfb5ad0..550ca273b9 100644
--- a/include/sysemu/hw_accel.h
+++ b/include/sysemu/hw_accel.h
@@ -27,6 +27,9 @@ static inline void cpu_synchronize_state(CPUState *cpu)
if (whpx_enabled()) {
whpx_cpu_synchronize_state(cpu);
}
+ if (hvf_enabled()) {
+ hvf_cpu_synchronize_state(cpu);
+ }
}
static inline void cpu_synchronize_post_reset(CPUState *cpu)
@@ -40,6 +43,9 @@ static inline void cpu_synchronize_post_reset(CPUState *cpu)
if (whpx_enabled()) {
whpx_cpu_synchronize_post_reset(cpu);
}
+ if (hvf_enabled()) {
+ hvf_cpu_synchronize_post_reset(cpu);
+ }
}
static inline void cpu_synchronize_post_init(CPUState *cpu)
@@ -53,6 +59,9 @@ static inline void cpu_synchronize_post_init(CPUState *cpu)
if (whpx_enabled()) {
whpx_cpu_synchronize_post_init(cpu);
}
+ if (hvf_enabled()) {
+ hvf_cpu_synchronize_post_init(cpu);
+ }
}
static inline void cpu_synchronize_pre_loadvm(CPUState *cpu)
--
2.20.1
Patchew URL: https://patchew.org/QEMU/20190326001535.19439-1-skrtbhtngr@gmail.com/
Hi,
This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===
LINK qemu-img
BUILD optionrom/linuxboot_dma.img
In file included from /tmp/qemu-test/src/qom/cpu.c:25:
/tmp/qemu-test/src/include/sysemu/hw_accel.h:30:9: error: implicit declaration of function 'hvf_enabled' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (hvf_enabled()) {
^
/tmp/qemu-test/src/include/sysemu/hw_accel.h:30:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
/tmp/qemu-test/src/include/sysemu/hw_accel.h:31:9: error: implicit declaration of function 'hvf_cpu_synchronize_state' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
hvf_cpu_synchronize_state(cpu);
^
/tmp/qemu-test/src/include/sysemu/hw_accel.h:31:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
/tmp/qemu-test/src/include/sysemu/hw_accel.h:46:9: error: implicit declaration of function 'hvf_enabled' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (hvf_enabled()) {
^
/tmp/qemu-test/src/include/sysemu/hw_accel.h:47:9: error: implicit declaration of function 'hvf_cpu_synchronize_post_reset' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
hvf_cpu_synchronize_post_reset(cpu);
^
/tmp/qemu-test/src/include/sysemu/hw_accel.h:47:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
/tmp/qemu-test/src/include/sysemu/hw_accel.h:62:9: error: implicit declaration of function 'hvf_enabled' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (hvf_enabled()) {
^
/tmp/qemu-test/src/include/sysemu/hw_accel.h:63:9: error: implicit declaration of function 'hvf_cpu_synchronize_post_init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
hvf_cpu_synchronize_post_init(cpu);
^
/tmp/qemu-test/src/include/sysemu/hw_accel.h:63:9: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
10 errors generated.
BUILD optionrom/linuxboot_dma.raw
BUILD optionrom/pvh.img
The full log is available at
http://patchew.org/logs/20190326001535.19439-1-skrtbhtngr@gmail.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Patchew URL: https://patchew.org/QEMU/20190326001535.19439-1-skrtbhtngr@gmail.com/
Hi,
This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.
=== TEST SCRIPT BEGIN ===
#!/bin/bash
time make docker-test-mingw@fedora SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===
LINK qemu-edid.exe
In file included from /tmp/qemu-test/src/qom/cpu.c:25:
/tmp/qemu-test/src/include/sysemu/hw_accel.h: In function 'cpu_synchronize_state':
/tmp/qemu-test/src/include/sysemu/hw_accel.h:30:9: error: implicit declaration of function 'hvf_enabled'; did you mean 'hax_enabled'? [-Werror=implicit-function-declaration]
if (hvf_enabled()) {
^~~~~~~~~~~
hax_enabled
/tmp/qemu-test/src/include/sysemu/hw_accel.h:30:9: error: nested extern declaration of 'hvf_enabled' [-Werror=nested-externs]
/tmp/qemu-test/src/include/sysemu/hw_accel.h:31:9: error: implicit declaration of function 'hvf_cpu_synchronize_state'; did you mean 'kvm_cpu_synchronize_state'? [-Werror=implicit-function-declaration]
hvf_cpu_synchronize_state(cpu);
^~~~~~~~~~~~~~~~~~~~~~~~~
kvm_cpu_synchronize_state
/tmp/qemu-test/src/include/sysemu/hw_accel.h:31:9: error: nested extern declaration of 'hvf_cpu_synchronize_state' [-Werror=nested-externs]
/tmp/qemu-test/src/include/sysemu/hw_accel.h: In function 'cpu_synchronize_post_reset':
/tmp/qemu-test/src/include/sysemu/hw_accel.h:47:9: error: implicit declaration of function 'hvf_cpu_synchronize_post_reset'; did you mean 'kvm_cpu_synchronize_post_reset'? [-Werror=implicit-function-declaration]
hvf_cpu_synchronize_post_reset(cpu);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kvm_cpu_synchronize_post_reset
/tmp/qemu-test/src/include/sysemu/hw_accel.h:47:9: error: nested extern declaration of 'hvf_cpu_synchronize_post_reset' [-Werror=nested-externs]
/tmp/qemu-test/src/include/sysemu/hw_accel.h: In function 'cpu_synchronize_post_init':
/tmp/qemu-test/src/include/sysemu/hw_accel.h:63:9: error: implicit declaration of function 'hvf_cpu_synchronize_post_init'; did you mean 'kvm_cpu_synchronize_post_init'? [-Werror=implicit-function-declaration]
hvf_cpu_synchronize_post_init(cpu);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kvm_cpu_synchronize_post_init
/tmp/qemu-test/src/include/sysemu/hw_accel.h:63:9: error: nested extern declaration of 'hvf_cpu_synchronize_post_init' [-Werror=nested-externs]
cc1: all warnings being treated as errors
make: *** [/tmp/qemu-test/src/rules.mak:69: qom/cpu.o] Error 1
make: *** Waiting for unfinished jobs....
The full log is available at
http://patchew.org/logs/20190326001535.19439-1-skrtbhtngr@gmail.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
© 2016 - 2026 Red Hat, Inc.