Skip to contentSkip to conversation

hw/arm/sbsa-ref.c: Start APs powered off

PATCH In review Rebecca Cran 3 participants 3 messages Jan 2, 2023 – Jan 10, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/arm/sbsa-ref.c: Start APs powered off

For the SBSA-REF machine start all APs in the powered-off state. This reduces host CPU usage until PSCI_CPU_ON is called when the APs are needed.

---
 hw/arm/sbsa-ref.c | 6 ++++++
 1 file changed, 6 insertions(+)
hw/arm/sbsa-ref.c +6 -0
index 4bb444684f40..cf0af35c7807 100644
@@ -753,6 +753,12 @@ static void sbsa_ref_init(MachineState *machine)
                                     &error_abort);
         }
 
+        /* Configure all APs to be powered off at start */
+        if (n != 0 && object_property_find(cpuobj, "start-powered-off")) {
+            object_property_set_bool(cpuobj, "start-powered-off",
+                                     true, &error_abort);
+        }
+
         object_property_set_link(cpuobj, "memory", OBJECT(sysmem),
                                  &error_abort);
 
Signature · 1 line
2.30.2
#1 lore raw
Quoted 16 lines · Rebecca Cran

For the SBSA-REF machine start all APs in the powered-off state. This reduces host CPU usage until PSCI_CPU_ON is called when the APs are needed.

---
 hw/arm/sbsa-ref.c | 6 ++++++
 1 file changed, 6 insertions(+)
hw/arm/sbsa-ref.c +0 -0
index 4bb444684f40..cf0af35c7807 100644
@@ -753,6 +753,12 @@ static void sbsa_ref_init(MachineState *machine)
                                     &error_abort);

hw/arm/sbsa-ref.c static void sbsa_ref_init(MachineState *machine) · line 763

Quoted 10 lines
hw/arm/sbsa-ref.c +6 -0
         }
 
+        /* Configure all APs to be powered off at start */
+        if (n != 0 && object_property_find(cpuobj, "start-powered-off")) {
+            object_property_set_bool(cpuobj, "start-powered-off",
+                                     true, &error_abort);
+        }
+
         object_property_set_link(cpuobj, "memory", OBJECT(sysmem),
                                  &error_abort);

This board disables QEMU's own PSCI implementation and relies on a guest EL3 firmware to provide PSCI. So how will that EL3 firmware implement the "power on" to bring up the secondaries? QEMU has the APIs to allow implementation of a model of a hardware power controller (target/arm/arm-powerctl.h) but as far as I can see the sbsa-ref board doesn't yet implement one, so if you start the CPUs in the powered-off state there's no way for them ever to be powered on.

thanks
-- PMM

#2 lore raw
Quoted 8 lines · Peter Maydell

This board disables QEMU's own PSCI implementation and relies on a guest EL3 firmware to provide PSCI. So how will that EL3 firmware implement the "power on" to bring up the secondaries? QEMU has the APIs to allow implementation of a model of a hardware power controller (target/arm/arm-powerctl.h) but as far as I can see the sbsa-ref board doesn't yet implement one, so if you start the CPUs in the powered-off state there's no way for them ever to be powered on.

Sorry, I've been working on a machine where the power controller _was_ implemented so I missed that that's not present in sbsa-ref.

Signature · 1 line
Rebecca Cran