From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: [PATCH 4/5] arm: use r12 to pass the hypercall number Date: Thu, 23 Feb 2012 17:13:31 +0000 Message-ID: <1330017212-20066-4-git-send-email-stefano.stabellini@eu.citrix.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com Cc: Tim.Deegan@citrix.com, Stefano Stabellini , Ian.Campbell@citrix.com, david.vrabel@citrix.com List-Id: xen-devel@lists.xenproject.org Use r12 to pass the hypercall number and r0-r4 for the hypercall arguments as usual. Use the ISS to pass an hypervisor specific tag. Remove passing unused registers to arm_hypercall_table: we don't have 6 arguments hypercalls and we never use 64 bit values as hypercall arguments, 64 bit values are only contained within structs passed as arguments. Signed-off-by: Stefano Stabellini --- xen/arch/arm/traps.c | 16 ++++++++-------- xen/include/asm-arm/hypercall.h | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 395d0af..44d19ec 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -367,7 +367,6 @@ unsigned long do_arch_0(unsigned int cmd, unsigned long long value) } typedef unsigned long arm_hypercall_t( - unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int); #define HYPERCALL(x) \ @@ -409,16 +408,17 @@ static void do_trap_hypercall(struct cpu_user_regs *regs, unsigned long iss) { local_irq_enable(); - regs->r0 = arm_hypercall_table[iss](regs->r0, + if ( iss != XEN_HYPERCALL_TAG ) { + printk("%s %d: received an alien hypercall iss=%lx\n", __func__ , + __LINE__ , iss); + return; + } + + regs->r0 = arm_hypercall_table[regs->r12](regs->r0, regs->r1, regs->r2, regs->r3, - regs->r4, - regs->r5, - regs->r6, - regs->r7, - regs->r8, - regs->r9); + regs->r4); } static void do_cp15_32(struct cpu_user_regs *regs, diff --git a/xen/include/asm-arm/hypercall.h b/xen/include/asm-arm/hypercall.h index e840507..d517542 100644 --- a/xen/include/asm-arm/hypercall.h +++ b/xen/include/asm-arm/hypercall.h @@ -3,6 +3,8 @@ #include /* for arch_do_domctl */ +#define XEN_HYPERCALL_TAG 0XEA1 + #endif /* __ASM_ARM_HYPERCALL_H__ */ /* * Local variables: -- 1.7.2.5