From: Jan Kiszka <[email protected]>

U-Boot returns PSCI_NOT_SUPPORTED, rather than the implemented 0.2.
Filter out all negative return codes.

Fixes: ea924a3fec98 ("arm64: Initialise SMCCC backend")
Signed-off-by: Jan Kiszka <[email protected]>
---
 hypervisor/arch/arm-common/smccc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hypervisor/arch/arm-common/smccc.c 
b/hypervisor/arch/arm-common/smccc.c
index 5affa965..7734b999 100644
--- a/hypervisor/arch/arm-common/smccc.c
+++ b/hypervisor/arch/arm-common/smccc.c
@@ -23,8 +23,9 @@ void smccc_discover(void)

        ret = smc(PSCI_0_2_FN_VERSION);

-       /* We need >=PSCIv1.0 for SMCCC */
-       if (PSCI_VERSION_MAJOR(ret) < 1)
+       /* We need >=PSCIv1.0 for SMCCC. Against the spec, U-Boot may also
+        * return a negative error code. */
+       if (ret < 0 || PSCI_VERSION_MAJOR(ret) < 1)
                return;

        /* Check if PSCI supports SMCCC version call */
--
2.16.4

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/a9ac4f9f-8c5c-6133-b9df-77cf2a8ccc31%40web.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to