IOMMU: generalize VT-d's tracking of mapped RMRR regions
authorJan Beulich <jbeulich@suse.com>
Wed, 25 Aug 2021 13:05:43 +0000 (15:05 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 25 Aug 2021 13:05:43 +0000 (15:05 +0200)
commitfe6da097d460ebcaa7158b6b3949a0d208cf3120
tree68fdd9310d6265404618b537903c884a8f4693aa
parent4a244516f6c438f62f4fae287e20628e931cb4ce
IOMMU: generalize VT-d's tracking of mapped RMRR regions

In order to re-use it elsewhere, move the logic to vendor independent
code and strip it of RMRR specifics.

Note that the prior "map" parameter gets folded into the new "p2ma" one
(which AMD IOMMU code will want to make use of), assigning alternative
meaning ("unmap") to p2m_access_x. Prepare set_identity_p2m_entry() and
p2m_get_iommu_flags() for getting passed access types other than
p2m_access_rw (in the latter case just for p2m_mmio_direct requests).

Note also that, to be on the safe side, an overlap check gets added to
the main loop of iommu_identity_mapping().

This is part of XSA-378.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
master commit: c0e19d7c6c42f0bfccccd96b4f7b03b5515e10fc
master date: 2021-08-25 14:15:57 +0200
xen/arch/x86/mm/p2m.c
xen/drivers/passthrough/vtd/iommu.c
xen/drivers/passthrough/x86/iommu.c
xen/include/asm-x86/iommu.h
xen/include/asm-x86/p2m.h