From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
To: Julien Grall <julien.grall@arm.com>, xen-devel@lists.xen.org
Cc: sstabellini@kernel.org
Subject: Re: [PATCH 5/6] xen/arm: smccc: Add wrapper to automatically select the calling convention
Date: Mon, 27 Aug 2018 17:15:02 +0300 [thread overview]
Message-ID: <fc1ca14a-03b9-a963-c28b-9a8809b1e171@epam.com> (raw)
In-Reply-To: <20180824165820.32620-6-julien.grall@arm.com>
Hi Julien,
On 24.08.18 19:58, Julien Grall wrote:
> Signed-off-by: Julien Grall <julien.grall@arm.com>
> ---
> xen/arch/arm/psci.c | 4 ++++
> xen/include/asm-arm/cpufeature.h | 3 ++-
> xen/include/asm-arm/smccc.h | 8 ++++++++
> 3 files changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
> index 3cf5ecf0f3..941eec921b 100644
> --- a/xen/arch/arm/psci.c
> +++ b/xen/arch/arm/psci.c
> @@ -21,6 +21,7 @@
> #include <xen/types.h>
> #include <xen/mm.h>
> #include <xen/smp.h>
> +#include <asm/cpufeature.h>
> #include <asm/psci.h>
> #include <asm/acpi.h>
>
> @@ -118,6 +119,9 @@ static void __init psci_init_smccc(void)
> smccc_ver = ret;
> }
>
> + if ( smccc_ver >= SMCCC_VERSION(1, 1) )
> + cpus_set_cap(ARM_SMCCC_1_1);
> +
> printk(XENLOG_INFO "Using SMC Calling Convention v%u.%u\n",
> SMCCC_VERSION_MAJOR(smccc_ver), SMCCC_VERSION_MINOR(smccc_ver));
> }
> diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h
> index 9c297c521c..c9c4046f5f 100644
> --- a/xen/include/asm-arm/cpufeature.h
> +++ b/xen/include/asm-arm/cpufeature.h
> @@ -44,8 +44,9 @@
> #define SKIP_CTXT_SWITCH_SERROR_SYNC 6
> #define ARM_HARDEN_BRANCH_PREDICTOR 7
> #define ARM_SSBD 8
> +#define ARM_SMCCC_1_1 9
>
> -#define ARM_NCAPS 9
> +#define ARM_NCAPS 10
>
> #ifndef __ASSEMBLY__
>
> diff --git a/xen/include/asm-arm/smccc.h b/xen/include/asm-arm/smccc.h
> index 1ed6cbaa48..7c39c530e2 100644
> --- a/xen/include/asm-arm/smccc.h
> +++ b/xen/include/asm-arm/smccc.h
> @@ -213,6 +213,7 @@ struct arm_smccc_res {
> */
> #ifdef CONFIG_ARM_32
> #define arm_smccc_1_0_smc(...) arm_smccc_1_1_smc(__VA_ARGS__)
> +#define arm_smccc_smc(...) arm_smccc_1_1_smc(__VA_ARGS__)
> #else
>
> void __arm_smccc_1_0_smc(register_t a0, register_t a1, register_t a2,
> @@ -254,6 +255,13 @@ void __arm_smccc_1_0_smc(register_t a0, register_t a1, register_t a2,
> #define arm_smccc_1_0_smc(...) \
> __arm_smccc_1_0_smc_count(__count_args(__VA_ARGS__), __VA_ARGS__)
>
> +#define arm_smccc_smc(...) \
> + do { \
> + if ( !cpus_have_const_cap(ARM_SMCCC_1_1) ) \
> + arm_smccc_1_0_smc(__VA_ARGS__); \
> + else \
> + arm_smccc_1_1_smc(__VA_ARGS__); \
> + } while ( 0 )
> #endif /* CONFIG_ARM_64 */
>
This will generate lots of code for every arm_smccc_smc(). Can we have
function pointer arm_smccc_smc instead and assign it to either
arm_smccc_1_1_smc() or arm_asmccc_1_0_smc() at boot?
I know that currently we have no function arm_smccc_1_1_smc() because it
is being constructed inline every time. But we can write it explicitly
and then have one indirect call to (maybe cached) function instead of
lots inlined code with conditional branches.
> #endif /* __ASSEMBLY__ */
>
--
Volodymyr Babchuk
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-08-27 14:15 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-24 16:58 [PATCH 0/6] xen/arm: SMCCC fixup and improvement Julien Grall
2018-08-24 16:58 ` [PATCH 1/6] xen/arm: smccc-1.1: Make return values unsigned long Julien Grall
2018-08-27 14:03 ` Volodymyr Babchuk
2018-08-27 15:23 ` Julien Grall
2018-08-27 16:33 ` Volodymyr Babchuk
2018-08-24 16:58 ` [PATCH 2/6] xen/arm: smccc-1.1: Handle function result as parameters Julien Grall
2018-08-27 14:05 ` Volodymyr Babchuk
2018-08-24 16:58 ` [PATCH 3/6] xen/arm: add SMC wrapper that is compatible with SMCCC v1.0 Julien Grall
2018-08-24 16:58 ` [PATCH 4/6] xen/arm: cpufeature: Add helper to check constant caps Julien Grall
2018-08-30 17:43 ` Volodymyr Babchuk
2018-09-25 16:53 ` Julien Grall
2018-08-24 16:58 ` [PATCH 5/6] xen/arm: smccc: Add wrapper to automatically select the calling convention Julien Grall
2018-08-27 14:15 ` Volodymyr Babchuk [this message]
2018-08-27 15:29 ` Julien Grall
2018-08-27 16:50 ` Volodymyr Babchuk
2018-08-28 14:05 ` Julien Grall
2018-08-28 14:40 ` Volodymyr Babchuk
2018-08-28 14:43 ` Julien Grall
2018-08-28 15:10 ` Volodymyr Babchuk
2018-08-28 15:27 ` Julien Grall
2018-08-28 15:50 ` Volodymyr Babchuk
2018-08-28 15:57 ` Julien Grall
2018-08-30 17:45 ` Volodymyr Babchuk
2018-08-24 16:58 ` [PATCH 6/6] xen/arm: Replace call_smc with arm_smccc_smc Julien Grall
2018-08-27 13:53 ` Volodymyr Babchuk
2018-08-30 16:41 ` [PATCH 0/6] xen/arm: SMCCC fixup and improvement Volodymyr Babchuk
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=fc1ca14a-03b9-a963-c28b-9a8809b1e171@epam.com \
--to=volodymyr_babchuk@epam.com \
--cc=julien.grall@arm.com \
--cc=sstabellini@kernel.org \
--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).