]> rtime.felk.cvut.cz Git - jailhouse.git/blob - hypervisor/arch/x86/include/asm/iommu.h
9cc4f738103d1ba4d7652baa3a391bcafcf9dfe2
[jailhouse.git] / hypervisor / arch / x86 / include / asm / iommu.h
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Copyright (c) Valentine Sinitsyn, 2014
5  *
6  * Authors:
7  *  Valentine Sinitsyn <valentine.sinitsyn@gmail.com>
8  *
9  * This work is licensed under the terms of the GNU GPL, version 2.  See
10  * the COPYING file in the top-level directory.
11  */
12
13 #ifndef _JAILHOUSE_ASM_IOMMU_H
14 #define _JAILHOUSE_ASM_IOMMU_H
15
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>
21 #include <asm/apic.h>
22 #include <asm/percpu.h>
23
24 unsigned int iommu_count_units(void);
25 unsigned int iommu_mmio_count_regions(struct cell *cell);
26
27 int iommu_init(void);
28
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);
36
37 struct apic_irq_message iommu_get_remapped_root_int(unsigned int iommu,
38                                                     u16 device_id,
39                                                     unsigned int vector,
40                                                     unsigned int remap_index);
41 int iommu_map_interrupt(struct cell *cell,
42                         u16 device_id,
43                         unsigned int vector,
44                         struct apic_irq_message irq_msg);
45
46 void iommu_cell_exit(struct cell *cell);
47
48 void iommu_config_commit(struct cell *cell_added_removed);
49
50 void iommu_shutdown(void);
51
52 void iommu_check_pending_faults(void);
53
54 bool iommu_cell_emulates_ir(struct cell *cell);
55
56 #endif