VT-d: introduce helper to convert DID to domid_t
authorJan Beulich <jbeulich@suse.com>
Fri, 3 Dec 2021 10:34:24 +0000 (11:34 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 3 Dec 2021 10:34:24 +0000 (11:34 +0100)
commitd159edac73cf887fc899326edddd00133c1d206c
treeec2d3bb75446c206cd30b1efa029cd1157f25942
parentbbcea43d830bdc85bf5a6c1b6b8041bd2b607454
VT-d: introduce helper to convert DID to domid_t

This is in preparation of adding another "translation" method. Take the
combination of the extra validation both previously open-coded have been
doing: Bounds check and bitmap check. But don't propagate the previous
pointless check of whether ->domid_map[] was actually allocated, as
failure there would lead to overall failure of IOMMU initialization
anyway.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/drivers/passthrough/vtd/extern.h
xen/drivers/passthrough/vtd/iommu.c
xen/drivers/passthrough/vtd/qinval.c