blob: bf1ed2ddc74bd605408eaea6ffc9ab27b765bdfd [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_X86_IOMMU_H
3#define _ASM_X86_IOMMU_H
4
Olivier Deprez157378f2022-04-04 15:47:50 +02005#include <linux/acpi.h>
6
7#include <asm/e820/api.h>
8
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00009extern int force_iommu, no_iommu;
10extern int iommu_detected;
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000011
12/* 10 seconds */
13#define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000)
14
Olivier Deprez157378f2022-04-04 15:47:50 +020015static inline int __init
16arch_rmrr_sanity_check(struct acpi_dmar_reserved_memory *rmrr)
17{
18 u64 start = rmrr->base_address;
19 u64 end = rmrr->end_address + 1;
20
21 if (e820__mapped_all(start, end, E820_TYPE_RESERVED))
22 return 0;
23
24 pr_err(FW_BUG "No firmware reserved region can cover this RMRR [%#018Lx-%#018Lx], contact BIOS vendor for fixes\n",
25 start, end - 1);
26 return -EINVAL;
27}
28
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000029#endif /* _ASM_X86_IOMMU_H */