qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH 6/7] hw/arm/virt: Use PSCI v0.2 function IDs


From: Pranavkumar Sawargaonkar
Subject: Re: [Qemu-devel] [RFC PATCH 6/7] hw/arm/virt: Use PSCI v0.2 function IDs when kernel supports its
Date: Thu, 27 Feb 2014 12:46:46 +0530

On 27 February 2014 12:21, Pranavkumar Sawargaonkar
<address@hidden> wrote:
> 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 function IDs via generated DTB.
>
> This patch updates generated DTB to have PSCI v0.2 function IDs 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 |   25 ++++++++++++++++++++-----
>  1 file changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 517f2fe..a818a80 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -187,11 +187,26 @@ static void create_fdt(VirtBoardInfo *vbi)
>          qemu_fdt_add_subnode(fdt, "/psci");
>          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);
> -        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);
> +        if (kvm_check_extension(kvm_state, KVM_CAP_ARM_PSCI_0_2)) {
> +            qemu_fdt_setprop_cell(fdt, "/psci", "cpu_suspend",
> +                                      PSCI_0_2_FN_CPU_SUSPEND);
> +            qemu_fdt_setprop_cell(fdt, "/psci", "cpu_off",
> +                                      PSCI_0_2_FN_CPU_OFF);
> +            qemu_fdt_setprop_cell(fdt, "/psci", "cpu_on",
> +                                      PSCI_0_2_FN_CPU_ON);
> +            qemu_fdt_setprop_cell(fdt, "/psci", "migrate",
> +                                      PSCI_0_2_FN_MIGRATE);
> +            qemu_fdt_setprop_cell(fdt, "/psci", "system_off",
> +                                      PSCI_0_2_FN_SYSTEM_OFF);
> +            qemu_fdt_setprop_cell(fdt, "/psci", "system_reset",
> +                                      PSCI_0_2_FN_SYSTEM_RESET);
> +        } else {
> +            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);
> +        }
>      }
>  }
>
> --
> 1.7.9.5
>

Sorry for mentioning wrong qemu devel mail id in my previous mail.
Correcting correct qemu-devel  id.

Thanks,
Pranav



reply via email to

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