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][POWERPC] Use "inline" xencomm handles (

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [linux-ppc-2.6] [LINUX][POWERPC] Use "inline" xencomm handles (and remove "mini" descriptors)
From: Xen patchbot-linux-ppc-2.6 <patchbot-linux-ppc-2.6@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 12 Sep 2006 18:21:26 +0000
Delivery-date: Tue, 12 Sep 2006 11:39:46 -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 Hollis Blanchard <hollisb@xxxxxxxxxx>
# Node ID 22563db8938def924303f869cd150173b1cc62a4
# Parent  e574e8dd4c487af78c62a7892a4978ea7db74d15
[LINUX][POWERPC] Use "inline" xencomm handles (and remove "mini" descriptors)
Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>
---
 arch/powerpc/platforms/xen/Makefile  |    2 
 arch/powerpc/platforms/xen/hcall.c   |  206 +++++++++++++++--------------------
 drivers/xen/core/xencomm.c           |  101 ++---------------
 include/xen/interface/arch-powerpc.h |    3 
 include/xen/interface/xencomm.h      |    6 -
 include/xen/xencomm.h                |   24 ++--
 6 files changed, 129 insertions(+), 213 deletions(-)

diff -r e574e8dd4c48 -r 22563db8938d arch/powerpc/platforms/xen/Makefile
--- a/arch/powerpc/platforms/xen/Makefile       Tue Sep 12 13:10:55 2006 -0500
+++ b/arch/powerpc/platforms/xen/Makefile       Tue Sep 12 13:14:59 2006 -0500
@@ -1,4 +1,4 @@ obj-y   += setup.o evtchn.o hcall.o udbg_x
-obj-y  += setup.o evtchn.o hcall.o udbg_xen.o xen_guest.o reboot.o
+obj-y  += setup.o evtchn.o hcall.o udbg_xen.o xen_guest.o reboot.o xencomm.o
 
 # we need the latest __XEN_INTERFACE_VERSION__ (see xen-compat.h)
 CFLAGS_hcall.o += -D__XEN_TOOLS__
diff -r e574e8dd4c48 -r 22563db8938d arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.c        Tue Sep 12 13:10:55 2006 -0500
+++ b/arch/powerpc/platforms/xen/hcall.c        Tue Sep 12 13:14:59 2006 -0500
@@ -1,3 +1,23 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ * Copyright (C) IBM Corp. 2006
+ *
+ * Authors: Hollis Blanchard <hollisb@xxxxxxxxxx>
+ */
+
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
@@ -24,9 +44,9 @@
 
 /* Xencomm notes:
  *
- * Some hypercalls are made before the memory subsystem is up, so instead of
- * calling xencomm_create(), we allocate XENCOMM_MINI_AREA bytes from the stack
- * to hold the xencomm descriptor.
+ * For kernel memory, we assume that virtually contiguous pages are also
+ * physically contiguous. This allows us to avoid creating descriptors for
+ * kernel hypercalls, such as console and event channel operations.
  *
  * In general, we need a xencomm descriptor to cover the top-level data
  * structure (e.g. the domctl op), plus another for every embedded pointer to
@@ -35,44 +55,24 @@
 
 int HYPERVISOR_console_io(int cmd, int count, char *str)
 {
-       char xc_area[XENCOMM_MINI_AREA];
-       struct xencomm_desc *desc;
-       int rc;
-
-       rc = xencomm_create_mini(xc_area, XENCOMM_MINI_AREA, str, count,
-                               &desc);
-       if (rc)
-               return rc;
-
-       rc = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_console_io),
-                                 cmd, count, __pa(desc));
-
-       return rc;
+       void *desc = xencomm_create_inline(str);
+
+       return plpar_hcall_norets(XEN_MARK(__HYPERVISOR_console_io),
+                                 cmd, count, desc);
 }
 EXPORT_SYMBOL(HYPERVISOR_console_io);
 
 int HYPERVISOR_event_channel_op(int cmd, void *op)
 {
-       char xc_area[XENCOMM_MINI_AREA];
-       struct xencomm_desc *desc;
-       int rc;
-
-       rc = xencomm_create_mini(xc_area, XENCOMM_MINI_AREA,
-                                op, sizeof(evtchn_op_t), &desc);
-       if (rc)
-               return rc;
-
-       rc = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_event_channel_op),
-                               cmd, __pa(desc));
-       return rc;
+       void *desc = xencomm_create_inline(op);
+
+       return plpar_hcall_norets(XEN_MARK(__HYPERVISOR_event_channel_op),
+                               cmd, desc);
 }
 EXPORT_SYMBOL(HYPERVISOR_event_channel_op);
 
-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];
+int HYPERVISOR_xen_version_userspace(int cmd, void *arg)
+{
        struct xencomm_desc *desc;
        const unsigned long hcall = __HYPERVISOR_xen_version;
        int argsize;
@@ -107,39 +107,40 @@ int HYPERVISOR_xen_version(int cmd, void
                printk(KERN_ERR "%s: unknown version cmd %d\n", __func__, cmd);
                return -ENOSYS;
        }
-       rc = xencomm_create_mini(xc_area, XENCOMM_MINI_AREA,
-                                arg, argsize, &desc);
+
+       rc = xencomm_create(arg, argsize, &desc, GFP_KERNEL);
        if (rc)
                return rc;
 
-       rc = plpar_hcall_norets(XEN_MARK(hcall), cmd, __pa(desc));
-
-       return rc;
-}
-EXPORT_SYMBOL(HYPERVISOR_xen_version);
-
-int HYPERVISOR_physdev_op(int cmd, void *op)
-{
-       struct xencomm_desc *desc;
-       int rc;
-
-       rc = xencomm_create(op, sizeof(physdev_op_t), &desc, GFP_ATOMIC);
-       if (rc)
-               return rc;
-
-       rc = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_physdev_op),
-                               cmd, __pa(desc));
+       rc = plpar_hcall_norets(XEN_MARK(hcall), cmd, xencomm_pa(desc));
 
        xencomm_free(desc);
        return rc;
 }
+EXPORT_SYMBOL(HYPERVISOR_xen_version);
+
+int HYPERVISOR_xen_version(int cmd, void *arg)
+{
+       if (is_kernel_addr((unsigned long)arg)) {
+               void *desc = xencomm_create_inline(arg);
+               return plpar_hcall_norets(XEN_MARK(__HYPERVISOR_xen_version), 
cmd, desc);
+       }
+       return HYPERVISOR_xen_version_userspace(cmd, arg);
+}
+
+int HYPERVISOR_physdev_op(int cmd, void *op)
+{
+       void *desc = xencomm_create_inline(op);
+
+       return plpar_hcall_norets(XEN_MARK(__HYPERVISOR_physdev_op),
+                               cmd, desc);
+}
 EXPORT_SYMBOL(HYPERVISOR_physdev_op);
 
 int HYPERVISOR_grant_table_op(unsigned int cmd, void *op, unsigned int count)
 {
-       struct xencomm_desc *desc;
-       struct xencomm_desc *frame_list;
-       long rc;
+       void *desc;
+       void *frame_list;
        int argsize;
 
        switch (cmd) {
@@ -155,13 +156,9 @@ int HYPERVISOR_grant_table_op(unsigned i
                memcpy(&setup, op, sizeof(setup));
                argsize = sizeof(setup);
 
-               rc = xencomm_create(xen_guest_handle(setup.frame_list),
-                               setup.nr_frames * 
sizeof(*xen_guest_handle(setup.frame_list)),
-                               &frame_list, GFP_KERNEL);
-               if (rc)
-                       return rc;
-
-               set_xen_guest_handle(setup.frame_list, (void 
*)__pa(frame_list));
+               frame_list = 
xencomm_create_inline(xen_guest_handle(setup.frame_list));
+
+               set_xen_guest_handle(setup.frame_list, frame_list);
                memcpy(op, &setup, sizeof(setup));
                }
                break;
@@ -176,24 +173,15 @@ int HYPERVISOR_grant_table_op(unsigned i
                return -ENOSYS;
        }
 
-       rc = xencomm_create(op, count * argsize, &desc, GFP_KERNEL);
-       if (rc)
-               return rc;
-
-       rc = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_grant_table_op), cmd,
-                       __pa(desc), count);
-
-       if (cmd == GNTTABOP_setup_table)
-               xencomm_free(frame_list);
-       xencomm_free(desc);
-
-       return rc;
+       desc = xencomm_create_inline(op);
+
+       return plpar_hcall_norets(XEN_MARK(__HYPERVISOR_grant_table_op), cmd,
+                       desc, count);
 }
 EXPORT_SYMBOL(HYPERVISOR_grant_table_op);
 
 int HYPERVISOR_sched_op(int cmd, void *arg)
 {
-       int rc;
        struct xencomm_desc *desc;
        ulong argsize;
 
@@ -205,17 +193,10 @@ int HYPERVISOR_sched_op(int cmd, void *a
                break;
 
        case SCHEDOP_shutdown: {
-               /* we use a minicom area cuz we could be called from panic() */
-               char xc_area[XENCOMM_MINI_AREA];
-
-               rc = xencomm_create_mini(xc_area, XENCOMM_MINI_AREA,
-                                        arg, sizeof(sched_shutdown_t), &desc);
-               if (rc)
-                       return rc;
-
-               rc = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_sched_op),
-                                       cmd, __pa(desc));
-               return rc;
+               desc = xencomm_create_inline(arg);
+
+               return plpar_hcall_norets(XEN_MARK(__HYPERVISOR_sched_op),
+                                       cmd, desc);
        }
        case SCHEDOP_poll:
                argsize = sizeof(sched_poll_t);
