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-ia64-devel

RE: [Xen-ia64-devel] [PATCH] Fix some IPF Xen VT-d bugs

To: 'Isaku Yamahata' <yamahata@xxxxxxxxxxxxx>
Subject: RE: [Xen-ia64-devel] [PATCH] Fix some IPF Xen VT-d bugs
From: "Cui, Dexuan" <dexuan.cui@xxxxxxxxx>
Date: Wed, 24 Dec 2008 13:11:03 +0800
Accept-language: zh-CN, en-US
Acceptlanguage: zh-CN, en-US
Cc: "'xen-ia64-devel@xxxxxxxxxxxxxxxxxxx'" <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 23 Dec 2008 21:12:15 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20081224045307.GD16150%yamahata@xxxxxxxxxxxxx>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <EADF0A36011179459010BDF5142A45750458C323@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20081224045307.GD16150%yamahata@xxxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acllg464nMQY8glzTfqlID4e+3bclgAAPj4g
Thread-topic: [Xen-ia64-devel] [PATCH] Fix some IPF Xen VT-d bugs
Isaku Yamahata wrote:
>> diff -r 008b68ff6095 xen/arch/ia64/xen/domain.c
>> --- a/xen/arch/ia64/xen/domain.c     Tue Nov 18 10:33:55 2008 +0900
>> +++ b/xen/arch/ia64/xen/domain.c     Mon Dec 15 18:41:52 2008 +0800
>> @@ -602,10 +602,8 @@ int arch_domain_create(struct domain *d,
>>      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 
> 
> Please don't drop is_hvm_domain(d) check.
> At this moment ia64 doesn't support iommu for PV domain because
Oh, thanks for the reminder. Here I neglected this.

Do you mean this:
if ( is_hvm_domain(d) )
    if(iommu_domain_init(d) != 0)
        goto fail_iommu;
This is also not ok since we must ensure iommu_domain_init() is invoked for 
Dom0 -- we need the function invoked to enable DMA remapping.
So how about changing the logic to:
if ( (d->domain_id == 0) || is_hvm_domain(d) )
    if(iommu_domain_init(d) != 0)
        goto fail_iommu;

If you agree this, I'll post a new patch.

> it would introduce race with the ia64 lockless p2m table.
> If you want VT-d support for pv domain, the race must be resolved
> somehow. 
At present, let us support VT-d for HVM guest first.

> 
> Please add comments about why 0 instead of -ENOSYS.
OK, I'll add it.


Thanks,
-- Dexuan


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