]> rtime.felk.cvut.cz Git - jailhouse.git/blob - hypervisor/arch/x86/include/asm/iommu.h
x86: Factor out iommu_select_fault_reporting_cpu
[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 extern unsigned int fault_reporting_cpu_id;
25
26 unsigned int iommu_count_units(void);
27 unsigned int iommu_mmio_count_regions(struct cell *cell);
28
29 int iommu_init(void);
30
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);
38
39 struct apic_irq_message iommu_get_remapped_root_int(unsigned int iommu,
40                                                     u16 device_id,
41                                                     unsigned int vector,
42                                                     unsigned int remap_index);
43 int iommu_map_interrupt(struct cell *cell,
44                         u16 device_id,
45                         unsigned int vector,
46                         struct apic_irq_message irq_msg);
47
48 void iommu_cell_exit(struct cell *cell);
49
50 void iommu_config_commit(struct cell *cell_added_removed);
51
52 void iommu_shutdown(void);
53
54 struct per_cpu *iommu_select_fault_reporting_cpu(void);
55 void iommu_check_pending_faults(void);
56
57 bool iommu_cell_emulates_ir(struct cell *cell);
58
59 #endif