xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: Tim.Deegan@citrix.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian.Campbell@citrix.com, david.vrabel@citrix.com
Subject: [PATCH 4/5] arm: use r12 to pass the hypercall number
Date: Thu, 23 Feb 2012 17:13:31 +0000	[thread overview]
Message-ID: <1330017212-20066-4-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1202231705050.23091@kaball-desktop>

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@eu.citrix.com>
---
 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

  parent reply	other threads:[~2012-02-23 17:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23 17:12 [PATCH 0/5] xen/arm: event channels and shared_info page Stefano Stabellini
2012-02-23 17:13 ` [PATCH 1/5] arm: shared_info page allocation and mapping Stefano Stabellini
2012-02-23 17:27   ` Ian Campbell
2012-02-23 18:17     ` Stefano Stabellini
2012-02-23 17:13 ` [PATCH 2/5] arm: implement vcpu_mark_events_pending Stefano Stabellini
2012-02-23 17:13 ` [PATCH 3/5] arm: set the default dom0 max_vcpus value to 1 (currently is 0) Stefano Stabellini
2012-02-23 17:13 ` Stefano Stabellini [this message]
2012-02-23 17:13 ` [PATCH 5/5] arm: introduce more hypercalls 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=1330017212-20066-4-git-send-email-stefano.stabellini@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Tim.Deegan@citrix.com \
    --cc=david.vrabel@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;
as well as URLs for NNTP newsgroup(s).