Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ASM_X86_IOMMU_H
0003 #define _ASM_X86_IOMMU_H
0004 
0005 #include <linux/acpi.h>
0006 
0007 #include <asm/e820/api.h>
0008 
0009 extern int force_iommu, no_iommu;
0010 extern int iommu_detected;
0011 extern int iommu_merge;
0012 extern int panic_on_overflow;
0013 
0014 #ifdef CONFIG_SWIOTLB
0015 extern bool x86_swiotlb_enable;
0016 #else
0017 #define x86_swiotlb_enable false
0018 #endif
0019 
0020 /* 10 seconds */
0021 #define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000)
0022 
0023 static inline int __init
0024 arch_rmrr_sanity_check(struct acpi_dmar_reserved_memory *rmrr)
0025 {
0026     u64 start = rmrr->base_address;
0027     u64 end = rmrr->end_address + 1;
0028 
0029     if (e820__mapped_all(start, end, E820_TYPE_RESERVED))
0030         return 0;
0031 
0032     pr_err(FW_BUG "No firmware reserved region can cover this RMRR [%#018Lx-%#018Lx], contact BIOS vendor for fixes\n",
0033            start, end - 1);
0034     return -EINVAL;
0035 }
0036 
0037 #endif /* _ASM_X86_IOMMU_H */