xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Brijesh Singh <brijeshkumar.singh@amd.com>
To: xen-devel@lists.xen.org
Cc: stefano.stabellini@citrix.com, ian.campbell@citrix.com,
	suravee.suthikulpanit@amd.com,
	Brijesh Singh <brijeshkumar.singh@amd.com>
Subject: [PATCH v3] xen/arm: psci: use SMC64 function ID when available on ARM64
Date: Mon, 5 Oct 2015 11:38:39 -0500	[thread overview]
Message-ID: <1444063119-16623-1-git-send-email-brijeshkumar.singh@amd.com> (raw)

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.

Signed-off-by: Brijesh Singh <brijeshkumar.singh@amd.com>
---
 xen/arch/arm/psci.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
index 7ad6a43..172c6e7 100644
--- a/xen/arch/arm/psci.c
+++ b/xen/arch/arm/psci.c
@@ -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");
 
-- 
1.9.1

             reply	other threads:[~2015-10-05 16:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-05 16:38 Brijesh Singh [this message]
2015-10-05 17:09 ` [PATCH v3] xen/arm: psci: use SMC64 function ID when available on ARM64 Julien Grall
2015-10-06 13:42   ` Ian Campbell
2015-10-07 11:51     ` Ian Campbell

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=1444063119-16623-1-git-send-email-brijeshkumar.singh@amd.com \
    --to=brijeshkumar.singh@amd.com \
    --cc=ian.campbell@citrix.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=xen-devel@lists.xen.org \
    /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).