[IA64] Fix some IPF Xen VT-d bugs.
authorIsaku Yamahata <yamahata@valinux.co.jp>
Tue, 6 Jan 2009 09:05:32 +0000 (18:05 +0900)
committerIsaku Yamahata <yamahata@valinux.co.jp>
Tue, 6 Jan 2009 09:05:32 +0000 (18:05 +0900)
In arch_domain_create(): when xen creates Dom0, need_iommu(d) is false,
so iommu_domain_init() is not invoked, as a result, eventually iommu is
not enabled properly.
Note: d->need_iommu is set to 1 only by assign_device() which is never
called for dom0. And it is called via XEN_DOMCTL_assign_device hypercall.

In IA64 Xen, physdev_map_pirq()/physdev_unmap_pirq() are kept dummy since
we don't support MSI in IA64 Xen now, but here they shouldn't return
-ENOSYS because xend invokes them (the x86 version of them is necessary
for x86 Xen); in IPF Xen if they return -ENOSYS, xend would disallow us
to create IPF HVM guest with devices assigned. Here They can return 0 instead.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
xen/arch/ia64/xen/domain.c
xen/arch/ia64/xen/hypercall.c

index 4b136f42f7173e517d786fe419b53c8011278183..93dd4b28f738806f3183f9c2325938ebe3773951 100644 (file)
@@ -602,10 +602,8 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
        if ((d->arch.mm.pgd = pgd_alloc(&d->arch.mm)) == NULL)
            goto fail_nomem;
 
-       if ( iommu_enabled && (is_hvm_domain(d) || need_iommu(d)) ){
-               if(iommu_domain_init(d) != 0)
-                       goto fail_iommu;
-       }
+       if(iommu_domain_init(d) != 0)
+               goto fail_iommu;
 
        /*
         * grant_table_create() can't fully initialize grant table for domain
index a56002d2e28d238611558c9c2cdf11d2c4ad178a..d6151a2f1b01ae21af900f1764e67e1133948867 100644 (file)
@@ -466,16 +466,20 @@ iosapic_guest_write(
 
 
 /*
- * XXX We don't support MSI for PCI passthrough, so just return ENOSYS
+ * XXX: We don't support MSI for PCI passthrough at present, so make the
+ * following 2 functions dummy for now. They shouldn't return -ENOSYS
+ * because xend invokes them (the x86 version of them is necessary for
+ * x86 Xen); if they return -ENOSYS, xend would disallow us to create
+ * IPF HVM guest with devices assigned so here they can return 0.
  */
 static int physdev_map_pirq(struct physdev_map_pirq *map)
 {
-       return -ENOSYS;
+       return 0;
 }
 
 static int physdev_unmap_pirq(struct physdev_unmap_pirq *unmap)
 {
-       return -ENOSYS;
+       return 0;
 }