qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 02/18] hw/cpu/cpus: introduce _cpus_ device


From: Damien Hedde
Subject: Re: [RFC PATCH 02/18] hw/cpu/cpus: introduce _cpus_ device
Date: Tue, 19 Apr 2022 11:11:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0



On 4/16/22 19:52, Philippe Mathieu-Daudé wrote:
On 30/3/22 14:56, Damien Hedde wrote:
This object will be a _cpu-cluster_ generalization and
is meant to allow create cpus of the same type.

The main goal is that this object, on contrary to _cpu-cluster-_,
can be used to dynamically create cpus: it does not rely on
external code to populate the object with cpus.

Allowing the user to create a cpu cluster and each _cpu_
separately would be hard because of the following reasons:
+ cpu reset need to be handled
+ instantiation and realize of cpu-cluster and the cpus
   are interleaved
+ cpu cluster must contains only identical cpus and it seems
   difficult to check that at runtime.
Therefore we add a new type solving all this constraints.

_cpu-cluster_ will be updated to inherit from this class
in following commits.

Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
---
  include/hw/cpu/cpus.h |  71 +++++++++++++++++++++++
  hw/cpu/cpus.c         | 127 ++++++++++++++++++++++++++++++++++++++++++
  hw/cpu/meson.build    |   2 +-
  3 files changed, 199 insertions(+), 1 deletion(-)
  create mode 100644 include/hw/cpu/cpus.h
  create mode 100644 hw/cpu/cpus.c

diff --git a/include/hw/cpu/cpus.h b/include/hw/cpu/cpus.h
new file mode 100644
index 0000000000..c65f568ef8
--- /dev/null
+++ b/include/hw/cpu/cpus.h
@@ -0,0 +1,71 @@
+/*
+ * QEMU CPUs type
+ *
+ * Copyright (c) 2022 GreenSocs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef HW_CPU_CPUS_H
+#define HW_CPU_CPUS_H
+
+#include "qemu/typedefs.h"
+#include "hw/qdev-core.h"
+#include "qom/object.h"
+
+/*
+ * This object represent several CPUs which are all identical.

Typo "represents".

+ *
+ * If CPUs are not identical (for example, Cortex-A53 and Cortex-A57 CPUs in an + * Arm big.LITTLE system) they should be in different groups. If the CPUs do + * not have the same view of memory (for example the main CPU and a management
+ * controller processor) they should be in different groups.

This description calls for a clearer CpusGroupState name instead
of CpusState (which confuses me with CPUState). Alternatively
CpusArrayState.

Your are right, I'll add the "group" suffix.

Thanks,
Damien



reply via email to

[Prev in Thread] Current Thread [Next in Thread]