From: Ian Campbell Subject: Re: [PATCH v2 4/6] arm: add a function to invoke the PSCI handler Date: Wed, 4 Dec 2013 12:32:25 +0000 Message-ID: <1386160345.17466.72.camel@kazak.uk.xensource.com> References: <1385982538-17855-1-git-send-email-andre.przywara@linaro.org> <1385982538-17855-5-git-send-email-andre.przywara@linaro.org> <1385996853.7108.110.camel@kazak.uk.xensource.com> <529F1F4E.4010405@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VoBd3-0004LO-Oo for xen-devel@lists.xenproject.org; Wed, 04 Dec 2013 12:32:33 +0000 In-Reply-To: <529F1F4E.4010405@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andre Przywara Cc: xen-devel@lists.xenproject.org, julien.grall@linaro.org, patches@linaro.org, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Wed, 2013-12-04 at 13:25 +0100, Andre Przywara wrote: > 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 > >> --- > >> 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? You can use vaddr_t or register_t depending on the semantics (they are otherwise the same). Probably register_t here. Ian.