x86/vtd: fix iommu_share_p2m_table
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 9 Oct 2018 14:27:13 +0000 (16:27 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 9 Oct 2018 14:27:13 +0000 (16:27 +0200)
commite9be34be5f9a1a6ecbf05ba9502cd705ae441476
tree7c1134ef58a1aebed16456253645fbbe74d7a61f
parent5e04bf333b954fcfd86eda3d258dc69bcf0586a3
x86/vtd: fix iommu_share_p2m_table

Commit 2916951c1 "mm / iommu: include need_iommu() test in
iommu_use_hap_pt()" changed the check in iommu_share_p2m_table to use
need_iommu(d) (as part of iommu_use_hap_pt) instead of iommu_enabled,
which broke the check because at the point in domain construction
where iommu_share_p2m_table is called need_iommu(d) will always return
false.

Fix this by reverting to the previous logic.

While there turn the hap_enabled check into an ASSERT, since the only
caller of iommu_share_p2m_table already performs the hap_enabled check
before calling the function.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/passthrough/iommu.c