]> rtime.felk.cvut.cz Git - jailhouse.git/blob - hypervisor/include/jailhouse/cell.h
core: pci: Drop list of virtual devices
[jailhouse.git] / hypervisor / include / jailhouse / cell.h
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Copyright (c) Siemens AG, 2013-2015
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_CELL_H
14 #define _JAILHOUSE_CELL_H
15
16 #include <jailhouse/mmio.h>
17 #include <jailhouse/paging.h>
18 #include <jailhouse/pci.h>
19 #include <asm/cell.h>
20 #include <asm/spinlock.h>
21
22 #include <jailhouse/cell-config.h>
23 #include <jailhouse/hypercall.h>
24
25 /** Cell-related states. */
26 struct cell {
27         union {
28                 /** Communication region. */
29                 struct jailhouse_comm_region comm_region;
30                 /** Padding to full page size. */
31                 u8 padding[PAGE_SIZE];
32         } __attribute__((aligned(PAGE_SIZE))) comm_page;
33         /**< Page containing the communication region (shared with cell). */
34
35         /** Architecture-specific fields. */
36         struct arch_cell arch;
37
38         /** ID of the cell. */
39         unsigned int id;
40         /** Number of pages used for storing cell-specific states and
41          * configuration data. */
42         unsigned int data_pages;
43         /** Pointer to static cell description. */
44         struct jailhouse_cell_desc *config;
45
46         /** Pointer to cell's CPU set. */
47         struct cpu_set *cpu_set;
48         /** Stores the cell's CPU set if small enough. */
49         struct cpu_set small_cpu_set;
50
51         /** True while the cell can be loaded by the root cell. */
52         bool loadable;
53
54         /** Pointer to next cell in the system. */
55         struct cell *next;
56
57         /** List of PCI devices assigned to this cell. */
58         struct pci_device *pci_devices;
59         /** List of PCI devices assigned to this cell that support MSI-X. */
60         struct pci_device *msix_device_list;
61
62         /** Lock protecting changes to mmio_locations, mmio_handlers, and
63          * num_mmio_regions. */
64         spinlock_t mmio_region_lock;
65         /** MMIO region description table. */
66         struct mmio_region_location *mmio_locations;
67         /** MMIO region handler table. */
68         struct mmio_region_handler *mmio_handlers;
69         /** Number of MMIO regions in use. */
70         unsigned int num_mmio_regions;
71         /** Maximum number of MMIO regions. */
72         unsigned int max_mmio_regions;
73 };
74
75 extern struct cell root_cell;
76
77 #endif /* !_JAILHOUSE_CELL_H */