[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XenPPC] [linux-ppc-2.6] [ppc] turn on more stuff



# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 760669a37a3a04dd629823cf41a6bc8ee662e224
# Parent  3c78a28f3fb0c424ee82e2962136a798bf4fe939
[ppc] turn on more stuff

This patch allows for the net/block front/back devices to build and be 
recognized by Dom0.  It also cleans up mush of our Kconfig and Make logic.

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
 arch/powerpc/configs/xen_maple_defconfig |   17 ++++-
 arch/powerpc/platforms/xen/Makefile      |    4 +
 arch/powerpc/platforms/xen/balloon.c     |   31 ++++++++++
 arch/powerpc/platforms/xen/hcall.c       |   92 ++++++++++++++++++++-----------
 drivers/xen/Kconfig                      |   26 ++++++++
 drivers/xen/Makefile                     |   10 ---
 drivers/xen/core/Makefile                |   25 +++-----
 include/asm-powerpc/xen/asm/hypercall.h  |    2 
 include/asm-powerpc/xen/asm/hypervisor.h |   26 +++++++-
 9 files changed, 167 insertions(+), 66 deletions(-)

diff -r 3c78a28f3fb0 -r 760669a37a3a arch/powerpc/configs/xen_maple_defconfig
--- a/arch/powerpc/configs/xen_maple_defconfig  Wed Jun 07 18:10:22 2006 -0400
+++ b/arch/powerpc/configs/xen_maple_defconfig  Wed Jun 07 19:53:53 2006 -0400
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.17-rc6
-# Wed Jun  7 17:51:46 2006
+# Wed Jun  7 19:45:10 2006
 #
 CONFIG_PPC64=y
 CONFIG_64BIT=y
@@ -1267,11 +1267,14 @@ CONFIG_XEN_UNPRIVILEGED_GUEST=y
 CONFIG_XEN_UNPRIVILEGED_GUEST=y
 CONFIG_XEN_BACKEND=y
 # CONFIG_XEN_PCIDEV_BACKEND is not set
-# CONFIG_XEN_BLKDEV_BACKEND is not set
-# CONFIG_XEN_NETDEV_BACKEND is not set
+CONFIG_XEN_BLKDEV_BACKEND=y
+# CONFIG_XEN_BLKDEV_TAP_BE is not set
+CONFIG_XEN_NETDEV_BACKEND=y
+# CONFIG_XEN_NETDEV_PIPELINED_TRANSMITTER is not set
+CONFIG_XEN_NETDEV_LOOPBACK=y
 # CONFIG_XEN_TPMDEV_BACKEND is not set
-# CONFIG_XEN_BLKDEV_FRONTEND is not set
-# CONFIG_XEN_NETDEV_FRONTEND is not set
+CONFIG_XEN_BLKDEV_FRONTEND=y
+CONFIG_XEN_NETDEV_FRONTEND=y
 # CONFIG_XEN_BLKDEV_TAP is not set
 CONFIG_XEN_SCRUB_PAGES=y
 CONFIG_XEN_DISABLE_SERIAL=y
@@ -1279,7 +1282,11 @@ CONFIG_XEN_SYSFS=y
 # CONFIG_XEN_COMPAT_030002_AND_LATER is not set
 CONFIG_XEN_COMPAT_LATEST_ONLY=y
 # CONFIG_XEN_COMPAT_030002 is not set
+CONFIG_HAVE_ARCH_ALLOC_SKB=y
+CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
 CONFIG_NO_IDLE_HZ=y
+CONFIG_XEN_UTIL=y
+CONFIG_XEN_SKBUFF=y
 CONFIG_XEN_XENCOMM=y
 
 #
diff -r 3c78a28f3fb0 -r 760669a37a3a arch/powerpc/platforms/xen/Makefile
--- a/arch/powerpc/platforms/xen/Makefile       Wed Jun 07 18:10:22 2006 -0400
+++ b/arch/powerpc/platforms/xen/Makefile       Wed Jun 07 19:53:53 2006 -0400
@@ -1,1 +1,5 @@ obj-y   += setup.o evtchn.o hcall.o udbg_x
 obj-y  += setup.o evtchn.o hcall.o udbg_xen.o xen_guest.o
