]> rtime.felk.cvut.cz Git - jailhouse.git/blob - hypervisor/arch/x86/include/asm/cell.h
a07072970c36b0db12cba2d257d6be0ff718e323
[jailhouse.git] / hypervisor / arch / x86 / include / asm / cell.h
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Copyright (c) Siemens AG, 2013
5  * Copyright (c) Valentine Sinitsyn, 2014
6  *
7  * Authors:
8  *  Jan Kiszka <jan.kiszka@siemens.com>
9  *  Valentine Sinitsyn <valentine.sinitsyn@gmail.com>
10  *
11  * This work is licensed under the terms of the GNU GPL, version 2.  See
12  * the COPYING file in the top-level directory.
13  */
14
15 #ifndef _JAILHOUSE_ASM_CELL_H
16 #define _JAILHOUSE_ASM_CELL_H
17
18 #include <jailhouse/paging.h>
19
20 #include <jailhouse/cell-config.h>
21
22 struct cell_ioapic;
23
24 /** x86-specific cell states. */
25 struct arch_cell {
26         /** Buffer for the EPT/NPT root-level page table. */
27         u8 __attribute__((aligned(PAGE_SIZE))) root_table_page[PAGE_SIZE];
28
29         union {
30                 struct {
31                         /** PIO access bitmap. */
32                         u8 *io_bitmap;
33                         /** Paging structures used for cell CPUs. */
34                         struct paging_structures ept_structs;
35                 } vmx; /**< Intel VMX-specific fields. */
36                 struct {
37                         /** I/O Permissions Map. */
38                         u8 *iopm;
39                         /** Paging structures used for cell CPUs. */
40                         struct paging_structures npt_structs;
41                 } svm; /**< AMD SVM-specific fields. */
42         };
43
44         union {
45                 struct {
46                         /** Paging structures used for DMA requests. */
47                         struct paging_structures pg_structs;
48                         /** True if interrupt remapping support is emulated for this
49                          * cell. */
50                         bool ir_emulation;
51                 } vtd; /**< Intel VT-d specific fields. */
52                 struct {
53                         /** Paging structures used for DMA requests. */
54                         struct paging_structures pg_structs;
55                 } amd_iommu; /**< AMD IOMMU specific fields. */
56         };
57
58         /** Shadow value of PCI config space address port register. */
59         u32 pci_addr_port_val;
60
61         /** List of IOAPICs assigned to this cell. */
62         struct cell_ioapic *ioapics;
63         /** Number of assigned IOAPICs. */
64         unsigned int num_ioapics;
65
66         /** Class Of Service for cache allocation (Intel only). */
67         u32 cos;
68         /** Allocated L3 cache region (Intel only). */
69         u64 cat_mask;
70 };
71
72 #endif /* !_JAILHOUSE_ASM_CELL_H */