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

Re: [PATCH 2/6] x86/iommu: add common page-table allocator



On 24.07.2020 20:24, Andrew Cooper wrote:
> On 24/07/2020 17:46, Paul Durrant wrote:
>> --- a/xen/drivers/passthrough/x86/iommu.c
>> +++ b/xen/drivers/passthrough/x86/iommu.c
>> @@ -140,11 +140,19 @@ int arch_iommu_domain_init(struct domain *d)
>>  
>>      spin_lock_init(&hd->arch.mapping_lock);
>>  
>> +    INIT_PAGE_LIST_HEAD(&hd->arch.pgtables.list);
>> +    spin_lock_init(&hd->arch.pgtables.lock);
>> +
>>      return 0;
>>  }
>>  
>>  void arch_iommu_domain_destroy(struct domain *d)
>>  {
>> +    struct domain_iommu *hd = dom_iommu(d);
>> +    struct page_info *pg;
>> +
>> +    while ( (pg = page_list_remove_head(&hd->arch.pgtables.list)) )
>> +        free_domheap_page(pg);
> 
> Some of those 90 lines saved were the logic to not suffer a watchdog
> timeout here.
> 
> To do it like this, it needs plumbing into the relinquish resources path.

And indeed this is possible now only because we don't destroy page
tables for still running domains anymore. Maybe the description
should also make this connection.

Jan



 


Rackspace

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