2 * Jailhouse, a Linux-based partitioning hypervisor
4 * Copyright (c) Valentine Sinitsyn, 2014, 2015
5 * Copyright (c) Siemens AG, 2016
8 * Valentine Sinitsyn <valentine.sinitsyn@gmail.com>
9 * Jan Kiszka <jan.kiszka@siemens.com>
11 * This work is licensed under the terms of the GNU GPL, version 2. See
12 * the COPYING file in the top-level directory.
15 #ifndef _JAILHOUSE_ASM_AMD_IOMMU_H
16 #define _JAILHOUSE_ASM_AMD_IOMMU_H
18 #include <jailhouse/types.h>
19 #include <jailhouse/utils.h>
21 #include <jailhouse/cell-config.h>
23 #define AMD_IOMMU_PTE_P (1ULL << 0)
24 #define AMD_IOMMU_PTE_PG_MODE(level) ((level) << 9)
25 #define AMD_IOMMU_PTE_PG_MODE_MASK BIT_MASK(11, 9)
26 #define AMD_IOMMU_PTE_IR (1ULL << 61)
27 #define AMD_IOMMU_PTE_IW (1ULL << 62)
29 #define AMD_IOMMU_PAGE_DEFAULT_FLAGS (AMD_IOMMU_PTE_IW | AMD_IOMMU_PTE_IR | \
32 u64 amd_iommu_get_memory_region_flags(const struct jailhouse_memory *mem);