qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/arm: Allow manually specified /psci node
@ 2018-04-02 20:56 Andrey Smirnov
  2018-04-03  8:23 ` Marc Zyngier
  2018-04-05 10:36 ` Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Andrey Smirnov @ 2018-04-02 20:56 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Andrey Smirnov, Peter Maydell, qemu-devel, qemu-arm

Change the code to avoid exiting QEMU if user provided DTB contains
manually specified /psci node and skip any /psci related fixups
instead.

Fixes: 4cbca7d9b4 ("hw/arm: Move virt's PSCI DT fixup code to
arm/boot.c")

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---

Mark:

Sorry about the inconvenience, here's the fix (hopefully) to the
prolem you reported in [1]. Let me know if skipping all PSCI related
DTB fixup if /psic node is present is not the behaviour you had in
mind for your suggested fix.

Thanks,
Andrey Smirnov

[1] http://lists.gnu.org/archive/html/qemu-devel/2018-03/msg06914.html

 hw/arm/boot.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 6d0c92ab88..d9f9375cdb 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -422,6 +422,7 @@ static void fdt_add_psci_node(void *fdt)
     ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(0));
     const char *psci_method;
     int64_t psci_conduit;
+    int rc;
 
     psci_conduit = object_property_get_int(OBJECT(armcpu),
                                            "psci-conduit",
@@ -439,6 +440,15 @@ static void fdt_add_psci_node(void *fdt)
         g_assert_not_reached();
     }
 
+    /*
+     * If /psci node is present in provided DTB, assume that no fixup
+     * is necessary and all PSCI configuration should be taken as-is
+     */
+    rc = fdt_path_offset(fdt, "/psci");
+    if (rc >= 0) {
+        return;
+    }
+
     qemu_fdt_add_subnode(fdt, "/psci");
     if (armcpu->psci_version == 2) {
         const char comp[] = "arm,psci-0.2\0arm,psci";
-- 
2.14.3

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

* Re: [Qemu-devel] [PATCH] hw/arm: Allow manually specified /psci node
  2018-04-02 20:56 [Qemu-devel] [PATCH] hw/arm: Allow manually specified /psci node Andrey Smirnov
@ 2018-04-03  8:23 ` Marc Zyngier
  2018-04-05 10:36 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2018-04-03  8:23 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: Peter Maydell, qemu-devel, qemu-arm

Hi Andrey,

On 02/04/18 21:56, Andrey Smirnov wrote:
> Change the code to avoid exiting QEMU if user provided DTB contains
> manually specified /psci node and skip any /psci related fixups
> instead.
> 
> Fixes: 4cbca7d9b4 ("hw/arm: Move virt's PSCI DT fixup code to
> arm/boot.c")
> 
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: qemu-devel@nongnu.org
> Cc: qemu-arm@nongnu.org
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
> 
> Mark:
> 
> Sorry about the inconvenience, here's the fix (hopefully) to the
> prolem you reported in [1]. Let me know if skipping all PSCI related
> DTB fixup if /psic node is present is not the behaviour you had in
> mind for your suggested fix.

Yes, this looks pretty similar to the hack I implemented locally.

Feel free to add:

Reported-by: Marc Zyngier <marc.zyngier@arm.com>
Tested-by: Marc Zyngier <marc.zyngier@arm.com>

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

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

* Re: [Qemu-devel] [PATCH] hw/arm: Allow manually specified /psci node
  2018-04-02 20:56 [Qemu-devel] [PATCH] hw/arm: Allow manually specified /psci node Andrey Smirnov
  2018-04-03  8:23 ` Marc Zyngier
@ 2018-04-05 10:36 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2018-04-05 10:36 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: Marc Zyngier, QEMU Developers, qemu-arm

On 2 April 2018 at 21:56, Andrey Smirnov <andrew.smirnov@gmail.com> wrote:
> Change the code to avoid exiting QEMU if user provided DTB contains
> manually specified /psci node and skip any /psci related fixups
> instead.
>
> Fixes: 4cbca7d9b4 ("hw/arm: Move virt's PSCI DT fixup code to
> arm/boot.c")
>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: qemu-devel@nongnu.org
> Cc: qemu-arm@nongnu.org
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
>
> Mark:
>
> Sorry about the inconvenience, here's the fix (hopefully) to the
> prolem you reported in [1]. Let me know if skipping all PSCI related
> DTB fixup if /psic node is present is not the behaviour you had in
> mind for your suggested fix.
>
> Thanks,
> Andrey Smirnov
>
> [1] http://lists.gnu.org/archive/html/qemu-devel/2018-03/msg06914.html



Applied to target-arm.next, thanks.

-- PMM

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

end of thread, other threads:[~2018-04-05 10:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-02 20:56 [Qemu-devel] [PATCH] hw/arm: Allow manually specified /psci node Andrey Smirnov
2018-04-03  8:23 ` Marc Zyngier
2018-04-05 10:36 ` Peter Maydell

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).