All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] virt/acpi: set PSCI flag even when psci_conduit is disabled
@ 2020-07-03  9:43 Heyi Guo
  2020-07-03 10:37 ` Peter Maydell
  2020-07-07 10:14 ` Andrew Jones
  0 siblings, 2 replies; 9+ messages in thread
From: Heyi Guo @ 2020-07-03  9:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, yitian.ly, Michael S. Tsirkin, Shannon Zhao,
	qemu-arm, Heyi Guo, Igor Mammedov

vms->psci_conduit being disabled only means PSCI is not implemented by
qemu; it doesn't mean PSCI is not supported on this virtual machine.
Actually vms->psci_conduit is set to disabled when vms->secure and
firmware_loaded are both set, which means we will run ARM trusted
firmware, which will definitely provide PSCI.

The issue can be reproduced when running qemu in TCG mode with secure
enabled, while using ARM trusted firmware + qemu virt UEFI as firmware
binaries, and we can see secondary cores will not be waken up.

Signed-off-by: Heyi Guo <guoheyi@linux.alibaba.com>

---
Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org
---
 hw/arm/virt-acpi-build.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 1384a2c..7622b97 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -728,13 +728,16 @@ static void build_fadt_rev5(GArray *table_data, BIOSLinker *linker,
     };
 
     switch (vms->psci_conduit) {
-    case QEMU_PSCI_CONDUIT_DISABLED:
-        fadt.arm_boot_arch = 0;
-        break;
     case QEMU_PSCI_CONDUIT_HVC:
         fadt.arm_boot_arch = ACPI_FADT_ARM_PSCI_COMPLIANT |
                              ACPI_FADT_ARM_PSCI_USE_HVC;
         break;
+    /*
+     * QEMU_PSCI_CONDUIT_DISABLED only means PSCI is not implemented by qemu,
+     * but typically it will still be provided by secure firmware, and it should
+     * use SMC as PSCI conduit.
+     */
+    case QEMU_PSCI_CONDUIT_DISABLED:
     case QEMU_PSCI_CONDUIT_SMC:
         fadt.arm_boot_arch = ACPI_FADT_ARM_PSCI_COMPLIANT;
         break;
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-07-07 10:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-03  9:43 [RFC] virt/acpi: set PSCI flag even when psci_conduit is disabled Heyi Guo
2020-07-03 10:37 ` Peter Maydell
2020-07-03 14:36   ` Heyi Guo
2020-07-03 14:41     ` Peter Maydell
2020-07-07 10:04       ` Andrew Jones
2020-07-07 10:15         ` Peter Maydell
2020-07-07 10:28           ` Andrew Jones
2020-07-04 18:43   ` Michael S. Tsirkin
2020-07-07 10:14 ` Andrew Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.