@@ -228,15 +209,10 @@ int HYPERVISOR_sched_op(int cmd, void *a
                return -ENOSYS;
        }
 
-       rc = xencomm_create(arg, argsize, &desc, GFP_KERNEL);
-       if (rc)
-               return rc;
-
-       rc = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_sched_op),
-                               cmd, __pa(desc));
-       xencomm_free(desc);
-
-       return rc;
+       desc = xencomm_create_inline(arg);
+
+       return plpar_hcall_norets(XEN_MARK(__HYPERVISOR_sched_op),
+                               cmd, desc);
 }
 EXPORT_SYMBOL(HYPERVISOR_sched_op);
 
@@ -246,6 +222,9 @@ int HYPERVISOR_multicall(void *call_list
        return -ENOSYS;
 }
 EXPORT_SYMBOL(HYPERVISOR_multicall);
+
+
+/* privcmd operations: */
 
 static int xenppc_privcmd_domctl(privcmd_hypercall_t *hypercall)
 {
@@ -278,7 +257,7 @@ static int xenppc_privcmd_domctl(privcmd
                        kern_op.u.getmemlist.max_pfns * sizeof(unsigned long),
                        &desc, GFP_KERNEL);
                set_xen_guest_handle(kern_op.u.getmemlist.buffer,
-                                    (void *)__pa(desc));
+                                    xencomm_pa(desc));
                break;
        case XEN_DOMCTL_getpageframeinfo:
                break;
