]> rtime.felk.cvut.cz Git - jailhouse.git/blob - hypervisor/arch/x86/include/asm/cell.h
Merge remote-tracking branch 'kiszka/master'
[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 and IOMMU. */
40                         struct paging_structures npt_iommu_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         };
53
54         /** Shadow value of PCI config space address port register. */
55         u32 pci_addr_port_val;
56
57         /** List of IOAPICs assigned to this cell. */
58         struct cell_ioapic *ioapics;
59         /** Number of assigned IOAPICs. */
60         unsigned int num_ioapics;
61
62         /** Class Of Service for cache allocation (Intel only). */
63         u32 cos;
64         /** Allocated L3 cache region (Intel only). */
65         u64 cat_mask;
66 };
67
68 #endif /* !_JAILHOUSE_ASM_CELL_H */