> [ ... 16 lines skipped ... ]
> index 3be2451e7bc857..6404f4fbeae817 100644
> --- a/arch/x86/include/asm/iommu.h
> +++ b/arch/x86/include/asm/iommu.h
> @@ -4,6 +4,11 @@
>
> #include <linux/acpi.h>
>
> +#ifdef CONFIG_IOMMU_API
> +#include <linux/iommu.h>
> +#include <linux/sizes.h>
> +#endif
> +
> #include <asm/e820/api.h>
IDK if this header is the best place, nor do I have a better option,
but the overall idea is sound
>
> extern int force_iommu, no_iommu;
> @@ -21,6 +26,15 @@ extern bool x86_swiotlb_enable;
> /* 10 seconds */
> #define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000)
>
> +#ifdef CONFIG_IOMMU_API
> +static inline struct iommu_resv_region *
> +iommu_alloc_resv_x86_msi_region(void)
> +{
> + return iommu_alloc_resv_region(0xfee00000, SZ_1M, 0,
> + IOMMU_RESV_MSI, GFP_KERNEL);
Though I think it would be better to include the list add tail here as
well.
Reviewed-by: Jason Gunthorpe <[email protected]>
--
Jason