Skip to contentSkip to conversation

xen/arm: psci: use SMC64 function ID when available on ARM64

PATCH In review Brijesh Singh 3 participants 4 messages Oct 5, 2015 – Oct 7, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 xen/arm: psci: use SMC64 function ID when available on ARM64

As per PSCI 0.2 spec, if CPU_ON entry_point_address is 64-bit then SMC call function ID parameter should be set to SMC64 version.

---
 xen/arch/arm/psci.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
xen/arch/arm/psci.c +13 -1
index 7ad6a43..172c6e7 100644
@@ -23,6 +23,18 @@
 #include <xen/smp.h>
 #include <asm/psci.h>
 
+/*
+ * While a 64-bit OS can make calls with SMC32 calling conventions, for
+ * some calls it is necessary to use SMC64 to pass or return 64-bit values.
+ * For such calls PSCI_0_2_FN_NATIVE(x) will choose the appropriate
+ * (native-width) function ID.
+ */
+#ifdef CONFIG_ARM_64
+#define PSCI_0_2_FN_NATIVE(name)	PSCI_0_2_FN64_##name
+#else
+#define PSCI_0_2_FN_NATIVE(name)	PSCI_0_2_FN_##name
+#endif
+
 uint32_t psci_ver;
 
 static uint32_t psci_cpu_on_nr;
@@ -116,7 +128,7 @@ int __init psci_init_0_2(void)
         return -EOPNOTSUPP;
     }
 
-    psci_cpu_on_nr = PSCI_0_2_FN_CPU_ON;
+    psci_cpu_on_nr = PSCI_0_2_FN_NATIVE(CPU_ON);
 
     printk(XENLOG_INFO "Using PSCI-0.2 for SMP bringup\n");
 
Signature · 1 line
1.9.1
#3 lore raw
Quoted 10 lines · Ian Campbell
Quoted 9 lines · Julien Grall

Hi,

Quoted 5 lines · Brijesh Singh

As per PSCI 0.2 spec, if CPU_ON entry_point_address is 64-bit then SMC
call function ID parameter should be set to SMC64 version.

Quoted 7 lines
Quoted 1 line

One of the machines I use for my pre-push build tests is offline today, so
I'll push later.

Done.