From: Catalin Marinas <catalin.marinas@arm.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Will Deacon <Will.Deacon@arm.com>,
"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>
Subject: Re: [PATCH v4 5/6] arm64/xen: introduce CONFIG_XEN on ARM64
Date: Thu, 6 Jun 2013 15:25:31 +0100 [thread overview]
Message-ID: <20130606142530.GJ28479@arm.com> (raw)
In-Reply-To: <1370451727-26826-5-git-send-email-stefano.stabellini@eu.citrix.com>
On Wed, Jun 05, 2013 at 06:02:06PM +0100, Stefano Stabellini wrote:
> diff --git a/arch/arm/xen/hypercall.S b/arch/arm/xen/hypercall.S
> index 199cb2d..114b356 100644
> --- a/arch/arm/xen/hypercall.S
> +++ b/arch/arm/xen/hypercall.S
> @@ -31,51 +31,93 @@
> */
>
> /*
> - * The Xen hypercall calling convention is very similar to the ARM
> - * procedure calling convention: the first paramter is passed in r0, the
> - * second in r1, the third in r2 and the fourth in r3. Considering that
> - * Xen hypercalls have 5 arguments at most, the fifth paramter is passed
> - * in r4, differently from the procedure calling convention of using the
> - * stack for that case.
> + * The Xen hypercall calling convention is very similar to the ARM/ARM64
> + * procedure calling convention: the first paramter is passed in r0/x0,
> + * the second in r1/x1, the third in r2/x2 and the fourth in r3/x3.
> + * Considering that Xen hypercalls have 5 arguments at most, the fifth
> + * paramter is always passed in r4/x4, differently from the ARM
> + * procedure calling convention of using the stack for that case.
> *
> - * The hypercall number is passed in r12.
> + * The hypercall number is passed in r12/x16.
> *
> - * The return value is in r0.
> + * The return value is in r0/x0.
> *
> - * The hvc ISS is required to be 0xEA1, that is the Xen specific ARM
> - * hypercall tag.
> + * The hvc ISS is required to be 0xEA1, that is the Xen specific
> + * ARM/ARM64 hypercall tag.
> */
>
> #include <linux/linkage.h>
> #include <asm/assembler.h>
> -#include <asm/opcodes-virt.h>
> #include <xen/interface/xen.h>
>
>
> #define XEN_IMM 0xEA1
>
> +
> +#ifdef CONFIG_ARM
> +
> +#include <asm/opcodes-virt.h>
> +
> +ENTRY(privcmd_call)
> + stmdb sp!, {r4}
> + mov r12, r0
> + mov r0, r1
> + mov r1, r2
> + mov r2, r3
> + ldr r3, [sp, #8]
> + ldr r4, [sp, #4]
> + __HVC(XEN_IMM)
> + ldm sp!, {r4}
> + mov pc, lr
> +ENDPROC(privcmd_call);
> +
> #define HYPERCALL_SIMPLE(hypercall) \
> ENTRY(HYPERVISOR_##hypercall) \
> mov r12, #__HYPERVISOR_##hypercall; \
> - __HVC(XEN_IMM); \
> - mov pc, lr; \
> + __HVC(XEN_IMM); \
> + mov pc, lr; \
> +ENDPROC(HYPERVISOR_##hypercall)
> +
> +#define HYPERCALL5(hypercall) \
> +ENTRY(HYPERVISOR_##hypercall) \
> + stmdb sp!, {r4} \
> + ldr r4, [sp, #4] \
> + mov r12, #__HYPERVISOR_##hypercall; \
> + __HVC(XEN_IMM); \
> + ldm sp!, {r4} \
> + mov pc, lr \
> ENDPROC(HYPERVISOR_##hypercall)
>
> +#else /* ARM64 specific code below */
> +
> +ENTRY(privcmd_call)
> + mov x16, x0
> + mov x0, x1
> + mov x1, x2
> + mov x2, x3
> + mov x3, x4
> + mov x4, x5
> + hvc XEN_IMM
> + ret
> +ENDPROC(privcmd_call);
Ah, thanks to Ian for pointing out, I missed the fact that you merged
the hypercall.S files. Please don't. It's a different assembly syntax.
--
Catalin
next prev parent reply other threads:[~2013-06-06 14:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-05 16:59 [PATCH v4 0/6] Introduce Xen support to ARM64 Stefano Stabellini
2013-06-05 17:02 ` [PATCH v4 1/6] arm/xen: define xen_remap as ioremap_cached Stefano Stabellini
2013-06-05 17:02 ` [PATCH v4 2/6] arm64/xen: introduce asm/xen header files on arm64 Stefano Stabellini
2013-06-05 17:02 ` [PATCH v4 3/6] arm64/xen: implement ioremap_cached " Stefano Stabellini
2013-06-05 17:02 ` [PATCH v4 4/6] arm64/xen: use XEN_IO_PROTO_ABI_ARM on ARM64 Stefano Stabellini
2013-06-05 17:02 ` [PATCH v4 5/6] arm64/xen: introduce CONFIG_XEN " Stefano Stabellini
2013-06-06 9:03 ` [Xen-devel] " Ian Campbell
2013-06-06 9:27 ` Catalin Marinas
2013-06-06 9:29 ` Ian Campbell
2013-06-06 14:25 ` Catalin Marinas [this message]
2013-06-05 17:02 ` [PATCH v4 6/6] MAINTAINERS: add myself as arm64/xen maintainer 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=20130606142530.GJ28479@arm.com \
--to=catalin.marinas@arm.com \
--cc=Ian.Campbell@citrix.com \
--cc=Will.Deacon@arm.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/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