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] [POWERPC] add HYPERVISOR_xen_version(XENVER_get

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [linux-ppc-2.6] [POWERPC] add HYPERVISOR_xen_version(XENVER_get_features)
From: Xen patchbot-linux-ppc-2.6 <patchbot-linux-ppc-2.6@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 09 Aug 2006 23:02:08 +0000
Delivery-date: Wed, 09 Aug 2006 16:06:25 -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 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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>