2 * Jailhouse, a Linux-based partitioning hypervisor
4 * Copyright (c) Siemens AG, 2013
5 * Copyright (c) Valentine Sinitsyn, 2014
8 * Jan Kiszka <jan.kiszka@siemens.com>
9 * Valentine Sinitsyn <valentine.sinitsyn@gmail.com>
11 * This work is licensed under the terms of the GNU GPL, version 2. See
12 * the COPYING file in the top-level directory.
15 #ifndef _JAILHOUSE_ASM_CELL_H
16 #define _JAILHOUSE_ASM_CELL_H
18 #include <jailhouse/paging.h>
20 #include <jailhouse/cell-config.h>
21 #include <jailhouse/hypercall.h>
25 /** Cell-related states. */
26 /* TODO: factor out arch-independent bits, define struct arch_cell */
30 /** PIO access bitmap. */
32 /** Paging structures used for cell CPUs. */
33 struct paging_structures ept_structs;
34 } vmx; /**< Intel VMX-specific fields. */
36 /** I/O Permissions Map. */
38 /** Paging structures used for cell CPUs. */
39 struct paging_structures npt_structs;
40 } svm; /**< AMD SVM-specific fields. */
45 /** Paging structures used for DMA requests. */
46 struct paging_structures pg_structs;
47 /** True if interrupt remapping support is emulated for this
50 } vtd; /**< Intel VT-d specific fields. */
51 /* TODO: No struct vtd equivalent for SVM code yet. */
54 /** ID of the cell. */
56 /** Number of pages used for storing cell-specific states and
57 * configuration data. */
58 unsigned int data_pages;
59 /** Pointer to static cell description. */
60 struct jailhouse_cell_desc *config;
62 /** Pointer to cell's CPU set. */
63 struct cpu_set *cpu_set;
64 /** Stores the cell's CPU set if small enough. */
65 struct cpu_set small_cpu_set;
67 /** True while the cell can be loaded by the root cell. */
70 /** Pointer to next cell in the system. */
73 /** List of PCI devices assigned to this cell. */
74 struct pci_device *pci_devices;
75 /** List of PCI devices assigned to this cell that support MSI-X. */
76 struct pci_device *msix_device_list;
77 /** Shadow value of PCI config space address port register. */
78 u32 pci_addr_port_val;
80 /** Shadow value of IOAPIC index register. */
81 u32 ioapic_index_reg_val;
82 /** IOAPIC ID as used for interrupt remapping. */
84 /** IOMMU unit responsible for the IOAPIC. */
86 /** Bitmap of IOAPIC pins assigned to this cell. */
87 u64 ioapic_pin_bitmap;
90 /** Communication region. */
91 struct jailhouse_comm_region comm_region;
92 /** Padding to full page size. */
93 u8 padding[PAGE_SIZE];
94 } __attribute__((aligned(PAGE_SIZE))) comm_page;
95 /**< Page containing the communication region (shared with cell). */
98 extern struct cell root_cell;
100 #endif /* !_JAILHOUSE_ASM_CELL_H */