qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Rob Herring <robherring2@gmail.com>
Cc: Rob Herring <rob.herring@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Christoffer Dall <christoffer.dall@linaro.org>
Subject: Re: [Qemu-devel] [PATCH 6/7] arm/virt: enable PSCI emulation support for system emulation
Date: Wed, 14 May 2014 18:51:14 +0100	[thread overview]
Message-ID: <CAFEAcA-WZTX10gepobRN6tzii8_1YK0UzD+CUyUPLTDFrJkGpQ@mail.gmail.com> (raw)
In-Reply-To: <1399305623-22016-7-git-send-email-robherring2@gmail.com>

On 5 May 2014 17:00, Rob Herring <robherring2@gmail.com> wrote:
> From: Rob Herring <rob.herring@linaro.org>
>
> 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 <rob.herring@linaro.org>
> ---
>
> 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

  reply	other threads:[~2014-05-14 17:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-05 16:00 [Qemu-devel] [PATCH 0/7] ARM: add PSCI enulation support Rob Herring
2014-05-05 16:00 ` [Qemu-devel] [PATCH 1/7] target-arm: use correct do_interrupt handler for AArch64 user mode Rob Herring
2014-05-05 16:15   ` Peter Maydell
2014-05-05 16:00 ` [Qemu-devel] [PATCH 2/7] target-arm: add powered off cpu state Rob Herring
2014-05-05 16:27   ` Peter Maydell
2014-05-15 13:12   ` Peter Crosthwaite
2014-05-05 16:00 ` [Qemu-devel] [PATCH 3/7] target-arm: add hvc and smc exception emulation handling infrastructure Rob Herring
2014-05-14 17:44   ` Peter Maydell
2014-05-14 20:55     ` Rob Herring
2014-05-15 13:06       ` Peter Maydell
2014-05-05 16:00 ` [Qemu-devel] [PATCH 4/7] target-arm: support AArch64 for arm_cpu_set_pc Rob Herring
2014-05-05 16:22   ` Peter Maydell
2014-05-05 16:00 ` [Qemu-devel] [PATCH 5/7] target-arm: add emulation of PSCI calls for system emulation Rob Herring
2014-05-14 18:12   ` Peter Maydell
2014-05-15  0:08     ` Rob Herring
2014-05-05 16:00 ` [Qemu-devel] [PATCH 6/7] arm/virt: enable PSCI emulation support " Rob Herring
2014-05-14 17:51   ` Peter Maydell [this message]
2014-05-14 19:15     ` Rob Herring
2014-05-14 21:25       ` Peter Maydell
2014-05-14 22:58         ` Rob Herring
2014-05-15  8:18           ` Peter Maydell
2014-05-05 16:00 ` [Qemu-devel] [PATCH 7/7] arm/highbank: enable PSCI emulation support Rob Herring
2014-05-15 13:07   ` Peter Crosthwaite

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFEAcA-WZTX10gepobRN6tzii8_1YK0UzD+CUyUPLTDFrJkGpQ@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=christoffer.dall@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rob.herring@linaro.org \
    --cc=robherring2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).