diff options
| author | Richard Henderson <richard.henderson@linaro.org> | 2025-08-27 15:34:35 +1000 |
|---|---|---|
| committer | Richard Henderson <richard.henderson@linaro.org> | 2025-08-30 06:59:26 +1000 |
| commit | fd5c5032df6bea4bbf56752d8885c8a9770c4959 (patch) | |
| tree | 8a11a3ad74aeb95c320c8d1a85800c2ed59945a2 /hw/core/cpu-common.c | |
| parent | f3d9393791e6c02bae99f920d350e65cd299fed1 (diff) | |
| download | focaccia-qemu-fd5c5032df6bea4bbf56752d8885c8a9770c4959.tar.gz focaccia-qemu-fd5c5032df6bea4bbf56752d8885c8a9770c4959.zip | |
hw/core: Use qemu_log_trylock/unlock in cpu_common_reset_exit
Ensure that the "CPU Reset" message won't be separated from the cpu_dump_state output. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'hw/core/cpu-common.c')
| -rw-r--r-- | hw/core/cpu-common.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 26321be785..259cf2a3c3 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -135,10 +135,15 @@ static void cpu_common_reset_hold(Object *obj, ResetType type) static void cpu_common_reset_exit(Object *obj, ResetType type) { if (qemu_loglevel_mask(CPU_LOG_RESET)) { - CPUState *cpu = CPU(obj); + FILE *f = qemu_log_trylock(); - qemu_log("CPU Reset (CPU %d)\n", cpu->cpu_index); - log_cpu_state(cpu, cpu->cc->reset_dump_flags); + if (f) { + CPUState *cpu = CPU(obj); + + fprintf(f, "CPU Reset (CPU %d)\n", cpu->cpu_index); + cpu_dump_state(cpu, f, cpu->cc->reset_dump_flags); + qemu_log_unlock(f); + } } } |