+
+ifndef CONFIG_XEN_BALLOON
+obj-y += balloon.o
+endif
diff -r 3c78a28f3fb0 -r 760669a37a3a arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.c        Wed Jun 07 18:10:22 2006 -0400
+++ b/arch/powerpc/platforms/xen/hcall.c        Wed Jun 07 19:53:53 2006 -0400
@@ -179,6 +179,13 @@ int HYPERVISOR_grant_table_op(unsigned i
        return rc;
 }
 EXPORT_SYMBOL(HYPERVISOR_grant_table_op);
+
+int HYPERVISOR_multicall(void *call_list, int nr_calls)
+{
+       BUG_ON(1);
+       return -ENOSYS;
+}
+EXPORT_SYMBOL(HYPERVISOR_multicall);
 
 static int xenppc_privcmd_dom0_op(privcmd_hypercall_t *hypercall)
 {
@@ -314,56 +321,77 @@ out:
        return ret;
 }
 
-static int xenppc_privcmd_memory_op(privcmd_hypercall_t *hypercall)
-{
-       xen_memory_reservation_t kern_op;
-       xen_memory_reservation_t __user *user_op;
+int HYPERVISOR_memory_op(unsigned int cmd, void *arg)
+{
+       int ret;
        struct xencomm_desc *op_desc;
-       const unsigned long cmd = hypercall->arg[0];
-       int ret = 0;
-
-       user_op = (xen_memory_reservation_t __user *)hypercall->arg[1];
-       if (copy_from_user(&kern_op, user_op, sizeof(xen_memory_reservation_t)))
-               return -EFAULT;
-
-       ret = xencomm_create(&kern_op, sizeof(xen_memory_reservation_t),
+       xen_memory_reservation_t *mop;
+
+
+       mop = (xen_memory_reservation_t *)arg;
+       ret = xencomm_create(mop, sizeof(xen_memory_reservation_t),
                             &op_desc, GFP_KERNEL);
        if (ret)
                return ret;
 
        switch (cmd) {
        case XENMEM_increase_reservation:
-       case XENMEM_decrease_reservation: {
+       case XENMEM_decrease_reservation:
+       {
                struct xencomm_desc *desc = NULL;
-               if (xen_guest_handle(kern_op.extent_start)) {
+
+               if (xen_guest_handle(mop->extent_start)) {
                        ret = xencomm_create(
-                               xen_guest_handle(kern_op.extent_start),
-                               kern_op.nr_extents *
-                               sizeof(*xen_guest_handle(kern_op.extent_start)),
+                               xen_guest_handle(mop->extent_start),
+                               mop->nr_extents *
+                               sizeof(*xen_guest_handle(mop->extent_start)),
                                &desc, GFP_KERNEL);
                        if (ret)
-                               goto out;
-
-                       set_xen_guest_handle(kern_op.extent_start,
-                                                (void *)__pa(desc));
+                               return ret;
+
+                       set_xen_guest_handle(mop->extent_start,
+                                            (void *)__pa(desc));
                }
 
-               ret = plpar_hcall_norets(XEN_MARK(hypercall->op), cmd, 
__pa(op_desc));
+               ret = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_memory_op),
+                                        cmd, __pa(op_desc));
 
                xencomm_free(desc);
-               }
-               break;
-       default:
-               printk("%s: unknown memory cmd %ld\n", __func__, cmd);
+       }
+               break;
+               
+       case XENMEM_maximum_ram_page:
+               /* arg is NULL so we can call thru here */
+               ret = plpar_hcall_norets(XEN_MARK(__HYPERVISOR_memory_op),
+                                       cmd, NULL);
+               break;
+       default:
+               printk("%s: unknown grant table op %d\n", __func__, cmd);
                ret = -ENOSYS;
-               goto out;
-       }
-
-       if (copy_to_user(user_op, &kern_op, sizeof(xen_memory_reservation_t)))
+       }
+       xencomm_free(op_desc);
+       return ret;
+
+}
+EXPORT_SYMBOL(HYPERVISOR_memory_op);
+
+static int xenppc_privcmd_memory_op(privcmd_hypercall_t *hypercall)
+{
+       xen_memory_reservation_t kern_op;
+       xen_memory_reservation_t __user *user_op;
+       const unsigned long cmd = hypercall->arg[0];
+       int ret = 0;
+
+       user_op = (xen_memory_reservation_t __user *)hypercall->arg[1];
+       if (copy_from_user(&kern_op, user_op,
+                          sizeof(xen_memory_reservation_t)))
                return -EFAULT;
 
-out:
-       xencomm_free(op_desc);
+       if (!HYPERVISOR_memory_op(cmd, &kern_op)) {
+               if (copy_to_user(user_op, &kern_op,
+                                sizeof(xen_memory_reservation_t)))
+                       return -EFAULT;
+       }
        return ret;
 }
 
