WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] implement HYPERVISOR_mult

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] implement HYPERVISOR_multicall()
From: Xen patchbot-linux-ppc-2.6 <patchbot-linux-ppc-2.6@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 10 Oct 2006 14:03:19 +0000
Delivery-date: Tue, 10 Oct 2006 07:22:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 2765c83b576d5af048d381c481e33f597c2be258
# Parent  23cc5f7d71e01bc9908026b0f53e310ece230f60
[LINUX][XEN][POWERPC] implement HYPERVISOR_multicall()

Sadly, the xencomm thing makes performing the multicall loop in Xen
prohibitive, so for now we blow it out here.  I think some level of
atomicity is expected from the multicall so we precheck all the ops
and the turn off interrupts while we make all the calls.

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
 arch/powerpc/platforms/xen/hcall.c |   34 ++++++++++++++++++++++++++++++++--
 1 files changed, 32 insertions(+), 2 deletions(-)

diff -r 23cc5f7d71e0 -r 2765c83b576d arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.c        Mon Oct 09 17:20:44 2006 -0400
+++ b/arch/powerpc/platforms/xen/hcall.c        Mon Oct 09 19:57:42 2006 -0400
@@ -189,10 +189,40 @@ HYPERVISOR_poll(
 }
 EXPORT_SYMBOL(HYPERVISOR_poll);
 
+typedef ulong (mf_t)(ulong arg0, ...);
+
+static mf_t *multicall_funcs[] = {
+       [__HYPERVISOR_grant_table_op] = (mf_t *)HYPERVISOR_grant_table_op,
+};
+
 int HYPERVISOR_multicall(void *call_list, int nr_calls)
 {
-       BUG();
-       return -ENOSYS;
+       /* we blow out the multicall because the xencomm stuff is jsut
+        * too tricky */
+       multicall_entry_t *mcl = (multicall_entry_t *)call_list;
+       multicall_entry_t *c;
+       int i;
+       mf_t *mf;
+       int res;
+       ulong flags;
+
+       /* let make sure all the calls are supported */
+       for (i = 0; i < nr_calls; i++) {
+               mf = multicall_funcs[mcl[i].op];
+               BUG_ON(mf == NULL);
+       }
+       /* disable interrupts until we are done all calls */
+       local_irq_save(flags);
+       for (i = 0; i < nr_calls; i++) {
+               /* lookup supported multicalls */
+               c = &mcl[i];
+               mf = multicall_funcs[c->op];
+               res = mf(c->args[0], c->args[1], c->args[2],
+                        c->args[3], c->args[4], c->args[5]);
+               c->result = res;
+       }
+       local_irq_restore(flags);
+       return 0;
 }
 EXPORT_SYMBOL(HYPERVISOR_multicall);
 

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] implement HYPERVISOR_multicall(), Xen patchbot-linux-ppc-2 . 6 <=