<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/drivers/iommu/intel-iommu.c, branch dev</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2015-07-23T12:17:39+00:00</updated>
<entry>
<title>iommu/vt-d: Fix VM domain ID leak</title>
<updated>2015-07-23T12:17:39+00:00</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2015-07-14T20:48:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=46ebb7af7b93792de65e124e1ab8b89a108a41f2'/>
<id>urn:sha1:46ebb7af7b93792de65e124e1ab8b89a108a41f2</id>
<content type='text'>
This continues the attempt to fix commit fb170fb4c548 ("iommu/vt-d:
Introduce helper functions to make code symmetric for readability").
The previous attempt in commit 71684406905f ("iommu/vt-d: Detach
domain *only* from attached iommus") overlooked the fact that
dmar_domain.iommu_bmp gets cleared for VM domains when devices are
detached:

intel_iommu_detach_device
  domain_remove_one_dev_info
    domain_detach_iommu

The domain is detached from the iommu, but the iommu is still attached
to the domain, for whatever reason.  Thus when we get to domain_exit(),
we can't rely on iommu_bmp for VM domains to find the active iommus,
we must check them all.  Without that, the corresponding bit in
intel_iommu.domain_ids doesn't get cleared and repeated VM domain
creation and destruction will run out of domain IDs.  Meanwhile we
still can't call iommu_detach_domain() on arbitrary non-VM domains or
we risk clearing in-use domain IDs, as 71684406905f attempted to
address.

It's tempting to modify iommu_detach_domain() to test the domain
iommu_bmp, but the call ordering from domain_remove_one_dev_info()
prevents it being able to work as fb170fb4c548 seems to have intended.
Caching of unused VM domains on the iommu object seems to be the root
of the problem, but this code is far too fragile for that kind of
rework to be proposed for stable, so we simply revert this chunk to
its state prior to fb170fb4c548.

Fixes: fb170fb4c548 ("iommu/vt-d: Introduce helper functions to make
                      code symmetric for readability")
Fixes: 71684406905f ("iommu/vt-d: Detach domain *only* from attached
                      iommus")
Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Cc: Jiang Liu &lt;jiang.liu@linux.intel.com&gt;
Cc: stable@vger.kernel.org # v3.17+
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
<entry>
<title>iommu/vt-d: Enable Translation only if it was previously disabled</title>
<updated>2015-06-16T08:59:35+00:00</updated>
<author>
<name>Joerg Roedel</name>
<email>jroedel@suse.de</email>
</author>
<published>2015-06-12T12:40:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=8939ddf6d65264cf9f014ffd7c9bff02ad9626e6'/>
<id>urn:sha1:8939ddf6d65264cf9f014ffd7c9bff02ad9626e6</id>
<content type='text'>
Do not touch the TE bit unless we know translation is
disabled.

Tested-by: ZhenHua Li &lt;zhen-hual@hp.com&gt;
Tested-by: Baoquan He &lt;bhe@redhat.com&gt;
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
<entry>
<title>iommu/vt-d: Don't disable translation prior to OS handover</title>
<updated>2015-06-16T08:59:35+00:00</updated>
<author>
<name>Joerg Roedel</name>
<email>jroedel@suse.de</email>
</author>
<published>2015-06-12T10:44:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=60b523ecfede05796aa77024b3960fecabab4de7'/>
<id>urn:sha1:60b523ecfede05796aa77024b3960fecabab4de7</id>
<content type='text'>
For all the copy-translation code to run, we have to keep
translation enabled in intel_iommu_init(). So remove the
code disabling it.

Tested-by: ZhenHua Li &lt;zhen-hual@hp.com&gt;
Tested-by: Baoquan He &lt;bhe@redhat.com&gt;
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
<entry>
<title>iommu/vt-d: Don't copy translation tables if RTT bit needs to be changed</title>
<updated>2015-06-16T08:59:35+00:00</updated>
<author>
<name>Joerg Roedel</name>
<email>jroedel@suse.de</email>
</author>
<published>2015-06-12T10:39:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=c3361f2f6e1d64bc7e7b8148bbd1c66b8007a898'/>
<id>urn:sha1:c3361f2f6e1d64bc7e7b8148bbd1c66b8007a898</id>
<content type='text'>
We can't change the RTT bit when translation is enabled, so
don't copy translation tables when we would change the bit
with our new root entry.

Tested-by: ZhenHua Li &lt;zhen-hual@hp.com&gt;
Tested-by: Baoquan He &lt;bhe@redhat.com&gt;
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
<entry>
<title>iommu/vt-d: Don't do early domain assignment if kdump kernel</title>
<updated>2015-06-16T08:59:35+00:00</updated>
<author>
<name>Joerg Roedel</name>
<email>jroedel@suse.de</email>
</author>
<published>2015-06-12T10:32:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=a87f491890e994dca4bee64690d7e5183a19264e'/>
<id>urn:sha1:a87f491890e994dca4bee64690d7e5183a19264e</id>
<content type='text'>
When we copied over context tables from an old kernel, we
need to defer assignment of devices to domains until the
device driver takes over. So skip this part of
initialization when we copied over translation tables from
the old kernel.

Tested-by: ZhenHua Li &lt;zhen-hual@hp.com&gt;
Tested-by: Baoquan He &lt;bhe@redhat.com&gt;
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
<entry>
<title>iommu/vt-d: Allocate si_domain in init_dmars()</title>
<updated>2015-06-16T08:59:34+00:00</updated>
<author>
<name>Joerg Roedel</name>
<email>jroedel@suse.de</email>
</author>
<published>2015-06-12T10:27:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=86080ccc223aabf8d0b85a504f4f06aa88e82fb3'/>
<id>urn:sha1:86080ccc223aabf8d0b85a504f4f06aa88e82fb3</id>
<content type='text'>
This seperates the allocation of the si_domain from its
assignment to devices. It makes sure that the iommu=pt case
still works in the kdump kernel, when we have to defer the
assignment of devices to domains to device driver
initialization time.

Tested-by: ZhenHua Li &lt;zhen-hual@hp.com&gt;
Tested-by: Baoquan He &lt;bhe@redhat.com&gt;
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
<entry>
<title>iommu/vt-d: Mark copied context entries</title>
<updated>2015-06-16T08:59:34+00:00</updated>
<author>
<name>Joerg Roedel</name>
<email>jroedel@suse.de</email>
</author>
<published>2015-06-12T10:21:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=cf484d0e6939ce287e65880ffe48860165fe5cb5'/>
<id>urn:sha1:cf484d0e6939ce287e65880ffe48860165fe5cb5</id>
<content type='text'>
Mark the context entries we copied over from the old kernel,
so that we don't detect them as present in other code paths.
This makes sure we safely overwrite old context entries when
a new domain is assigned.

Tested-by: ZhenHua Li &lt;zhen-hual@hp.com&gt;
Tested-by: Baoquan He &lt;bhe@redhat.com&gt;
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
<entry>
<title>iommu/vt-d: Do not re-use domain-ids from the old kernel</title>
<updated>2015-06-16T08:59:34+00:00</updated>
<author>
<name>Joerg Roedel</name>
<email>jroedel@suse.de</email>
</author>
<published>2015-06-12T10:02:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=dbcd861f252d727ac856a3da2cba8a480a36ab2e'/>
<id>urn:sha1:dbcd861f252d727ac856a3da2cba8a480a36ab2e</id>
<content type='text'>
Mark all domain-ids we find as reserved, so that there could
be no collision between domains from the previous kernel and
our domains in the IOMMU TLB.

Tested-by: ZhenHua Li &lt;zhen-hual@hp.com&gt;
Tested-by: Baoquan He &lt;bhe@redhat.com&gt;
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
<entry>
<title>iommu/vt-d: Copy translation tables from old kernel</title>
<updated>2015-06-16T08:59:34+00:00</updated>
<author>
<name>Joerg Roedel</name>
<email>jroedel@suse.de</email>
</author>
<published>2015-06-12T09:56:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=091d42e43d21b6ca7ec39bf5f9e17bc0bd8d4312'/>
<id>urn:sha1:091d42e43d21b6ca7ec39bf5f9e17bc0bd8d4312</id>
<content type='text'>
If we are in a kdump kernel and find translation enabled in
the iommu, try to copy the translation tables from the old
kernel to preserve the mappings until the device driver
takes over.
This supports old and the extended root-entry and
context-table formats.

Tested-by: ZhenHua Li &lt;zhen-hual@hp.com&gt;
Tested-by: Baoquan He &lt;bhe@redhat.com&gt;
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
<entry>
<title>iommu/vt-d: Detect pre enabled translation</title>
<updated>2015-06-16T08:59:34+00:00</updated>
<author>
<name>Joerg Roedel</name>
<email>jroedel@suse.de</email>
</author>
<published>2015-06-12T08:14:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=4158c2eca3c77ed3cccdcaeab153aad4e433369c'/>
<id>urn:sha1:4158c2eca3c77ed3cccdcaeab153aad4e433369c</id>
<content type='text'>
Add code to detect whether translation is already enabled in
the IOMMU. Save this state in a flags field added to
struct intel_iommu.

Tested-by: ZhenHua Li &lt;zhen-hual@hp.com&gt;
Tested-by: Baoquan He &lt;bhe@redhat.com&gt;
Signed-off-by: Joerg Roedel &lt;jroedel@suse.de&gt;
</content>
</entry>
</feed>
