VT-d: fix add/remove ordering when RMRRs are in use
authorJan Beulich <jbeulich@suse.com>
Tue, 5 Apr 2022 12:16:10 +0000 (14:16 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Apr 2022 12:16:10 +0000 (14:16 +0200)
commit3221f270cf2eba0a22fd4f92319d664eacb92889
tree274d8785efddc22a5e60b1a5e9f81087167eaf6b
parent78a40f8b5dfa1a3aec43528663f39473d4429101
VT-d: fix add/remove ordering when RMRRs are in use

In the event that the RMRR mappings are essential for device operation,
they should be established before updating the device's context entry,
while they should be torn down only after the device's context entry was
successfully cleared.

Also switch to %pd in related log messages.

Fixes: fa88cfadf918 ("vt-d: Map RMRR in intel_iommu_add_device() if the device has RMRR")
Fixes: 8b99f4400b69 ("VT-d: fix RMRR related error handling")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/drivers/passthrough/vtd/iommu.c