qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC PATCH V5 8/8] hw/arm/virt: Use PSCI v0.2 compatible wh


From: Pranavkumar Sawargaonkar
Subject: [Qemu-devel] [RFC PATCH V5 8/8] hw/arm/virt: Use PSCI v0.2 compatible when kernel supports it
Date: Mon, 12 May 2014 18:07:26 +0530

If we have in-kernel emulation of PSCI v0.2 for KVM ARM/ARM64 then
we enable PSCI v0.2 for each VCPU at the time of VCPU init hence we
need to provide PSCI v0.2 compatible string via generated DTB.

This patch updates generated DTB to have PSCI v0.2 compatible string
when we have in-kernel emulation PSCI v0.2 for KVM ARM/ARM64.

Signed-off-by: Pranavkumar Sawargaonkar <address@hidden>
Signed-off-by: Anup Patel <address@hidden>
---
 hw/arm/virt.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index ea4f02d..64ee630 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -183,7 +183,13 @@ static void create_fdt(VirtBoardInfo *vbi)
     /* No PSCI for TCG yet */
     if (kvm_enabled()) {
         qemu_fdt_add_subnode(fdt, "/psci");
-        qemu_fdt_setprop_string(fdt, "/psci", "compatible", "arm,psci");
+        if (kvm_check_extension(kvm_state, QEMU_KVM_CAP_ARM_PSCI_0_2)) {
+            qemu_fdt_setprop(fdt, "/psci", "compatible",
+                             "arm,psci-0.2\0arm,psci",
+                             strlen("arm,psci-0.2") + strlen("arm,psci") + 2);
+        } else {
+            qemu_fdt_setprop_string(fdt, "/psci", "compatible", "arm,psci");
+        }
         qemu_fdt_setprop_string(fdt, "/psci", "method", "hvc");
         qemu_fdt_setprop_cell(fdt, "/psci", "cpu_suspend",
                                   PSCI_FN_CPU_SUSPEND);
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]