[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 07/18] hw/cpu/cpus: add a common start-powered-off property
From: |
Damien Hedde |
Subject: |
[RFC PATCH 07/18] hw/cpu/cpus: add a common start-powered-off property |
Date: |
Wed, 30 Mar 2022 14:56:28 +0200 |
Can be used to initialize the same property on all
cpus.
Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
---
include/hw/cpu/cpus.h | 3 +++
hw/cpu/cpus.c | 5 +++++
2 files changed, 8 insertions(+)
diff --git a/include/hw/cpu/cpus.h b/include/hw/cpu/cpus.h
index 295d7537e2..7e89a0d018 100644
--- a/include/hw/cpu/cpus.h
+++ b/include/hw/cpu/cpus.h
@@ -46,6 +46,8 @@ OBJECT_DECLARE_TYPE(CpusState, CpusClass, CPUS)
* written before realize in order to enable/disable clustering.
* @cluster_index: The cluster ID. This value is for internal use only and
* should not be exposed directly to the user or to the guest.
+ * @start_powered_off: Default start power state of all cpus
+ * (can be modified on a per-cpu basis after realize).
*/
struct CpusState {
/*< private >*/
@@ -59,6 +61,7 @@ struct CpusState {
struct {
uint16_t cpus;
} topology;
+ bool start_powered_off;
CPUState **cpus;
};
diff --git a/hw/cpu/cpus.c b/hw/cpu/cpus.c
index ed9402c100..d1fe80f0ab 100644
--- a/hw/cpu/cpus.c
+++ b/hw/cpu/cpus.c
@@ -27,6 +27,7 @@ static Property cpus_properties[] = {
* FIXME: remove this property to keep it internal ?
*/
DEFINE_PROP_INT32("cluster-id", CpusState, cluster_index, -1),
+ DEFINE_PROP_BOOL("start-powered-off", CpusState, start_powered_off, false),
DEFINE_PROP_END_OF_LIST()
};
@@ -71,6 +72,10 @@ static void cpus_create_cpus(CpusState *s, Error **errp)
cpu->cluster_index = s->cluster_index;
}
+ /* set power start state */
+ qdev_prop_set_bit(DEVICE(cpu), "start-powered-off",
+ s->start_powered_off);
+
/* let subclass configure the cpu */
if (cgc->configure_cpu) {
cgc->configure_cpu(s, cpu, i);
--
2.35.1
- [RFC PATCH 00/18] user-creatable cpu clusters, Damien Hedde, 2022/03/30
- [RFC PATCH 01/18] define MAX_CLUSTERS in cpu.h instead of cluster.h, Damien Hedde, 2022/03/30
- [RFC PATCH 03/18] hw/cpu/cpus: prepare to handle cpu clusters, Damien Hedde, 2022/03/30
- [RFC PATCH 02/18] hw/cpu/cpus: introduce _cpus_ device, Damien Hedde, 2022/03/30
- [RFC PATCH 04/18] hw/cpu/cluster: make _cpu-cluster_ a subclass of _cpus_, Damien Hedde, 2022/03/30
- [RFC PATCH 05/18] gdbstub: deal with _cpus_ object instead of _cpu-cluster_, Damien Hedde, 2022/03/30
- [RFC PATCH 06/18] hw/cpu/cluster: remove cluster_id now that gdbstub is updated, Damien Hedde, 2022/03/30
- [RFC PATCH 09/18] hw/arm/xlnx-zynqmp: convert cpu clusters to arm_cpus, Damien Hedde, 2022/03/30
- [RFC PATCH 08/18] hw/arm/arm_cpus: add arm_cpus device, Damien Hedde, 2022/03/30
- [RFC PATCH 07/18] hw/cpu/cpus: add a common start-powered-off property,
Damien Hedde <=
- [RFC PATCH 11/18] hw/riscv: prepare riscv_hart transition to cpus, Damien Hedde, 2022/03/30
- [RFC PATCH 13/18] hw/riscv/spike: prepare riscv_hart transition to cpus, Damien Hedde, 2022/03/30
- [RFC PATCH 10/18] hw/riscv/riscv_hart: prepare transition to cpus, Damien Hedde, 2022/03/30
- [RFC PATCH 15/18] hw/riscv/sifive_uµchip_pfsoc: apply riscv_hart_array update, Damien Hedde, 2022/03/30
- [RFC PATCH 17/18] hw/riscv/riscv_hart: remove temporary features, Damien Hedde, 2022/03/30
- [RFC PATCH 14/18] hw/riscv/riscv_hart: use cpus as base class, Damien Hedde, 2022/03/30
- [RFC PATCH 16/18] hw/riscv: update remaining machines due to riscv_hart_array update, Damien Hedde, 2022/03/30
- [RFC PATCH 18/18] add myself as reviewer of the newly added _cpus_, Damien Hedde, 2022/03/30
- [RFC PATCH 12/18] hw/riscv/virt: prepare riscv_hart transition to cpus, Damien Hedde, 2022/03/30