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

[Xen-ia64-devel] [PATCH] 1/3 Fix PV driver domains - xenlinux xencomm support



This adds xencomm support for several PHYSDEVOP calls (manage_pci_add,
manage_pci_remove, map_pirq, and unmap_pirq) as well
as ïXEN_DOMCTL_assign_device.

Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
--

diff -r 2866e6af503e arch/ia64/xen/xcom_hcall.c
--- a/arch/ia64/xen/xcom_hcall.c        Thu Jul 31 15:33:54 2008 +0100
+++ b/arch/ia64/xen/xcom_hcall.c        Thu Aug 07 13:51:05 2008 -0600
@@ -143,6 +143,16 @@ xencomm_hypercall_physdev_op(int cmd, vo
                break;
        case PHYSDEVOP_irq_status_query:
                argsize = sizeof(physdev_irq_status_query_t);
+               break;
+       case PHYSDEVOP_manage_pci_add:
+       case PHYSDEVOP_manage_pci_remove:
+               argsize = sizeof(physdev_manage_pci_t);
+               break;
+       case PHYSDEVOP_map_pirq:
+               argsize = sizeof(physdev_map_pirq_t);
+               break;
+       case PHYSDEVOP_unmap_pirq:
+               argsize = sizeof(physdev_unmap_pirq_t);
                break;
 
        default:
diff -r 2866e6af503e arch/ia64/xen/xcom_privcmd.c
--- a/arch/ia64/xen/xcom_privcmd.c      Thu Jul 31 15:33:54 2008 +0100
+++ b/arch/ia64/xen/xcom_privcmd.c      Thu Aug 07 13:51:05 2008 -0600
@@ -327,6 +327,7 @@ xencomm_privcmd_domctl(privcmd_hypercall
        case XEN_DOMCTL_settimeoffset:
        case XEN_DOMCTL_sendtrigger:
        case XEN_DOMCTL_set_opt_feature:
+       case XEN_DOMCTL_assign_device:
                break;
        case XEN_DOMCTL_pin_mem_cacheattr:
                return -ENOSYS;
@@ -828,6 +829,36 @@ xencomm_privcmd_ia64_debug_op(privcmd_hy
        return ret;     
 }
 
+static int
+xencomm_privcmd_ia64_physdev_op(privcmd_hypercall_t *hypercall)
+{
+       int cmd = hypercall->arg[0];
+       struct xencomm_handle *desc;
+       unsigned int argsize;
+       int ret;
+
+       switch (cmd) {
+       case PHYSDEVOP_map_pirq:
+               argsize = sizeof(physdev_map_pirq_t);
+               break;
+       case PHYSDEVOP_unmap_pirq:
+               argsize = sizeof(physdev_unmap_pirq_t);
+               break;
+       default:
+               printk("%s: unknown PHYSDEVOP %d\n", __func__, cmd);
+               return -EINVAL;
+       }
+
+       desc = xencomm_map((void *)hypercall->arg[1], argsize);
+       if ((void *)hypercall->arg[1] != NULL && argsize > 0 && desc == NULL)
+               return -ENOMEM;
+
+       ret = xencomm_arch_hypercall_physdev_op(cmd, desc);
+
+       xencomm_free(desc);
+       return ret;
+}
+
 int
 privcmd_hypercall(privcmd_hypercall_t *hypercall)
 {
@@ -854,6 +885,8 @@ privcmd_hypercall(privcmd_hypercall_t *h
                return xencomm_privcmd_ia64_dom0vp_op(hypercall);
        case __HYPERVISOR_ia64_debug_op:
                return xencomm_privcmd_ia64_debug_op(hypercall);
+       case __HYPERVISOR_physdev_op:
+               return xencomm_privcmd_ia64_physdev_op(hypercall);
        default:
                printk("%s: unknown hcall (%ld)\n", __func__, hypercall->op);
                return -ENOSYS;



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


 


Rackspace

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