2 * Jailhouse, a Linux-based partitioning hypervisor
4 * Copyright (c) Siemens AG, 2013-2015
7 * Jan Kiszka <jan.kiszka@siemens.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
13 #ifndef _JAILHOUSE_CELL_H
14 #define _JAILHOUSE_CELL_H
16 #include <jailhouse/mmio.h>
17 #include <jailhouse/paging.h>
18 #include <jailhouse/pci.h>
20 #include <asm/spinlock.h>
22 #include <jailhouse/cell-config.h>
23 #include <jailhouse/hypercall.h>
25 /** Cell-related states. */
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). */
35 /** Architecture-specific fields. */
36 struct arch_cell arch;
38 /** ID of the cell. */
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;
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;
51 /** True while the cell can be loaded by the root cell. */
54 /** Pointer to next cell in the system. */
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;
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;
75 extern struct cell root_cell;
77 #endif /* !_JAILHOUSE_CELL_H */