[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 12/16] hw/arm/boot: Prevent setting both psci_conduit and secure_
From: |
Peter Maydell |
Subject: |
[PATCH 12/16] hw/arm/boot: Prevent setting both psci_conduit and secure_board_setup |
Date: |
Thu, 27 Jan 2022 15:46:35 +0000 |
Now that we have dealt with the one special case (highbank) that needed
to set both psci_conduit and secure_board_setup, we don't need to
allow that combination any more. It doesn't make sense in general,
so use an assertion to ensure we don't add new boards that do it
by accident without thinking through the consequences.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/boot.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 327e449f831..0424c178305 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -1339,6 +1339,16 @@ void arm_load_kernel(ARMCPU *cpu, MachineState *ms,
struct arm_boot_info *info)
* supported exception level or in a lower one.
*/
+ /*
+ * If PSCI is enabled, then SMC calls all go to the PSCI handler and
+ * are never emulated to trap into guest code. It therefore does not
+ * make sense for the board to have a setup code fragment that runs
+ * in Secure, because this will probably need to itself issue an SMC of
some
+ * kind as part of its operation.
+ */
+ assert(info->psci_conduit == QEMU_PSCI_CONDUIT_DISABLED ||
+ !info->secure_board_setup);
+
/* Boot into highest supported EL ... */
if (arm_feature(env, ARM_FEATURE_EL3)) {
boot_el = 3;
--
2.25.1
- [PATCH 14/16] hw/arm/highbank: Drop unused secondary boot stub code, (continued)
- [PATCH 14/16] hw/arm/highbank: Drop unused secondary boot stub code, Peter Maydell, 2022/01/27
- [PATCH 10/16] Revert "Revert "arm: tcg: Adhere to SMCCC 1.3 section 5.2"", Peter Maydell, 2022/01/27
- [PATCH 13/16] hw/arm/boot: Don't write secondary boot stub if using PSCI, Peter Maydell, 2022/01/27
- [PATCH 11/16] hw/arm/highbank: Drop use of secure_board_setup, Peter Maydell, 2022/01/27
- [PATCH 15/16] hw/arm/boot: Drop nb_cpus field from arm_boot_info, Peter Maydell, 2022/01/27
- [PATCH 12/16] hw/arm/boot: Prevent setting both psci_conduit and secure_board_setup,
Peter Maydell <=
- [PATCH 16/16] hw/arm/boot: Drop existing dtb /psci node rather than retaining it, Peter Maydell, 2022/01/27
- Re: [PATCH 00/16] arm: Fix handling of unrecognized functions in PSCI emulation, Edgar E. Iglesias, 2022/01/30