From: Denis Obrezkov <denisobrezkov@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: julien.grall@arm.com, tim@xen.org,
Denis Obrezkov <denisobrezkov@gmail.com>
Subject: [Xen-devel] [PATCH] xen/arm: Switch OMAP5 secondary cores into hyp mode
Date: Fri, 21 Jun 2019 22:02:19 +0200 [thread overview]
Message-ID: <ee1f4b9b969e6cf67278905e0405bc4fa5d6080c.1561147189.git.denisobrezkov@gmail.com> (raw)
This function allows xen to bring secondary CPU cores into non-secure
HYP mode. This is done by using a Secure Monitor call.
Signed-off-by: Denis Obrezkov <denisobrezkov@gmail.com>
---
xen/arch/arm/arm32/head.S | 11 ++++++++++-
xen/arch/arm/platforms/omap5.c | 5 +++--
xen/include/asm-arm/platforms/omap5.h | 3 +++
3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index 5f817d473e..120e034934 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -36,6 +36,10 @@
#include EARLY_PRINTK_INC
#endif
+
+#define API_HYP_ENTRY 0x102
+#define AUX_CORE_BOOT0_PA 0x48281800
+
/*
* Common register usage in this file:
* r0 -
@@ -113,6 +117,12 @@ past_zImage:
b common_start
+GLOBAL(omap5_init_secondary)
+ ldr r12, =API_HYP_ENTRY
+ adr r0, init_secondary
+ dsb
+ smc #0
+
GLOBAL(init_secondary)
cpsid aif /* Disable all interrupts */
@@ -159,7 +169,6 @@ common_start:
PRINT("- CPU doesn't support the virtualization extensions -\r\n")
b fail
1:
-
/* Check that we're already in Hyp mode */
mrs r0, cpsr
and r0, r0, #0x1f /* Mode is in the low 5 bits of CPSR */
diff --git a/xen/arch/arm/platforms/omap5.c b/xen/arch/arm/platforms/omap5.c
index aee24e4d28..6b5cc15af3 100644
--- a/xen/arch/arm/platforms/omap5.c
+++ b/xen/arch/arm/platforms/omap5.c
@@ -128,8 +128,9 @@ static int __init omap5_smp_init(void)
}
printk("Set AuxCoreBoot1 to %"PRIpaddr" (%p)\n",
- __pa(init_secondary), init_secondary);
- writel(__pa(init_secondary), wugen_base + OMAP_AUX_CORE_BOOT_1_OFFSET);
+ __pa(omap5_init_secondary), omap5_init_secondary);
+ writel(__pa(omap5_init_secondary),
+ wugen_base + OMAP_AUX_CORE_BOOT_1_OFFSET);
printk("Set AuxCoreBoot0 to 0x20\n");
writel(0x20, wugen_base + OMAP_AUX_CORE_BOOT_0_OFFSET);
diff --git a/xen/include/asm-arm/platforms/omap5.h b/xen/include/asm-arm/platforms/omap5.h
index c559c84b61..732b27f403 100644
--- a/xen/include/asm-arm/platforms/omap5.h
+++ b/xen/include/asm-arm/platforms/omap5.h
@@ -22,6 +22,9 @@
#endif /* __ASM_ARM_PLATFORMS_OMAP5_H */
+/* Secondary cpu omap5 specific init routine */
+extern void omap5_init_secondary(void);
+
/*
* Local variables:
* mode: C
--
2.20.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next reply other threads:[~2019-06-21 20:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-21 20:02 Denis Obrezkov [this message]
2019-06-24 11:09 ` [Xen-devel] [PATCH] xen/arm: Switch OMAP5 secondary cores into hyp mode Julien Grall
2019-06-24 12:03 ` Andrew Cooper
2019-06-25 9:57 ` Julien Grall
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=ee1f4b9b969e6cf67278905e0405bc4fa5d6080c.1561147189.git.denisobrezkov@gmail.com \
--to=denisobrezkov@gmail.com \
--cc=julien.grall@arm.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.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).