These functions are basically wrappers of map_domain_page; move them to the shared extern.h and make them inline to help with code generation.
Signed-off-by: Teddy Astie <[email protected]> --- xen/drivers/passthrough/vtd/extern.h | 13 +++++++++++-- xen/drivers/passthrough/vtd/x86/vtd.c | 10 ---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h index c16583c951..a62310b3e7 100644 --- a/xen/drivers/passthrough/vtd/extern.h +++ b/xen/drivers/passthrough/vtd/extern.h @@ -21,6 +21,7 @@ #define DRIVERS__PASSTHROUGH__VTD__EXTERN_H #include "dmar.h" +#include <xen/domain_page.h> #include <xen/keyhandler.h> #define VTDPREFIX "[VT-D]" @@ -78,8 +79,6 @@ int __must_check qinval_device_iotlb_sync(struct vtd_iommu *iommu, uint64_t alloc_pgtable_maddr(unsigned long npages, nodeid_t node); void free_pgtable_maddr(u64 maddr); -void *map_vtd_domain_page(u64 maddr); -void unmap_vtd_domain_page(const void *va); int domain_context_mapping_one(struct domain *domain, struct vtd_iommu *iommu, uint8_t bus, uint8_t devfn, const struct pci_dev *pdev, domid_t domid, @@ -114,4 +113,14 @@ void quirk_iommu_caps(struct vtd_iommu *iommu); bool platform_supports_intremap(void); bool platform_supports_x2apic(void); +static inline void *map_vtd_domain_page(u64 maddr) +{ + return map_domain_page(_mfn(paddr_to_pfn(maddr))); +} + +static inline void unmap_vtd_domain_page(const void *va) +{ + unmap_domain_page(va); +} + #endif // DRIVERS__PASSTHROUGH__VTD__EXTERN_H diff --git a/xen/drivers/passthrough/vtd/x86/vtd.c b/xen/drivers/passthrough/vtd/x86/vtd.c index 76f12adc23..b0798dc6a1 100644 --- a/xen/drivers/passthrough/vtd/x86/vtd.c +++ b/xen/drivers/passthrough/vtd/x86/vtd.c @@ -36,13 +36,3 @@ * 1:1 iommu mappings except xen and unusable regions. */ boolean_param("iommu_inclusive_mapping", iommu_hwdom_inclusive); - -void *map_vtd_domain_page(u64 maddr) -{ - return map_domain_page(_mfn(paddr_to_pfn(maddr))); -} - -void unmap_vtd_domain_page(const void *va) -{ - unmap_domain_page(va); -} -- 2.51.1 -- Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech
