Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
1965aae3 PA |
2 | #ifndef _ASM_X86_IOMMU_H |
3 | #define _ASM_X86_IOMMU_H | |
f2cf8e08 | 4 | |
f036c7fa YC |
5 | #include <linux/acpi.h> |
6 | ||
7 | #include <asm/e820/api.h> | |
8 | ||
f2cf8e08 YL |
9 | extern int force_iommu, no_iommu; |
10 | extern int iommu_detected; | |
3cb4503a CH |
11 | extern int iommu_merge; |
12 | extern int panic_on_overflow; | |
04d65a9d | 13 | extern bool amd_iommu_snp_en; |
e93be88d | 14 | |
78013eaa CH |
15 | #ifdef CONFIG_SWIOTLB |
16 | extern bool x86_swiotlb_enable; | |
17 | #else | |
18 | #define x86_swiotlb_enable false | |
19 | #endif | |
20 | ||
5b6985ce FY |
21 | /* 10 seconds */ |
22 | #define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000) | |
23 | ||
f036c7fa YC |
24 | static inline int __init |
25 | arch_rmrr_sanity_check(struct acpi_dmar_reserved_memory *rmrr) | |
26 | { | |
27 | u64 start = rmrr->base_address; | |
28 | u64 end = rmrr->end_address + 1; | |
5566e68d | 29 | int entry_type; |
f036c7fa | 30 | |
5566e68d CT |
31 | entry_type = e820__get_entry_type(start, end); |
32 | if (entry_type == E820_TYPE_RESERVED || entry_type == E820_TYPE_NVS) | |
f036c7fa YC |
33 | return 0; |
34 | ||
35 | pr_err(FW_BUG "No firmware reserved region can cover this RMRR [%#018Lx-%#018Lx], contact BIOS vendor for fixes\n", | |
36 | start, end - 1); | |
37 | return -EINVAL; | |
38 | } | |
39 | ||
1965aae3 | 40 | #endif /* _ASM_X86_IOMMU_H */ |