[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 15/16] target/mips/cpu: Do not allow system-mode use without inpu
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 15/16] target/mips/cpu: Do not allow system-mode use without input clock |
Date: |
Mon, 28 Sep 2020 19:15:38 +0200 |
Now than all QOM users provides the input clock, do not allow
using a CPU core without its input clock connected on system-mode
emulation. For user-mode, keep providing a fixed 200 MHz clock,
as it used by the RDHWR instruction (see commit cdfcad788394).
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
Cc: Igor Mammedov <imammedo@redhat.com>
We need the qtest check for tests/qtest/machine-none-test.c
which instanciate a CPU with the none machine. Igor, is it
better to remove the MIPS targets from the test cpus_map[]?
---
target/mips/cpu.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/target/mips/cpu.c b/target/mips/cpu.c
index 2f75216c324..cc4ee75af30 100644
--- a/target/mips/cpu.c
+++ b/target/mips/cpu.c
@@ -25,6 +25,7 @@
#include "kvm_mips.h"
#include "qemu/module.h"
#include "sysemu/kvm.h"
+#include "sysemu/qtest.h"
#include "exec/exec-all.h"
#include "hw/qdev-clock.h"
#include "hw/qdev-properties.h"
@@ -159,11 +160,18 @@ static void mips_cpu_realizefn(DeviceState *dev, Error
**errp)
Error *local_err = NULL;
if (!clock_get(cs->clock)) {
+#ifdef CONFIG_USER_ONLY
/*
* Initialize the frequency to 200MHz in case
* the clock remains unconnected.
*/
clock_set_hz(cs->clock, 200000000);
+#else
+ if (!qtest_enabled()) {
+ error_setg(errp, "CPU clock must be connected to a clock source");
+ return;
+ }
+#endif
}
mips_cpu_clk_update(cs);
--
2.26.2
- [PATCH 02/16] target/mips: Move cpu_mips_get_random() with CP0 helpers, (continued)
- [PATCH 02/16] target/mips: Move cpu_mips_get_random() with CP0 helpers, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 03/16] target/mips/cp0_timer: Explicit unit in variable name, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 08/16] hw/mips/fuloong2e: Set CPU frequency to 533 MHz, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 06/16] target/mips: Keep CP0 counter in sync with the CPU frequency, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 07/16] hw/mips/r4k: Explicit CPU frequency is 200 MHz, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 12/16] hw/mips/boston: Set CPU frequency to 1 GHz, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 13/16] hw/mips/malta: Set CPU frequency to 320 MHz, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 10/16] hw/mips/jazz: Correct CPU frequencies, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 11/16] hw/mips/cps: Expose input clock and connect it to CPU cores, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 14/16] hw/mips/cps: Do not allow use without input clock, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 15/16] target/mips/cpu: Do not allow system-mode use without input clock,
Philippe Mathieu-Daudé <=
- [PATCH 16/16] tests/acceptance: Test the MIPSsim machine, Philippe Mathieu-Daudé, 2020/09/28
- Re: [PATCH 16/16] tests/acceptance: Test the MIPSsim machine, Willian Rampazzo, 2020/09/28
- Re: [PATCH 16/16] tests/acceptance: Test the MIPSsim machine, Philippe Mathieu-Daudé, 2020/09/29
- Re: [PATCH 16/16] tests/acceptance: Test the MIPSsim machine, Alex Bennée, 2020/09/29
- Re: [PATCH 16/16] tests/acceptance: Test the MIPSsim machine, Philippe Mathieu-Daudé, 2020/09/29
- Re: [PATCH 16/16] tests/acceptance: Test the MIPSsim machine, Daniel P . Berrangé, 2020/09/30
- Re: [PATCH 16/16] tests/acceptance: Test the MIPSsim machine, Alex Bennée, 2020/09/30
- Re: [PATCH 16/16] tests/acceptance: Test the MIPSsim machine, Philippe Mathieu-Daudé, 2020/09/30