@@ -288,7 +267,7 @@ static int xenppc_privcmd_domctl(privcmd
                        kern_op.u.getpageframeinfo2.num,
                        &desc, GFP_KERNEL);
                set_xen_guest_handle(kern_op.u.getpageframeinfo2.array,
-                                    (void *)__pa(desc));
+                                    xencomm_pa(desc));
                break;
        case XEN_DOMCTL_shadow_op:
                ret = xencomm_create(
@@ -296,7 +275,7 @@ static int xenppc_privcmd_domctl(privcmd
                        kern_op.u.shadow_op.pages * sizeof(unsigned long),
                        &desc, GFP_KERNEL);
                set_xen_guest_handle(kern_op.u.shadow_op.dirty_bitmap,
-                                    (void *)__pa(desc));
+                                    xencomm_pa(desc));
                break;
        case XEN_DOMCTL_max_mem:
                break;
@@ -306,7 +285,7 @@ static int xenppc_privcmd_domctl(privcmd
                        sizeof(vcpu_guest_context_t),
                        &desc, GFP_KERNEL);
                set_xen_guest_handle(kern_op.u.vcpucontext.ctxt,
-                                    (void *)__pa(desc));
+                                    xencomm_pa(desc));
                break;
        case XEN_DOMCTL_getvcpucontext:
                ret = xencomm_create(
@@ -314,7 +293,7 @@ static int xenppc_privcmd_domctl(privcmd
                        sizeof(vcpu_guest_context_t),
                        &desc, GFP_KERNEL);
                set_xen_guest_handle(kern_op.u.vcpucontext.ctxt,
-                                    (void *)__pa(desc));
+                                    xencomm_pa(desc));
                break;
        case XEN_DOMCTL_getvcpuinfo:
                break;
