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);
28 int iommu_cell_init(struct cell *cell);
29 int iommu_map_memory_region(struct cell *cell,
30 const struct jailhouse_memory *mem);
31 int iommu_unmap_memory_region(struct cell *cell,
32 const struct jailhouse_memory *mem);
33 int iommu_add_pci_device(struct cell *cell, struct pci_device *device);
34 void iommu_remove_pci_device(struct pci_device *device);
36 struct apic_irq_message iommu_get_remapped_root_int(unsigned int iommu,
39 unsigned int remap_index);
40 int iommu_map_interrupt(struct cell *cell,
43 struct apic_irq_message irq_msg);
45 void iommu_cell_exit(struct cell *cell);
47 void iommu_config_commit(struct cell *cell_added_removed);
49 void iommu_shutdown(void);
51 void iommu_check_pending_faults(void);
53 int iommu_mmio_access_handler(bool is_write, u64 addr, u32 *value);
55 bool iommu_cell_emulates_ir(struct cell *cell);