From: Andre Przywara <andre.przywara@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: xen-devel@lists.xenproject.org, julien.grall@linaro.org,
patches@linaro.org, stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH v2 4/6] arm: add a function to invoke the PSCI handler
Date: Wed, 04 Dec 2013 13:25:50 +0100 [thread overview]
Message-ID: <529F1F4E.4010405@linaro.org> (raw)
In-Reply-To: <1385996853.7108.110.camel@kazak.uk.xensource.com>
On 12/02/2013 04:07 PM, Ian Campbell wrote:
> On Mon, 2013-12-02 at 12:08 +0100, Andre Przywara wrote:
>> The PSCI handler is invoked via a secure monitor call with the
>> arguments defined in registers. Copy the function from the
>> Linux code and adjust it to work on both ARM32 and ARM64.
>>
>> Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
>> ---
>> xen/arch/arm/psci.c | 28 ++++++++++++++++++++++++++++
>> xen/include/asm-arm/psci.h | 1 +
>> 2 files changed, 29 insertions(+)
>>
>> diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c
>> index 9ff06cd..cc382be 100644
>> --- a/xen/arch/arm/psci.c
>> +++ b/xen/arch/arm/psci.c
>> @@ -25,8 +25,36 @@
>>
>> int psci_available;
>>
>> +#ifdef CONFIG_ARM_32
>> +#define REG_PREFIX "r"
>> +#else
>> +#define REG_PREFIX "x"
>> +#endif
>> +
>> +static noinline int __invoke_psci_fn_smc(u32 function_id, u32 arg0, u32 arg1,
>> + u32 arg2)
>
> I should reread the PSCI spec, but are these not 64-bit on AArch64?
Indeed. Not for all functions and parameters, but for the start address
at least that makes sense ;-)
Is there a type in Xen which reliably holds a native word? ulong or
something?
Thanks,
Andre.
>
>> +{
>> + asm volatile(
>> + __asmeq("%0", REG_PREFIX"0")
>> + __asmeq("%1", REG_PREFIX"1")
>> + __asmeq("%2", REG_PREFIX"2")
>> + __asmeq("%3", REG_PREFIX"3")
>> + "smc #0"
>> + : "+r" (function_id)
>> + : "r" (arg0), "r" (arg1), "r" (arg2));
>> +
>> + return function_id;
>> +}
>> +
>> +#undef REG_PREFIX
>> +
>> static uint32_t psci_cpu_on_nr;
>>
>> +int call_psci_cpu_on(int cpu, void *smp_pen)
>> +{
>> + return __invoke_psci_fn_smc(psci_cpu_on_nr, cpu, __pa(smp_pen), 0);
>> +}
>> +
>> int __init psci_init(void)
>> {
>> struct dt_device_node *psci;
>> diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
>> index 2f37612..50513bf 100644
>> --- a/xen/include/asm-arm/psci.h
>> +++ b/xen/include/asm-arm/psci.h
>> @@ -10,6 +10,7 @@
>> extern int psci_available;
>>
>> int psci_init(void);
>> +int call_psci_cpu_on(int cpu, void *smp_pen);
>>
>> /* functions to handle guest PSCI requests */
>> int do_psci_cpu_on(uint32_t vcpuid, register_t entry_point);
>
>
next prev parent reply other threads:[~2013-12-04 12:26 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-02 11:08 [PATCH v2 0/6] Andre Przywara
2013-12-02 11:08 ` [PATCH v2 1/6] arm: rename xen/arch/arm/psci.c into vpsci.c Andre Przywara
2013-12-02 13:02 ` Julien Grall
2013-12-02 13:06 ` Ian Campbell
2013-12-02 13:08 ` Julien Grall
2013-12-02 14:53 ` Ian Campbell
2013-12-02 11:08 ` [PATCH v2 2/6] arm: move GIC SGI kicking into separate function Andre Przywara
2013-12-02 13:16 ` Julien Grall
2013-12-02 13:24 ` Andre Przywara
2013-12-02 13:57 ` Julien Grall
2013-12-02 15:01 ` Ian Campbell
2013-12-04 12:15 ` Andre Przywara
2013-12-04 12:28 ` Ian Campbell
2013-12-04 12:33 ` Andre Przywara
2013-12-04 12:35 ` Ian Campbell
2013-12-02 11:08 ` [PATCH v2 3/6] arm: parse PSCI node from the host device-tree Andre Przywara
2013-12-02 13:28 ` Julien Grall
2013-12-02 13:44 ` Andre Przywara
2013-12-02 15:00 ` Julien Grall
2013-12-02 15:14 ` Ian Campbell
2013-12-02 15:05 ` Ian Campbell
2013-12-04 12:37 ` Andre Przywara
2013-12-04 12:41 ` Ian Campbell
2013-12-04 12:44 ` Andre Przywara
2013-12-02 11:08 ` [PATCH v2 4/6] arm: add a function to invoke the PSCI handler Andre Przywara
2013-12-02 15:07 ` Ian Campbell
2013-12-04 12:25 ` Andre Przywara [this message]
2013-12-04 12:32 ` Ian Campbell
2013-12-02 11:08 ` [PATCH v2 5/6] arm32: enable PSCI secondary CPU bringup Andre Przywara
2013-12-02 15:09 ` Ian Campbell
2013-12-02 11:08 ` [PATCH v2 6/6] arm64: " Andre Przywara
2013-12-02 15:11 ` Ian Campbell
2013-12-02 14:52 ` [PATCH v2 0/6] Ian Campbell
2013-12-04 12:16 ` Andre Przywara
2013-12-04 12:29 ` 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=529F1F4E.4010405@linaro.org \
--to=andre.przywara@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=julien.grall@linaro.org \
--cc=patches@linaro.org \
--cc=stefano.stabellini@eu.citrix.com \
--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 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.