On 5 May 2014 17:00, Rob Herring <[email protected]> wrote: > From: Rob Herring <[email protected]> > > Now that we have PSCI emulation, enable it for the virt platform. > This simplifies the virt machine a bit now that PSCI and SMP no longer > need to be KVM only features. > > Signed-off-by: Rob Herring <[email protected]> > --- > > Note: This will need to be rebased as comments on KVM PSCI 0.2 support > are addressed. This patch effectively includes my comments. > > hw/arm/virt.c | 42 ++++++++++++++++++------------------------ > 1 file changed, 18 insertions(+), 24 deletions(-) > > diff --git a/hw/arm/virt.c b/hw/arm/virt.c > index 9f28c12..d8ab88d 100644 > --- a/hw/arm/virt.c > +++ b/hw/arm/virt.c > @@ -181,21 +181,22 @@ static void create_fdt(VirtBoardInfo *vbi) > "clk24mhz"); > qemu_fdt_setprop_cell(fdt, "/apb-pclk", "phandle", vbi->clock_phandle); > > - /* No PSCI for TCG yet */ > - if (kvm_enabled()) { > - qemu_fdt_add_subnode(fdt, "/psci"); > - if (kvm_check_extension(kvm_state, KVM_CAP_ARM_PSCI_0_2)) { > - qemu_fdt_setprop_string(fdt, "/psci", "compatible", > "arm,psci-0.2"); > - } else { > - qemu_fdt_setprop_string(fdt, "/psci", "compatible", "arm,psci"); > - qemu_fdt_setprop_cell(fdt, "/psci", "cpu_suspend", > - PSCI_FN_CPU_SUSPEND); > - qemu_fdt_setprop_cell(fdt, "/psci", "cpu_off", PSCI_FN_CPU_OFF); > - qemu_fdt_setprop_cell(fdt, "/psci", "cpu_on", PSCI_FN_CPU_ON); > - qemu_fdt_setprop_cell(fdt, "/psci", "migrate", PSCI_FN_MIGRATE); > - } > - qemu_fdt_setprop_string(fdt, "/psci", "method", "hvc"); > + qemu_fdt_add_subnode(fdt, "/psci"); > + qemu_fdt_setprop_string(fdt, "/psci", "method", "hvc"); > + if (kvm_enabled() && !kvm_check_extension(kvm_state, > KVM_CAP_ARM_PSCI_0_2)) { > + qemu_fdt_setprop_string(fdt, "/psci", "compatible", "arm,psci"); > + } else { > + const char compat[] = "arm,psci-0.2\0arm,psci"; > + qemu_fdt_setprop(fdt, "/psci", "compatible", compat, sizeof(compat)); > }
My suggestion to Pranav was that we abstract away the "which PSCI version?" decision into a field in ARMCPU, in which case we can just have TCG always set it to 0.2. So some of this logic will get a little simpler on rebase. thanks -- PMM
