ia64/xen-unstable

changeset 18957:8df294a89a36

[IA64] Fix some IPF Xen VT-d bugs.

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>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Tue Jan 06 18:05:32 2009 +0900 (2009-01-06)
parents 29a0ecb8a711
children b8b66dc0fa1d
files xen/arch/ia64/xen/domain.c xen/arch/ia64/xen/hypercall.c
line diff
     1.1 --- a/xen/arch/ia64/xen/domain.c	Mon Jan 05 14:13:38 2009 +0900
     1.2 +++ b/xen/arch/ia64/xen/domain.c	Tue Jan 06 18:05:32 2009 +0900
     1.3 @@ -602,10 +602,8 @@ int arch_domain_create(struct domain *d,
     1.4  	if ((d->arch.mm.pgd = pgd_alloc(&d->arch.mm)) == NULL)
     1.5  	    goto fail_nomem;
     1.6  
     1.7 -	if ( iommu_enabled && (is_hvm_domain(d) || need_iommu(d)) ){
     1.8 -		if(iommu_domain_init(d) != 0)
     1.9 -			goto fail_iommu;
    1.10 -	}
    1.11 +	if(iommu_domain_init(d) != 0)
    1.12 +		goto fail_iommu;
    1.13  
    1.14  	/*
    1.15  	 * grant_table_create() can't fully initialize grant table for domain
     2.1 --- a/xen/arch/ia64/xen/hypercall.c	Mon Jan 05 14:13:38 2009 +0900
     2.2 +++ b/xen/arch/ia64/xen/hypercall.c	Tue Jan 06 18:05:32 2009 +0900
     2.3 @@ -466,16 +466,20 @@ iosapic_guest_write(
     2.4  
     2.5  
     2.6  /*
     2.7 - * XXX We don't support MSI for PCI passthrough, so just return ENOSYS
     2.8 + * XXX: We don't support MSI for PCI passthrough at present, so make the
     2.9 + * following 2 functions dummy for now. They shouldn't return -ENOSYS
    2.10 + * because xend invokes them (the x86 version of them is necessary for
    2.11 + * x86 Xen); if they return -ENOSYS, xend would disallow us to create
    2.12 + * IPF HVM guest with devices assigned so here they can return 0.
    2.13   */
    2.14  static int physdev_map_pirq(struct physdev_map_pirq *map)
    2.15  {
    2.16 -	return -ENOSYS;
    2.17 +	return 0;
    2.18  }
    2.19  
    2.20  static int physdev_unmap_pirq(struct physdev_unmap_pirq *unmap)
    2.21  {
    2.22 -	return -ENOSYS;
    2.23 +	return 0;
    2.24  }
    2.25  
    2.26