diff -r 3c78a28f3fb0 -r 760669a37a3a drivers/xen/Kconfig
--- a/drivers/xen/Kconfig       Wed Jun 07 18:10:22 2006 -0400
+++ b/drivers/xen/Kconfig       Wed Jun 07 19:53:53 2006 -0400
@@ -218,15 +218,37 @@ endmenu
 
 config HAVE_ARCH_ALLOC_SKB
        bool
-       default y if ! PPC_XEN
+       default y
 
 config HAVE_ARCH_DEV_ALLOC_SKB
        bool
-       default y if ! PPC_XEN
+       default y
 
 config NO_IDLE_HZ
        bool
        default y
+
+config XEN_UTIL
+       bool
+       default y
+
+config XEN_BALLOON
+       bool
+       default y if ! PPC_XEN
+
+config XEN_SKBUFF
+       bool
+       depends on NET
+       default y
+
+config XEN_REBOOT
+       bool
+       default y if ! PPC_XEN
+
+config XEN_SMPBOOT
+       bool
+       depends on SMP
+       default y if ! PPC_XEN
 
 config XEN_XENCOMM
        bool
diff -r 3c78a28f3fb0 -r 760669a37a3a drivers/xen/Makefile
--- a/drivers/xen/Makefile      Wed Jun 07 18:10:22 2006 -0400
+++ b/drivers/xen/Makefile      Wed Jun 07 19:53:53 2006 -0400
@@ -1,23 +1,17 @@
-
-obj-y  += util.o
-
 obj-y  += core/
 obj-y  += char/
 obj-y  += console/
 obj-y  += evtchn/
-ifndef CONFIG_PPC_XEN
-obj-y  += balloon/
-endif
 obj-y  += privcmd/
 obj-y  += xenbus/
 
+obj-$(CONFIG_XEN_UTIL)                 += util.o
+obj-$(CONFIG_XEN_BALLOON)              += balloon/
 obj-$(CONFIG_XEN_BLKDEV_BACKEND)       += blkback/
 obj-$(CONFIG_XEN_NETDEV_BACKEND)       += netback/
 obj-$(CONFIG_XEN_TPMDEV_BACKEND)       += tpmback/
 obj-$(CONFIG_XEN_BLKDEV_FRONTEND)      += blkfront/
 obj-$(CONFIG_XEN_NETDEV_FRONTEND)      += netfront/
 obj-$(CONFIG_XEN_BLKDEV_TAP)           += blktap/
-ifndef CONFIG_PPC_XEN
 obj-$(CONFIG_XEN_PCIDEV_BACKEND)       += pciback/
-endif
 obj-$(CONFIG_XEN_PCIDEV_FRONTEND)      += pcifront/
diff -r 3c78a28f3fb0 -r 760669a37a3a drivers/xen/core/Makefile
--- a/drivers/xen/core/Makefile Wed Jun 07 18:10:22 2006 -0400
+++ b/drivers/xen/core/Makefile Wed Jun 07 19:53:53 2006 -0400
@@ -2,19 +2,14 @@
 # Makefile for the linux kernel.
 #
 
-obj-y := evtchn.o
-ifndef CONFIG_PPC_XEN
-obj-y += reboot.o
-endif
-obj-y += gnttab.o
-obj-y += features.o
+obj-y := evtchn.o gnttab.o features.o
 
