From: Stefano Stabellini <sstabellini@kernel.org>
To: xen-devel@lists.xen.org
Cc: edgar.iglesias@xilinx.com,
Stefano Stabellini <stefanos@xilinx.com>,
julien.grall@arm.com, sstabellini@kernel.org,
saeed.nowshadi@xilinx.com
Subject: [PATCH v5 1/7] xen/arm: introduce platform_smc
Date: Mon, 3 Dec 2018 13:03:35 -0800 [thread overview]
Message-ID: <1543871021-315-1-git-send-email-sstabellini@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.10.1812031302070.13706@sstabellini-ThinkPad-X260>
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
From: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Introduce platform_smc as a way to handle firmware calls that Xen does
not know about in a platform specific way. This is particularly useful
for implementing the SiP (SoC implementation specific) service calls.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
---
Changes in v4:
- add likely
---
xen/arch/arm/platform.c | 8 ++++++++
xen/arch/arm/vsmc.c | 4 ++++
xen/include/asm-arm/platform.h | 3 +++
3 files changed, 15 insertions(+)
diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c
index 6989e58..3426056 100644
--- a/xen/arch/arm/platform.c
+++ b/xen/arch/arm/platform.c
@@ -127,6 +127,14 @@ void platform_poweroff(void)
platform->poweroff();
}
+bool platform_smc(struct cpu_user_regs *regs)
+{
+ if ( likely(platform && platform->smc) )
+ return platform->smc(regs);
+
+ return false;
+}
+
bool platform_has_quirk(uint32_t quirk)
{
uint32_t quirks = 0;
diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c
index c4ccae6..c72b9a0 100644
--- a/xen/arch/arm/vsmc.c
+++ b/xen/arch/arm/vsmc.c
@@ -25,6 +25,7 @@
#include <asm/smccc.h>
#include <asm/traps.h>
#include <asm/vpsci.h>
+#include <asm/platform.h>
/* Number of functions currently supported by Hypervisor Service. */
#define XEN_SMCCC_FUNCTION_COUNT 3
@@ -272,6 +273,9 @@ static bool vsmccc_handle_call(struct cpu_user_regs *regs)
case ARM_SMCCC_OWNER_STANDARD:
handled = handle_sssc(regs);
break;
+ case ARM_SMCCC_OWNER_SIP:
+ handled = platform_smc(regs);
+ break;
}
}
diff --git a/xen/include/asm-arm/platform.h b/xen/include/asm-arm/platform.h
index 2591d7b..dc55b6d 100644
--- a/xen/include/asm-arm/platform.h
+++ b/xen/include/asm-arm/platform.h
@@ -26,6 +26,8 @@ struct platform_desc {
void (*reset)(void);
/* Platform power-off */
void (*poweroff)(void);
+ /* Platform specific SMC handler */
+ bool (*smc)(struct cpu_user_regs *regs);
/*
* Platform quirks
* Defined has a function because a platform can support multiple
@@ -55,6 +57,7 @@ int platform_cpu_up(int cpu);
#endif
void platform_reset(void);
void platform_poweroff(void);
+bool platform_smc(struct cpu_user_regs *regs);
bool platform_has_quirk(uint32_t quirk);
bool platform_device_is_blacklisted(const struct dt_device_node *node);
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-12-03 21:03 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-03 21:02 [PATCH v5 0/7] zynqmp: Add forwarding of platform specific firmware calls Stefano Stabellini
2018-12-03 21:03 ` Stefano Stabellini [this message]
2018-12-03 21:07 ` [PATCH v5 1/7] xen/arm: introduce platform_smc Stefano Stabellini
2018-12-11 14:54 ` Julien Grall
2018-12-03 21:03 ` [PATCH v5 2/7] xen/arm: zynqmp: Forward plaform specific firmware calls Stefano Stabellini
2018-12-11 15:03 ` Julien Grall
2018-12-11 18:50 ` Stefano Stabellini
2018-12-11 19:09 ` Julien Grall
2018-12-11 20:19 ` Stefano Stabellini
2018-12-11 20:27 ` Julien Grall
2018-12-03 21:03 ` [PATCH v5 3/7] xen/arm: zynqmp: introduce zynqmp specific defines Stefano Stabellini
2018-12-11 15:21 ` Julien Grall
2018-12-11 19:22 ` Stefano Stabellini
2018-12-12 10:29 ` Julien Grall
2018-12-12 23:55 ` Stefano Stabellini
2018-12-13 15:50 ` Julien Grall
2018-12-03 21:03 ` [PATCH v5 4/7] xen: introduce mfn_init macro Stefano Stabellini
2018-12-04 10:25 ` Jan Beulich
2018-12-04 19:38 ` Stefano Stabellini
2018-12-05 8:27 ` Jan Beulich
2018-12-12 23:56 ` Stefano Stabellini
2018-12-03 21:03 ` [PATCH v5 5/7] xen/arm: zynqmp: eemi access control Stefano Stabellini
2018-12-11 15:37 ` Julien Grall
2018-12-12 23:57 ` Stefano Stabellini
2018-12-13 15:58 ` Julien Grall
2018-12-03 21:03 ` [PATCH v5 6/7] xen/arm: zynqmp: implement zynqmp_eemi Stefano Stabellini
2018-12-11 15:55 ` Julien Grall
2018-12-11 22:23 ` Stefano Stabellini
2018-12-12 10:48 ` Julien Grall
2018-12-12 23:56 ` Stefano Stabellini
2018-12-13 15:59 ` Julien Grall
2018-12-03 21:03 ` [PATCH v5 7/7] xen/arm: zynqmp: Remove blacklist of ZynqMP's PM node Stefano Stabellini
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=1543871021-315-1-git-send-email-sstabellini@kernel.org \
--to=sstabellini@kernel.org \
--cc=edgar.iglesias@xilinx.com \
--cc=julien.grall@arm.com \
--cc=saeed.nowshadi@xilinx.com \
--cc=stefanos@xilinx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.