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 extern unsigned int fault_reporting_cpu_id;
26 unsigned int iommu_count_units(void);
27 unsigned int iommu_mmio_count_regions(struct cell *cell);
31 int iommu_cell_init(struct cell *cell);
32 int iommu_map_memory_region(struct cell *cell,
33 const struct jailhouse_memory *mem);
34 int iommu_unmap_memory_region(struct cell *cell,
35 const struct jailhouse_memory *mem);
36 int iommu_add_pci_device(struct cell *cell, struct pci_device *device);
37 void iommu_remove_pci_device(struct pci_device *device);
39 struct apic_irq_message iommu_get_remapped_root_int(unsigned int iommu,
42 unsigned int remap_index);
43 int iommu_map_interrupt(struct cell *cell,
46 struct apic_irq_message irq_msg);
48 void iommu_cell_exit(struct cell *cell);
50 void iommu_config_commit(struct cell *cell_added_removed);
52 void iommu_shutdown(void);
54 struct per_cpu *iommu_select_fault_reporting_cpu(void);
55 void iommu_check_pending_faults(void);
57 bool iommu_cell_emulates_ir(struct cell *cell);