]> rtime.felk.cvut.cz Git - jailhouse.git/blob - hypervisor/arch/x86/include/asm/cell.h
x86: Document cell structure
[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  *
6  * Authors:
7  *  Jan Kiszka <jan.kiszka@siemens.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_CELL_H
14 #define _JAILHOUSE_ASM_CELL_H
15
16 #include <jailhouse/paging.h>
17
18 #include <jailhouse/cell-config.h>
19 #include <jailhouse/hypercall.h>
20
21 struct pci_device;
22
23 /** Cell-related states. */
24 /* TODO: factor out arch-independent bits, define struct arch_cell */
25 struct cell {
26         struct {
27                 /** PIO access bitmap. */
28                 /* should be first as it requires page alignment */
29                 u8 __attribute__((aligned(PAGE_SIZE))) io_bitmap[2*PAGE_SIZE];
30                 /** Paging structures used for cell CPUs. */
31                 struct paging_structures ept_structs;
32         } vmx; /**< Intel VMX-specific fields. */
33
34         struct {
35                 /** Paging structures used for DMA requests. */
36                 struct paging_structures pg_structs;
37                 /** True if interrupt remapping support is emulated for this
38                  * cell. */
39                 bool ir_emulation;
40         } vtd; /**< Inte VT-d specific fields. */
41
42         /** ID of the cell. */
43         unsigned int id;
44         /** Number of pages used for storing cell-specific states and
45          * configuration data. */
46         unsigned int data_pages;
47         /** Pointer to static cell description. */
48         struct jailhouse_cell_desc *config;
49
50         /** Pointer to cell's CPU set. */
51         struct cpu_set *cpu_set;
52         /** Stores the cell's CPU set if small enough. */
53         struct cpu_set small_cpu_set;
54
55         /** True while the cell can be loaded by the root cell. */
56         bool loadable;
57
58         /** Pointer to next cell in the system. */
59         struct cell *next;
60
61         /** List of PCI devices assigned to this cell. */
62         struct pci_device *pci_devices;
63         /** List of PCI devices assigned to this cell that support MSI-X. */
64         struct pci_device *msix_device_list;
65         /** Shadow value of PCI config space address port register. */
66         u32 pci_addr_port_val;
67
68         /** Shadow value of IOAPIC index register. */
69         u32 ioapic_index_reg_val;
70         /** IOAPIC ID as used for interrupt remapping. */
71         u16 ioapic_id;
72         /** IOMMU unit responsible for the IOAPIC. */
73         u8 ioapic_iommu;
74         /** Bitmap of IOAPIC pins assigned to this cell. */
75         u64 ioapic_pin_bitmap;
76
77         union {
78                 /** Communication region. */
79                 struct jailhouse_comm_region comm_region;
80                 /** Padding to full page size. */
81                 u8 padding[PAGE_SIZE];
82         } __attribute__((aligned(PAGE_SIZE))) comm_page;
83         /**< Page containing the communication region (shared with cell). */
84 };
85
86 extern struct cell root_cell;
87
88 #endif /* !_JAILHOUSE_ASM_CELL_H */