xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>, Paul Durrant <paul@xen.org>
Cc: xen-devel@lists.xenproject.org,
	"Paul Durrant" <pdurrant@amazon.com>,
	"Kevin Tian" <kevin.tian@intel.com>, "Wei Liu" <wl@xen.org>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [PATCH 2/6] x86/iommu: add common page-table allocator
Date: Sun, 26 Jul 2020 10:26:10 +0200	[thread overview]
Message-ID: <036e10b0-d0b3-0437-f9ac-82845fd0cbd2@suse.com> (raw)
In-Reply-To: <d0a0c46f-1461-144c-ca62-259b0a1894fa@citrix.com>

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


  reply	other threads:[~2020-07-26  8:26 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24 16:46 [PATCH 0/6] IOMMU cleanup Paul Durrant
2020-07-24 16:46 ` [PATCH 1/6] x86/iommu: re-arrange arch_iommu to separate common fields Paul Durrant
2020-07-24 17:29   ` Andrew Cooper
2020-07-24 18:49     ` Paul Durrant
2020-07-26  8:13       ` Jan Beulich
2020-07-27  9:30         ` Durrant, Paul
2020-07-24 16:46 ` [PATCH 2/6] x86/iommu: add common page-table allocator Paul Durrant
2020-07-24 18:24   ` Andrew Cooper
2020-07-26  8:26     ` Jan Beulich [this message]
2020-07-27  9:37     ` Durrant, Paul
2020-07-27 19:41       ` Jan Beulich
2020-07-24 16:46 ` [PATCH 3/6] iommu: remove iommu_lookup_page() and the lookup_page() method Paul Durrant
2020-07-24 18:38   ` Andrew Cooper
2020-07-24 18:53     ` Paul Durrant
2020-07-26  8:27       ` Jan Beulich
2020-07-27  9:58         ` Durrant, Paul
2020-07-24 16:46 ` [PATCH 4/6] remove remaining uses of iommu_legacy_map/unmap Paul Durrant
2020-07-26  8:36   ` Jan Beulich
2020-07-29  8:12     ` Durrant, Paul
2020-07-24 16:46 ` [PATCH 5/6] iommu: remove the share_p2m operation Paul Durrant
2020-07-24 19:00   ` Andrew Cooper
2020-07-29  8:43     ` Durrant, Paul
2020-07-26  8:50   ` Jan Beulich
2020-07-29  8:45     ` Durrant, Paul
2020-07-24 16:46 ` [PATCH 6/6] iommu: stop calling IOMMU page tables 'p2m tables' Paul Durrant
2020-07-24 19:08   ` Andrew Cooper
2020-07-27 10:13     ` Durrant, Paul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=036e10b0-d0b3-0437-f9ac-82845fd0cbd2@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=kevin.tian@intel.com \
    --cc=paul@xen.org \
    --cc=pdurrant@amazon.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).