[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 4/5] arm: use r12 to pass the hypercall number



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 <stefano.stabellini@xxxxxxxxxxxxx>
---
 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 <public/domctl.h> /* for arch_do_domctl */
 
+#define XEN_HYPERCALL_TAG   0XEA1
+
 #endif /* __ASM_ARM_HYPERCALL_H__ */
 /*
  * Local variables:
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.