# HG changeset patch
# User Jimi Xenidis <[EMAIL PROTECTED]>
# Node ID 417779fda95b8b8f204cde0be75c56cccac55536
# Parent  f5d55155e4d5531675179b3d678bc290141185a6
[POWERPC] add HYPERVISOR_xen_version(XENVER_get_features)

This patch add the XENVER_get_features cmd to
HYPERVISOR_xen_version().  This call can happen early enough that we
cannot allocate a page which requires us to use xencomm_create_mini(),
however we should stop using the mini when allocation is available.
---
 arch/powerpc/platforms/xen/hcall.c |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff -r f5d55155e4d5 -r 417779fda95b arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.c        Wed Aug 09 18:21:31 2006 -0400
+++ b/arch/powerpc/platforms/xen/hcall.c        Wed Aug 09 18:33:27 2006 -0400
@@ -68,10 +68,14 @@ EXPORT_SYMBOL(HYPERVISOR_event_channel_o
 
 int HYPERVISOR_xen_version(int cmd, void *arg)
 {
+       /* these calls are small and could be called before the
+        * allocator is ready */
+       char xc_area[XENCOMM_MINI_AREA];
        struct xencomm_desc *desc;
        const unsigned long hcall = __HYPERVISOR_xen_version;
        int argsize;
        int rc;
+       static int slab;
 
        switch (cmd) {
        case XENVER_version:
@@ -95,18 +99,30 @@ int HYPERVISOR_xen_version(int cmd, void
        case XENVER_pagesize:
                argsize = (arg == NULL) ? 0 : sizeof(void *);
                break;
+       case XENVER_get_features:
+               argsize = sizeof(xen_feature_info_t);
+               break;
        default:
                printk("%s: unknown version cmd %d\n", __func__, cmd);
                return -ENOSYS;
        }
 
-       rc = xencomm_create(arg, argsize, &desc, GFP_KERNEL);
+       if (!slab) {
+               slab = slab_is_available();
+       }
+       if (slab)
+               rc = xencomm_create(arg, argsize, &desc, GFP_KERNEL);
+       else
+               rc = xencomm_create_mini(xc_area, XENCOMM_MINI_AREA,
+                                        arg, argsize, &desc);
        if (rc)
                return rc;
 
        rc = plpar_hcall_norets(XEN_MARK(hcall), cmd, __pa(desc));
 
-       xencomm_free(desc);
+       if (slab)
+               xencomm_free(desc);
+
        return rc;
 }
 EXPORT_SYMBOL(HYPERVISOR_xen_version);
@@ -235,7 +251,7 @@ EXPORT_SYMBOL(HYPERVISOR_sched_op);
 
 int HYPERVISOR_multicall(void *call_list, int nr_calls)
 {
-       BUG_ON(1);
+       BUG();
        return -ENOSYS;
 }
 EXPORT_SYMBOL(HYPERVISOR_multicall);
@@ -470,7 +486,8 @@ static int xenppc_privcmd_event_channel_
                break;
 
        default:
-               printk("%s: unknown EVTCHNOP (%ld)\n", __func__, 
hypercall->arg[0]);
+               printk("%s: unknown EVTCHNOP (%ld)\n",
+                      __func__, hypercall->arg[0]);
                return -EINVAL;
        }
 

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

Reply via email to