iommu/vt-d: Introduce helper functions to improve code readability