[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 20/20] target/mips/cpu: Display warning when CPU is used witho
|
From: |
Philippe Mathieu-Daudé |
|
Subject: |
[PATCH v2 20/20] target/mips/cpu: Display warning when CPU is used without input clock |
|
Date: |
Sat, 10 Oct 2020 19:26:17 +0200 |
All our QOM users provides an input clock. In order to avoid
avoid future machines added without clock, display a warning.
User-mode emulation use the CP0 timer with the RDHWR instruction
(see commit cdfcad788394) so keep using the fixed 200 MHz clock
without diplaying any warning. Only display it in system-mode
emulation.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/mips/cpu.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/target/mips/cpu.c b/target/mips/cpu.c
index 3deb0245e7c..0c801a3a075 100644
--- a/target/mips/cpu.c
+++ b/target/mips/cpu.c
@@ -19,12 +19,14 @@
*/
#include "qemu/osdep.h"
+#include "qemu/cutils.h"
#include "qapi/error.h"
#include "cpu.h"
#include "internal.h"
#include "kvm_mips.h"
#include "qemu/module.h"
#include "sysemu/kvm.h"
+#include "sysemu/qtest.h"
#include "exec/exec-all.h"
#include "hw/qdev-properties.h"
#include "hw/qdev-clock.h"
@@ -157,6 +159,12 @@ static void mips_cpu_realizefn(DeviceState *dev, Error
**errp)
Error *local_err = NULL;
if (!clock_get(cpu->clock)) {
+#ifndef CONFIG_USER_ONLY
+ g_autofree char *cpu_freq_str = freq_to_str(CPU_FREQ_HZ_DEFAULT);
+
+ warn_report("CPU input clock is not connected to any output clock, "
+ "using default frequency of %s.", cpu_freq_str);
+#endif
/* Initialize the frequency in case the clock remains unconnected. */
clock_set_hz(cpu->clock, CPU_FREQ_HZ_DEFAULT);
}
--
2.26.2
- [PATCH v2 09/20] target/mips/cpu: Calculate the CP0 timer period using the CPU frequency, (continued)
- [PATCH v2 09/20] target/mips/cpu: Calculate the CP0 timer period using the CPU frequency, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v2 11/20] target/mips/cpu: Allow the CPU to use dynamic frequencies, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v2 10/20] target/mips/cpu: Make cp0_count_rate a property, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v2 14/20] hw/mips/mipssim: Correct CPU frequency, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v2 13/20] hw/mips/fuloong2e: Set CPU frequency to 533 MHz, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v2 12/20] hw/mips/r4k: Explicit CPU frequency is 200 MHz, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v2 18/20] hw/mips/malta: Set CPU frequency to 320 MHz, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v2 17/20] hw/mips/boston: Set CPU frequency to 1 GHz, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v2 15/20] hw/mips/jazz: Correct CPU frequencies, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v2 20/20] target/mips/cpu: Display warning when CPU is used without input clock,
Philippe Mathieu-Daudé <=
- [PATCH v2 16/20] hw/mips/cps: Expose input clock and connect it to CPU cores, Philippe Mathieu-Daudé, 2020/10/10
- [PATCH v2 19/20] hw/mips/cps: Do not allow use without input clock, Philippe Mathieu-Daudé, 2020/10/10