2 * Jailhouse, a Linux-based partitioning hypervisor
4 * Copyright (c) Valentine Sinitsyn, 2014
7 * Valentine Sinitsyn <valentine.sinitsyn@gmail.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
13 #ifndef _JAILHOUSE_ASM_IOMMU_H
14 #define _JAILHOUSE_ASM_IOMMU_H
16 #include <jailhouse/entry.h>
17 #include <jailhouse/cell.h>
18 #include <jailhouse/cell-config.h>
19 #include <jailhouse/pci.h>
20 #include <jailhouse/types.h>
22 #include <asm/percpu.h>
24 unsigned int iommu_count_units(void);
25 unsigned int iommu_mmio_count_regions(struct cell *cell);
29 int iommu_cell_init(struct cell *cell);
30 int iommu_map_memory_region(struct cell *cell,
31 const struct jailhouse_memory *mem);
32 int iommu_unmap_memory_region(struct cell *cell,
33 const struct jailhouse_memory *mem);
34 int iommu_add_pci_device(struct cell *cell, struct pci_device *device);
35 void iommu_remove_pci_device(struct pci_device *device);
37 struct apic_irq_message iommu_get_remapped_root_int(unsigned int iommu,
40 unsigned int remap_index);
41 int iommu_map_interrupt(struct cell *cell,
44 struct apic_irq_message irq_msg);
46 void iommu_cell_exit(struct cell *cell);
48 void iommu_config_commit(struct cell *cell_added_removed);
50 void iommu_shutdown(void);
52 void iommu_check_pending_faults(void);
54 bool iommu_cell_emulates_ir(struct cell *cell);