From: Andre Przywara <andre.przywara@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: julien.grall@linaro.org, xen-devel@lists.xen.org,
patches@linaro.org, stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH 2/4] arm: add a function to invoke the PSCI handler and use it
Date: Thu, 28 Nov 2013 11:59:28 +0100 [thread overview]
Message-ID: <52972210.2090901@linaro.org> (raw)
In-Reply-To: <1385464692.23112.39.camel@kazak.uk.xensource.com>
On 11/26/2013 12:18 PM, Ian Campbell wrote:
> On Mon, 2013-11-25 at 13:02 +0100, Andre Przywara wrote:
>> The PSCI handler is invoked via a secure monitor call with the
>> arguments defined in registers [1]. Copy the function from the
>> Linux code and adjust it to work on both ARM32 and ARM64.
>> Later use that function instead of the generic GIC SEV kick to
>> actually bring up the secondary CPUs.
>>
>> [1]: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0022b/index.html
>>
>> Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
>> ---
>> xen/arch/arm/arm32/smpboot.c | 1 -
>> xen/arch/arm/smpboot.c | 39 +++++++++++++++++++++++++++++++++++----
>> 2 files changed, 35 insertions(+), 5 deletions(-)
>>
>> diff --git a/xen/arch/arm/arm32/smpboot.c b/xen/arch/arm/arm32/smpboot.c
>> index 88fe8fb..fcf653f 100644
>> --- a/xen/arch/arm/arm32/smpboot.c
>> +++ b/xen/arch/arm/arm32/smpboot.c
>> @@ -10,7 +10,6 @@ int __init arch_smp_init(void)
>>
>> int __init arch_cpu_init(int cpu, struct dt_device_node *dn)
>> {
>> - /* TODO handle PSCI init */
>> return 0;
>> }
>>
>> diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
>> index 97bd414..44326d8 100644
>> --- a/xen/arch/arm/smpboot.c
>> +++ b/xen/arch/arm/smpboot.c
>> @@ -89,6 +89,29 @@ smp_clear_cpu_maps (void)
>> cpu_logical_map(0) = READ_SYSREG(MPIDR_EL1) & MPIDR_HWID_MASK;
>> }
>>
>> +#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)
>
> Please can you put this in psci.c and provide wrappers e.g.
> psci_cpu_up(). THese can return some suitable errno if PSCI isn't
> enabled. Or we could add a psci_enabled() call
>
> Why noinline?
This was copied from Linux and I thought it was there for a reason, so I
kept it. But looking closer this was to make sure Linux can use function
pointers later (to abstract hvc and smc calling), so we can remove this
for Xen.
Regards,
Andre.
next prev parent reply other threads:[~2013-11-28 10:59 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-25 12:02 [PATCH 0/4] ARM: add PSCI host support Andre Przywara
2013-11-25 12:02 ` [PATCH 1/4] arm: parse PSCI node from the host device-tree Andre Przywara
2013-11-26 11:12 ` Ian Campbell
2013-11-26 11:25 ` Ian Campbell
2013-11-28 10:56 ` Andre Przywara
2013-11-25 12:02 ` [PATCH 2/4] arm: add a function to invoke the PSCI handler and use it Andre Przywara
2013-11-26 11:18 ` Ian Campbell
2013-11-28 10:59 ` Andre Przywara [this message]
2013-11-25 12:02 ` [PATCH 3/4] arm: dont give up on EAGAIN if PSCI is defined Andre Przywara
2013-11-26 11:20 ` Ian Campbell
2013-11-25 12:02 ` [PATCH 4/4] arm64: defer CPU initialization on ARM64 if PSCI is present Andre Przywara
2013-11-26 11:24 ` Ian Campbell
2013-11-25 13:00 ` [PATCH 0/4] ARM: add PSCI host support George Dunlap
2013-11-25 14:03 ` Ian Campbell
2013-11-25 14:21 ` Andre Przywara
2013-11-25 14:50 ` Ian Campbell
2013-11-25 15:03 ` Andre Przywara
2013-11-25 16:35 ` George Dunlap
2013-11-26 11:01 ` Ian Campbell
2013-11-26 11:05 ` Ian Campbell
2013-11-27 13:45 ` Andre Przywara
2013-11-27 14:28 ` 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=52972210.2090901@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.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).