hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/arch/x86/include/asm/iommu.h
....@@ -2,11 +2,30 @@
22 #ifndef _ASM_X86_IOMMU_H
33 #define _ASM_X86_IOMMU_H
44
5
+#include <linux/acpi.h>
6
+
7
+#include <asm/e820/api.h>
8
+
59 extern int force_iommu, no_iommu;
610 extern int iommu_detected;
7
-extern int iommu_pass_through;
811
912 /* 10 seconds */
1013 #define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000)
1114
15
+static inline int __init
16
+arch_rmrr_sanity_check(struct acpi_dmar_reserved_memory *rmrr)
17
+{
18
+ u64 start = rmrr->base_address;
19
+ u64 end = rmrr->end_address + 1;
20
+ int entry_type;
21
+
22
+ entry_type = e820__get_entry_type(start, end);
23
+ if (entry_type == E820_TYPE_RESERVED || entry_type == E820_TYPE_NVS)
24
+ return 0;
25
+
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
+
1231 #endif /* _ASM_X86_IOMMU_H */