diff mbox series

[09/16] hw/arm: highbank: For EL3 guests, don't enable PSCI, start all cores

Message ID 20220127154639.2090164-10-peter.maydell@linaro.org (mailing list archive)
State New, archived
Headers show
Series arm: Fix handling of unrecognized functions in PSCI emulation | expand

Commit Message

Peter Maydell Jan. 27, 2022, 3:46 p.m. UTC
Change the highbank/midway boards to use the new boot.c functionality
to allow us to enable psci-conduit only if the guest is being booted
in EL1 or EL2, so that if the user runs guest EL3 firmware code our
PSCI emulation doesn't get in its way.

To do this we stop setting the psci-conduit and start-powered-off
properties on the CPU objects in the board code, and instead set the
psci_conduit field in the arm_boot_info struct to tell the common
boot loader code that we'd like PSCI if the guest is starting at an
EL that it makes sense with (in which case it will set these
properties).

This means that when running guest code at EL3, all the cores
will start execution at once on poweron. This matches the
real hardware behaviour. (A brief description of the hardware
boot process is in the u-boot documentation for these boards:
https://u-boot.readthedocs.io/en/latest/board/highbank/highbank.html#boot-process
 -- in theory one might run the 'a9boot'/'a15boot' secure monitor
code in QEMU, though we probably don't emulate enough for that.)

This affects the highbank and midway boards.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/highbank.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Richard Henderson Jan. 31, 2022, 6:55 a.m. UTC | #1
On 1/28/22 02:46, Peter Maydell wrote:
> Change the highbank/midway boards to use the new boot.c functionality
> to allow us to enable psci-conduit only if the guest is being booted
> in EL1 or EL2, so that if the user runs guest EL3 firmware code our
> PSCI emulation doesn't get in its way.
> 
> To do this we stop setting the psci-conduit and start-powered-off
> properties on the CPU objects in the board code, and instead set the
> psci_conduit field in the arm_boot_info struct to tell the common
> boot loader code that we'd like PSCI if the guest is starting at an
> EL that it makes sense with (in which case it will set these
> properties).
> 
> This means that when running guest code at EL3, all the cores
> will start execution at once on poweron. This matches the
> real hardware behaviour. (A brief description of the hardware
> boot process is in the u-boot documentation for these boards:
> https://u-boot.readthedocs.io/en/latest/board/highbank/highbank.html#boot-process
>   -- in theory one might run the 'a9boot'/'a15boot' secure monitor
> code in QEMU, though we probably don't emulate enough for that.)
> 
> This affects the highbank and midway boards.
> 
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
> ---
>   hw/arm/highbank.c | 7 +------
>   1 file changed, 1 insertion(+), 6 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index 4210894d814..048f8550cb9 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -271,12 +271,6 @@  static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
         object_property_set_int(cpuobj, "psci-conduit", QEMU_PSCI_CONDUIT_SMC,
                                 &error_abort);
 
-        if (n) {
-            /* Secondary CPUs start in PSCI powered-down state */
-            object_property_set_bool(cpuobj, "start-powered-off", true,
-                                     &error_abort);
-        }
-
         if (object_property_find(cpuobj, "reset-cbar")) {
             object_property_set_int(cpuobj, "reset-cbar", MPCORE_PERIPHBASE,
                                     &error_abort);
@@ -397,6 +391,7 @@  static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
     highbank_binfo.board_setup_addr = BOARD_SETUP_ADDR;
     highbank_binfo.write_board_setup = hb_write_board_setup;
     highbank_binfo.secure_board_setup = true;
+    highbank_binfo.psci_conduit = QEMU_PSCI_CONDUIT_SMC;
 
     arm_load_kernel(ARM_CPU(first_cpu), machine, &highbank_binfo);
 }