IOMMU: always call teardown callback

There is a possible scenario when (d)->need_iommu remains unset
during guest domain execution. For example, when no devices
were assigned to it. Taking into account that teardown callback
is not called when (d)->need_iommu is unset we might have unreleased
resourses after destroying domain.

So, always call teardown callback to roll back actions
that were performed in init callback.

This is XSA-207.

Signed-off-by: Oleksandr Tyshchenko <olekstysh@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Julien Grall <julien.grall@arm.com>
This commit is contained in:
Oleksandr Tyshchenko authored and Andrew Cooper committed 2017-02-15 12:21:10 +00:00
1 parent 394ddc2de6
commit b648113f8a
1 file changed
+1 -2
+1 -2
View File
@@ -418,8 +418,7 @@ void iommu_domain_destroy(struct domain *d)
if ( !iommu_enabled || !hd->platform_ops )
return;
if ( need_iommu(d) )
iommu_teardown(d);
iommu_teardown(d);
list_for_each_safe ( ioport_list, tmp, &hd->g2m_ioport_list )
{
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.