iommu.h 935 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_X86_IOMMU_H
  3. #define _ASM_X86_IOMMU_H
  4. #include <linux/acpi.h>
  5. #include <asm/e820/api.h>
  6. extern int force_iommu, no_iommu;
  7. extern int iommu_detected;
  8. extern int iommu_merge;
  9. extern int panic_on_overflow;
  10. #ifdef CONFIG_SWIOTLB
  11. extern bool x86_swiotlb_enable;
  12. #else
  13. #define x86_swiotlb_enable false
  14. #endif
  15. /* 10 seconds */
  16. #define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000)
  17. static inline int __init
  18. arch_rmrr_sanity_check(struct acpi_dmar_reserved_memory *rmrr)
  19. {
  20. u64 start = rmrr->base_address;
  21. u64 end = rmrr->end_address + 1;
  22. int entry_type;
  23. entry_type = e820__get_entry_type(start, end);
  24. if (entry_type == E820_TYPE_RESERVED || entry_type == E820_TYPE_NVS)
  25. return 0;
  26. pr_err(FW_BUG "No firmware reserved region can cover this RMRR [%#018Lx-%#018Lx], contact BIOS vendor for fixes\n",
  27. start, end - 1);
  28. return -EINVAL;
  29. }
  30. #endif /* _ASM_X86_IOMMU_H */