Skip to contentSkip to conversation

xen:arm: use SMC64 version function id on ARM64

PATCH Superseded Brijesh Singh 2 participants 2 messages Oct 2, 2015

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen:arm: use SMC64 version function id on ARM64

On AMD Seattle, Xen failed to boot secondary CPU's. This patch fixes it.

As per PSCI spec, If CPU_ON entry_point_address is 64-bit then function id parameter should be set to SMC64 version (0xC4000003).

---
 xen/arch/arm/psci.c | 4 ++++
 1 file changed, 4 insertions(+)
xen/arch/arm/psci.c +4 -0
index 7ad6a43..117c6a9 100644
@@ -116,7 +116,11 @@ int __init psci_init_0_2(void)
         return -EOPNOTSUPP;
     }
 
+#ifdef CONFIG_ARM_64
+    psci_cpu_on_nr = PSCI_0_2_FN64_CPU_ON;
+#else
     psci_cpu_on_nr = PSCI_0_2_FN_CPU_ON;
+#endif
 
     printk(XENLOG_INFO "Using PSCI-0.2 for SMP bringup\n");
 
Signature · 1 line
1.9.1
#1 lore raw

Hi,

FIY, the xen-arm mailing has been removed a year ago and was only targeting the Xen ARM PV port.

Quoted 3 lines · Brijesh Singh

On AMD Seattle, Xen failed to boot secondary CPU's. This patch fixes it.

As per PSCI spec, If CPU_ON entry_point_address is 64-bit then function id parameter should be set to SMC64 version (0xC4000003).

The line in the commit message should never go above 72 characters. Please split it.

Quoted 11 lines
---
  xen/arch/arm/psci.c | 4 ++++
  1 file changed, 4 insertions(+)
xen/arch/arm/psci.c +0 -0
index 7ad6a43..117c6a9 100644

xen/arch/arm/psci.c int __init psci_init_0_2(void) · line 123

Quoted 8 lines
xen/arch/arm/psci.c +4 -0
@@ -116,7 +116,11 @@ int __init psci_init_0_2(void)
          return -EOPNOTSUPP;
      }
 
+#ifdef CONFIG_ARM_64
+    psci_cpu_on_nr = PSCI_0_2_FN64_CPU_ON;
+#else
      psci_cpu_on_nr = PSCI_0_2_FN_CPU_ON;
+#endif

Rather than open coding the function ID in the code, I would prefer to introduce a define/macro similar to the Linux one (see drivers/firmware/psci.c) which will return the 64-bit function ID for ARM64 and 32-bit one for ARM32:

#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

And then:

psci_cpu_on_nr = PSCI_0_2_FN_NATIVE(CPU_ON);

A comment on top for the macro would also be welcome for future reference explaining why.

Regards,

Signature · 1 line
Julien Grall