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

Re: [Xen-devel] IOMMU page-tables


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Thu, 18 Jul 2019 11:16:43 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mypJQDPP1yu5KGApW8KFN9n/0r2JBpoD9oYsnW1JXtk=; b=ZP0FD221P3Q4F8Pl/V4FjVJFBYCO4aRBLnX45SKO++7zHyIvkuvlI7WiG95WrtrOGLBYsUk8kjSE2jMKIWCaumMZgxWvFOMvEwalWXBGEpBQbMKvJXcAvvpjRmlA4ls5hbmQKwOEiZBM7FMiQvFy9rpOLHOH9F8FGHJZqZZS3qjOv9auTdJpSM9r5Rini9Ab78WaibXPK0EPmiQZJr+TgW/gFr0JROIkG4cnXLILQnC6hPgGKCUGiK9GoGhYrB+0zUAY54xD8ZlXQWyBgVCWbAC7AJOfpx/c2D7e1z0U4dXHwLwbtX2nC2MLsbJDSmWhkWb9w7iNupuHzkhSsFse7Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SUCS2/70m0ZEXDX0eNQDBhthLH3DetLhvOdprhtd3d8mzosiYz8cLOuM/jiHTIyrySpDVteOu/xxNLiRChw/ku3yzmBsrSzGts4JfP+h2rnkFdTZvpYDCpJBPPdWPaCi5YzeaMA6LlDV1BJwOMlR0GHeCJtAkKsx8LNLXJSHQAD9VrfKlAGDVe4OhFLkFnKbXhymbsRIJYCHDrap1KsfVb/SzS3H8lFOlgtNVr35S34gipdmWMU+VFSwTvlMfPe7mzsUptdtQ42m3a809vNRpy6+lqxNj+M5HQPniMXB0dBrOFAiS8l594MPsAYjM+FhFVmx/mxEy/IY2sM3JjGlOw==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: "xen-devel\(xen-devel@xxxxxxxxxxxxxxxxxxxx\)" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Paul Durrant <Paul.Durrant@xxxxxxxxxx>
  • Delivery-date: Thu, 18 Jul 2019 11:17:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AdU9TCP6x7BzOdjWTRO+l3/aOrPvEAABW2v+AAIs9wA=
  • Thread-topic: [Xen-devel] IOMMU page-tables

On 18.07.2019 12:13, Andrew Cooper wrote:
> On 18/07/2019 10:49, Paul Durrant wrote:
>> Hi,
>>
>>    Before I get too far into this I want to get some opinions from the wider 
>> community...
>>
>>    At the moment when the first PCI device is assigned to a domain (i.e. 
>> passed through) this will trigger construction of IOMMU page tables for that 
>> domain. Similarly when the last PCI device is de-assigned the tables are 
>> torn down again. Both of these operations can be quite expensive if the 
>> domain is a large amount for RAM, and if the IOMMU does not support sharing 
>> the second level CPU page tables (or the domain is PV). Moreover, the guest 
>> could simultaneously be ballooning or doing other operations that affect its 
>> page types and so the process of building the tables has to take into 
>> account such races.
>>    If we were instead to say that giving a domain IOMMU page tables is an 
>> option that needs to be selected at domain create time then it makes the 
>> code significantly simpler and there is no need to deal with page type 
>> change/ballooning races any more. I hacked together a test patch and it gets 
>> rid of roughly 200 lines of code (and there may be more that I missed).
>>    Does anyone think that deciding whether a domain should get IOMMU page 
>> tables is not a reasonable thing to have to do at create time?
> 
> To be absolutely clear here, I don't see any evidence for the current
> behaviour to be a commonly used feature in practice.
> 
> If anyone has a counterexample, please speak up urgently.

I don't have a counterexample, nor am I outright opposed to the
suggested change. Nevertheless I'd like to point out that "just
in case" setting to IOMMU-enabled of a domain is a waste of
memory if no device ever gets assigned to it. And if there are
people relying on being able to attach a device on demand, then
they may be caught by surprise when they upgrade (and we all
know how much documentation people read when they think they
know what they're doing, which is to say: Adding a respective
note to the release notes is not very likely to help.).

> Furthermore, the complexity and (best-we-can-manage-security-wise)
> livelocks in the hypervisor/toolstack is justification alone to
> seriously consider dropping it moving forwards.  The complexity in
> particular is an impediment to several aspects of IOMMU development work
> which are in progress.
> 
> In particular, I do not see it as an unreasonable burden for
> admins/guests to specify whether they want an IOMMU at domain creation
> time.  I expect that the overwhelming majority of cases already know at
> creation time which PCI devices want assigning.
> 
> As far as I'm concerned, this feature/corner case wants ripping out.
> Whatever the original intention, hindsight has demonstrated that it
> really isn't clever idea.

FAOD - I agree with all the technical aspects here.

Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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