@@ -325,7 +304,7 @@ static int xenppc_privcmd_domctl(privcmd
                        (kern_op.u.vcpuaffinity.cpumap.nr_cpus + 7) / 8,
                        &desc, GFP_KERNEL);
                set_xen_guest_handle(kern_op.u.vcpuaffinity.cpumap.bitmap,
-                                    (void *)__pa(desc));
+                                    xencomm_pa(desc));
                break;
        case XEN_DOMCTL_max_vcpus:
        case XEN_DOMCTL_scheduler_op:
@@ -347,13 +326,12 @@ static int xenppc_privcmd_domctl(privcmd
        if (ret)
                goto out; /* error mapping the nested pointer */
 
-       ret = plpar_hcall_norets(XEN_MARK(hypercall->op), __pa(op_desc));
+       ret = plpar_hcall_norets(XEN_MARK(hypercall->op), xencomm_pa(op_desc));
 
        if (copy_to_user(user_op, &kern_op, sizeof(xen_domctl_t)))
                ret = -EFAULT;
 
-       if (desc)
-               xencomm_free(desc);
+       xencomm_free(desc);
 out:
        xencomm_free(op_desc);
        return ret;
@@ -384,7 +362,7 @@ static int xenppc_privcmd_sysctl(privcmd
                        kern_op.u.readconsole.count,
                        &desc, GFP_KERNEL);
                set_xen_guest_handle(kern_op.u.readconsole.buffer,
-                                    (void *)__pa(desc));
+                                    xencomm_pa(desc));
                break;
        case XEN_SYSCTL_tbuf_op:
        case XEN_SYSCTL_physinfo:
@@ -402,7 +380,7 @@ static int xenppc_privcmd_sysctl(privcmd
                                        sizeof(xen_domctl_getdomaininfo_t),
                        &desc, GFP_KERNEL);
                set_xen_guest_handle(kern_op.u.getdomaininfolist.buffer,
-                                    (void *)__pa(desc));
+                                    xencomm_pa(desc));
                break;
        default:
                printk(KERN_ERR "%s: unknown sysctl cmd %d\n", __func__, 
kern_op.cmd);
@@ -412,13 +390,12 @@ static int xenppc_privcmd_sysctl(privcmd
        if (ret)
                goto out; /* error mapping the nested pointer */
 
-       ret = plpar_hcall_norets(XEN_MARK(hypercall->op), __pa(op_desc));
+       ret = plpar_hcall_norets(XEN_MARK(hypercall->op), xencomm_pa(op_desc));
 
        if (copy_to_user(user_op, &kern_op, sizeof(xen_sysctl_t)))
                ret = -EFAULT;
 
-       if (desc)
-               xencomm_free(desc);
+       xencomm_free(desc);
 out:
        xencomm_free(op_desc);
        return ret;
@@ -461,13 +438,12 @@ static int xenppc_privcmd_platform_op(pr
        if (ret)
                goto out; /* error mapping the nested pointer */
 
-       ret = plpar_hcall_norets(XEN_MARK(hypercall->op), __pa(op_desc));
+       ret = plpar_hcall_norets(XEN_MARK(hypercall->op), xencomm_pa(op_desc));
 
        if (copy_to_user(user_op, &kern_op, sizeof(xen_platform_op_t)))
                ret = -EFAULT;
 
-       if (desc)
-               xencomm_free(desc);
+       xencomm_free(desc);
 out:
        xencomm_free(op_desc);
        return ret;
@@ -502,11 +478,11 @@ int HYPERVISOR_memory_op(unsigned int cm
                                return ret;
 
                        set_xen_guest_handle(mop->extent_start,
-                                            (void *)__pa(desc));
+                                            xencomm_pa(desc));
                }
 
                ret = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_memory_op),
-                                        cmd, __pa(op_desc));
+                                        cmd, xencomm_pa(op_desc));
 
                xencomm_free(desc);
        }
@@ -579,7 +555,7 @@ static int xenppc_privcmd_event_channel_
                return ret;
 
        ret = plpar_hcall_norets(XEN_MARK(hypercall->op), hypercall->arg[0],
-                       __pa(desc));
+                       xencomm_pa(desc));
 
        xencomm_free(desc);
        return ret;
