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

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

On 27.07.2020 11:37, Durrant, Paul wrote:
From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Sent: 24 July 2020 19:24

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)


+    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.

Ok. I does look like there could be other potentially lengthy destruction done 
off the back of the RCU call. Ought we have the ability to have a restartable 

I don't see how this would be (easily) feasible. Instead - why do
page tables not get cleaned up already at relinquish_resources time?




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