summary refs log tree commit diff stats
path: root/target/openrisc/cpu.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-01-15 00:07:23 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-03-06 15:46:18 +0100
commitbefd818b58c8522f573b8831df820f121bfe642a (patch)
treea89928f22a3082780da2517501f0d97ee274aad0 /target/openrisc/cpu.c
parent40b839cb840ce032c8f048325b486d3284f1b68f (diff)
downloadfocaccia-qemu-befd818b58c8522f573b8831df820f121bfe642a.tar.gz
focaccia-qemu-befd818b58c8522f573b8831df820f121bfe642a.zip
target/openrisc: Call cpu_openrisc_clock_init() in cpu_realize()
OpenRISC timer is architecturally tied to the CPU.

It doesn't belong to the machine init() code to
instanciate it: move its creation when a vCPU is
realized (after being created).

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250114231304.77150-1-philmd@linaro.org>
Diffstat (limited to 'target/openrisc/cpu.c')
-rw-r--r--target/openrisc/cpu.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c
index 0669ba2fd1..785b065b51 100644
--- a/target/openrisc/cpu.c
+++ b/target/openrisc/cpu.c
@@ -165,6 +165,10 @@ static void openrisc_cpu_realizefn(DeviceState *dev, Error **errp)
     qemu_init_vcpu(cs);
     cpu_reset(cs);
 
+#ifndef CONFIG_USER_ONLY
+    cpu_openrisc_clock_init(OPENRISC_CPU(dev));
+#endif
+
     occ->parent_realize(dev, errp);
 }