-obj-$(CONFIG_PROC_FS)     += xen_proc.o
-ifndef CONFIG_PPC_XEN
-obj-$(CONFIG_NET)         += skbuff.o
-obj-$(CONFIG_SMP)         += smpboot.o
-obj-$(CONFIG_HOTPLUG_CPU) += cpu_hotplug.o
-endif
-obj-$(CONFIG_SYSFS)       += hypervisor_sysfs.o
-obj-$(CONFIG_XEN_SYSFS)   += xen_sysfs.o
-obj-$(CONFIG_XEN_XENCOMM) += xencomm.o
+
+obj-$(CONFIG_PROC_FS)          += xen_proc.o
+obj-$(CONFIG_SYSFS)            += hypervisor_sysfs.o
+obj-$(CONFIG_HOTPLUG_CPU)      += cpu_hotplug.o
+obj-$(CONFIG_XEN_SYSFS)                += xen_sysfs.o
+obj-$(CONFIG_XEN_SKBUFF)       += skbuff.o
+obj-$(CONFIG_XEN_REBOOT)       += reboot.o
+obj-$(CONFIG_XEN_SMPBOOT)      += smpboot.o
+obj-$(CONFIG_XEN_XENCOMM)      += xencomm.o
diff -r 3c78a28f3fb0 -r 760669a37a3a include/asm-powerpc/xen/asm/hypercall.h
--- a/include/asm-powerpc/xen/asm/hypercall.h   Wed Jun 07 18:10:22 2006 -0400
+++ b/include/asm-powerpc/xen/asm/hypercall.h   Wed Jun 07 19:53:53 2006 -0400
@@ -43,6 +43,8 @@ extern int HYPERVISOR_physdev_op(int cmd
 extern int HYPERVISOR_physdev_op(int cmd, void *op);
 extern int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop,
                unsigned int count);
+extern int HYPERVISOR_memory_op(unsigned int cmd, void *arg);
+extern int HYPERVISOR_multicall(void *call_list, int nr_calls);
 
 static inline int HYPERVISOR_sched_op(int cmd, unsigned long arg)
 {
diff -r 3c78a28f3fb0 -r 760669a37a3a include/asm-powerpc/xen/asm/hypervisor.h
--- a/include/asm-powerpc/xen/asm/hypervisor.h  Wed Jun 07 18:10:22 2006 -0400
+++ b/include/asm-powerpc/xen/asm/hypervisor.h  Wed Jun 07 19:53:53 2006 -0400
@@ -35,6 +35,7 @@
 #include <linux/kernel.h>
 #include <linux/version.h>
 #include <xen/interface/xen.h>
+#include <xen/foreign_page.h>
 #include <xen/interface/dom0_ops.h>
 #include <asm/ptrace.h>
 #include <asm/page.h>
@@ -104,10 +105,16 @@ void xen_invlpg_mask(cpumask_t *mask, un
 #endif
 
 /* Returns zero on success else negative errno. */
-int xen_create_contiguous_region(
-    unsigned long vstart, unsigned int order, unsigned int address_bits);
-void xen_destroy_contiguous_region(
-    unsigned long vstart, unsigned int order);
+static inline int xen_create_contiguous_region(
+    unsigned long vstart, unsigned int order, unsigned int address_bits)
+{
+       return 0;
+}
+static inline void xen_destroy_contiguous_region(
+    unsigned long vstart, unsigned int order)
+{
+       return;
+}
 
 #include <asm/hypercall.h>
 
@@ -212,4 +219,15 @@ MULTI_update_va_mapping_otherdomain(
 #endif
 }
 
+#define set_phys_to_machine(_x,_y)     do {} while (0)
+#define pfn_pte_ma(pfn, prot)  __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
+
+typedef unsigned long maddr_t;
+
+#ifdef CONFIG_XEN_SCRUB_PAGES
+#define scrub_pages(_p,_n) memset((void *)(_p), 0, (_n) << PAGE_SHIFT)
+#else
+#define scrub_pages(_p,_n) ((void)0)
+#endif
+
 #endif /* __HYPERVISOR_H__ */
diff -r 3c78a28f3fb0 -r 760669a37a3a arch/powerpc/platforms/xen/balloon.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/arch/powerpc/platforms/xen/balloon.c      Wed Jun 07 19:53:53 2006 -0400
@@ -0,0 +1,31 @@
+#include <linux/module.h>
+#include <linux/mm.h>
+
+/*
+ * FIXME: Port balloon driver, if ever
+ */
+
+struct page *balloon_alloc_empty_page_range(unsigned long nr_pages)
+{
+       unsigned long vstart;
+       unsigned int  order = get_order(nr_pages * PAGE_SIZE);
+
+       vstart = __get_free_pages(GFP_KERNEL, order);
+       if (vstart == 0)
+               return NULL;
+
+       return virt_to_page(vstart);
+}
+
+void balloon_dealloc_empty_page_range(
+       struct page *page, unsigned long nr_pages)
+{
+       __free_pages(page, get_order(nr_pages * PAGE_SIZE));
+}
+
+void balloon_update_driver_allowance(long delta)
+{
+}
+
+EXPORT_SYMBOL(balloon_alloc_empty_page_range);
+EXPORT_SYMBOL(balloon_dealloc_empty_page_range);

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.