diff -r e574e8dd4c48 -r 22563db8938d drivers/xen/core/xencomm.c
--- a/drivers/xen/core/xencomm.c        Tue Sep 12 13:10:55 2006 -0500
+++ b/drivers/xen/core/xencomm.c        Tue Sep 12 13:14:59 2006 -0500
@@ -1,6 +1,4 @@
 /*
- * Copyright (C) 2006 Hollis Blanchard <hollisb@xxxxxxxxxx>, IBM Corporation
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -14,6 +12,10 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ * Copyright (C) IBM Corp. 2006
+ *
+ * Authors: Hollis Blanchard <hollisb@xxxxxxxxxx>
  */
 
 #include <linux/gfp.h>
@@ -21,42 +23,11 @@
 #include <asm/page.h>
 #include <xen/xencomm.h>
 
-int xencomm_debug;
-
-/* translate virtual address to physical address */
-static unsigned long xen_vaddr_to_paddr(unsigned long vaddr)
-{
-       struct page *page;
-       struct vm_area_struct *vma;
-
-       if (vaddr > TASK_SIZE) {
-               /* kernel address */
-               return __pa(vaddr);
-       }
-
-       /* XXX double-check (lack of) locking */
-       vma = find_extend_vma(current->mm, vaddr);
-       if (!vma)
-               return ~0UL;
-
-       page = follow_page(vma, vaddr, 0);
-       if (!page)
-               return ~0UL;
-
-       return (page_to_pfn(page) << PAGE_SHIFT) | (vaddr & ~PAGE_MASK);
-}
-
 static int xencomm_init(struct xencomm_desc *desc,
                        void *buffer, unsigned long bytes)
 {
        unsigned long recorded = 0;
        int i = 0;
-
-       BUG_ON((buffer == NULL) && (bytes > 0));
-
-       /* record the physical pages used */
-       if (buffer == NULL)
-               desc->nr_addrs = 0;
 
        while ((recorded < bytes) && (i < desc->nr_addrs)) {
                unsigned long vaddr = (unsigned long)buffer + recorded;
@@ -67,7 +38,7 @@ static int xencomm_init(struct xencomm_d
                offset = vaddr % PAGE_SIZE; /* handle partial pages */
                chunksz = min(PAGE_SIZE - offset, bytes - recorded);
 
-               paddr = xen_vaddr_to_paddr(vaddr);
+               paddr = xencomm_vtop(vaddr);
                if (paddr == ~0UL) {
                        printk("%s: couldn't translate vaddr %lx\n",
                               __func__, vaddr);
@@ -98,11 +69,10 @@ static struct xencomm_desc *xencomm_allo
 {
        struct xencomm_desc *desc;
 
-       /* XXX could we call this from irq context? */
        desc = (struct xencomm_desc *)__get_free_page(gfp_mask);
-       if (desc == NULL) {
-               panic("%s: page allocation failed\n", __func__);
-       }
+       if (desc == NULL)
+               return NULL;
+
        desc->nr_addrs = (PAGE_SIZE - sizeof(struct xencomm_desc)) /
                        sizeof(*desc->address);
 
@@ -120,13 +90,16 @@ int xencomm_create(void *buffer, unsigne
        struct xencomm_desc *desc;
        int rc;
 
-       if (xencomm_debug) {
-               if ((!buffer) || (bytes == 0)) {
-                       printk(KERN_ERR "%s: NULL buffer\n", __func__);
-                       return 0;
-               }
-               printk("%s: %p[%ld]\n", __func__, buffer, bytes);
+       pr_debug("%s: %p[%ld]\n", __func__, buffer, bytes);
+
+       if (bytes == 0) {
+               /* don't create a descriptor; Xen recognizes NULL. */
+               BUG_ON(buffer != NULL);
+               *ret = NULL;
+               return 0;
        }
+
+       BUG_ON(buffer == NULL); /* 'bytes' is non-zero */
 
        desc = xencomm_alloc(gfp_mask);
        if (!desc) {
@@ -145,43 +118,3 @@ int xencomm_create(void *buffer, unsigne
        return 0;
 }
 
-/* "mini" routines, for stack-based communications: */
-
-static void *xencomm_alloc_mini(void *area, int arealen)
-{
-       unsigned long base = (unsigned long)area;
-       unsigned int left_in_page;
-
-       left_in_page = PAGE_SIZE - base % PAGE_SIZE;
-
-       /* we probably fit right at the front of area */
-       if (left_in_page >= sizeof(struct xencomm_mini)) {
-               return area;
-       }
-
-       /* if not, see if area is big enough to advance to the next page */
-       if ((arealen - left_in_page) >= sizeof(struct xencomm_mini))
-               return (void *)(base + left_in_page);
-
-       /* area was too small */
-       return NULL;
-}
-
-int xencomm_create_mini(void *area, int arealen, void *buffer,
-               unsigned long bytes, struct xencomm_desc **ret)
-{
-       struct xencomm_desc *desc;
-       int rc;
-
-       desc = xencomm_alloc_mini(area, arealen);
-       if (!desc)
-               return -ENOMEM;
-       desc->nr_addrs = XENCOMM_MINI_ADDRS;
-
-       rc = xencomm_init(desc, buffer, bytes);
-       if (rc)
-               return rc;
-
-       *ret = desc;
-       return 0;
-}
diff -r e574e8dd4c48 -r 22563db8938d include/xen/interface/arch-powerpc.h
--- a/include/xen/interface/arch-powerpc.h      Tue Sep 12 13:10:55 2006 -0500
+++ b/include/xen/interface/arch-powerpc.h      Tue Sep 12 13:14:59 2006 -0500
@@ -42,6 +42,7 @@
 #endif
 
 #ifndef __ASSEMBLY__
+
 typedef uint64_t uint64_aligned_t;
 
 /* Guest handles for primitive C types. */
@@ -71,6 +72,8 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 #define TRAP_INSTR "li 0,-1; sc" /* XXX just "sc"? */
 
 #ifndef __ASSEMBLY__
+
+#define XENCOMM_INLINE_FLAG (1UL << 63)
 
 typedef uint64_t xen_ulong_t;
 
diff -r e574e8dd4c48 -r 22563db8938d include/xen/interface/xencomm.h
--- a/include/xen/interface/xencomm.h   Tue Sep 12 13:10:55 2006 -0500
+++ b/include/xen/interface/xencomm.h   Tue Sep 12 13:14:59 2006 -0500
@@ -1,6 +1,4 @@
 /*
- * Copyright (C) 2006 Hollis Blanchard <hollisb@xxxxxxxxxx>, IBM Corporation
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -14,6 +12,10 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ * Copyright (C) IBM Corp. 2006
+ *
+ * Authors: Hollis Blanchard <hollisb@xxxxxxxxxx>
  */
 
 #ifndef _XEN_XENCOMM_H_
diff -r e574e8dd4c48 -r 22563db8938d include/xen/xencomm.h
--- a/include/xen/xencomm.h     Tue Sep 12 13:10:55 2006 -0500
+++ b/include/xen/xencomm.h     Tue Sep 12 13:14:59 2006 -0500
@@ -1,6 +1,4 @@
 /*
- * Copyright (C) 2006 Hollis Blanchard <hollisb@xxxxxxxxxx>, IBM Corporation
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -14,6 +12,10 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ * Copyright (C) IBM Corp. 2006
+ *
+ * Authors: Hollis Blanchard <hollisb@xxxxxxxxxx>
  */
 
 #ifndef _LINUX_XENCOMM_H_
@@ -21,17 +23,17 @@
 
 #include <xen/interface/xencomm.h>
 
-#define XENCOMM_MINI_ADDRS 3
-struct xencomm_mini {
-    struct xencomm_desc _desc;
-    uint64_t address[XENCOMM_MINI_ADDRS];
-};
-#define XENCOMM_MINI_AREA (sizeof(struct xencomm_mini) * 2)
-
 extern int xencomm_create(void *buffer, unsigned long bytes,
                          struct xencomm_desc **desc, gfp_t type);
 extern void xencomm_free(struct xencomm_desc *desc);
-extern int xencomm_create_mini(void *area, int arealen, void *buffer,
-            unsigned long bytes, struct xencomm_desc **ret);
+
+/* provided by architecture code: */
+extern void *xencomm_create_inline(void *ptr);
+extern unsigned long xencomm_vtop(unsigned long vaddr);
+
+static inline void *xencomm_pa(void *ptr)
+{
+       return (void *)xencomm_vtop((unsigned long)ptr);
+}
 
 #endif /* _LINUX_XENCOMM_H_ */

_______________________________________________
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][POWERPC] Use "inline" xencomm handles (and remove "mini" descriptors), Xen patchbot-linux-ppc-2 . 6 <=