]> rtime.felk.cvut.cz Git - jailhouse.git/blob - configs/linux-x86-demo.c
ffb7765693524fd69cea43f8e4d8911c8b6b7ccb
[jailhouse.git] / configs / linux-x86-demo.c
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Configuration for linux inmate, 1 CPU, ~60 MB RAM, 1 serial port
5  *
6  * Copyright (c) Siemens AG, 2013-2015
7  *
8  * Authors:
9  *  Jan Kiszka <jan.kiszka@siemens.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 #include <linux/types.h>
16 #include <jailhouse/cell-config.h>
17
18 #define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0])
19
20 struct {
21         struct jailhouse_cell_desc cell;
22         __u64 cpus[1];
23         struct jailhouse_memory mem_regions[4];
24         __u8 pio_bitmap[0x2000];
25         struct jailhouse_pci_device pci_devices[1];
26 } __attribute__((packed)) config = {
27         .cell = {
28                 .name = "linux-x86-demo",
29                 .flags = JAILHOUSE_CELL_PASSIVE_COMMREG,
30
31                 .cpu_set_size = sizeof(config.cpus),
32                 .num_memory_regions = ARRAY_SIZE(config.mem_regions),
33                 .num_irqchips = 0,
34                 .pio_bitmap_size = ARRAY_SIZE(config.pio_bitmap),
35                 .num_pci_devices = ARRAY_SIZE(config.pci_devices),
36                 .num_pci_caps = 0,
37         },
38
39         .cpus = {
40                 0xe,
41         },
42
43         .mem_regions = {
44                 /* low RAM */ {
45                         .phys_start = 0x3b600000,
46                         .virt_start = 0,
47                         .size = 0x00100000,
48                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
49                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA |
50                                 JAILHOUSE_MEM_LOADABLE,
51                 },
52                 /* communication region */ {
53                         .virt_start = 0x00100000,
54                         .size = 0x00001000,
55                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
56                                 JAILHOUSE_MEM_COMM_REGION,
57                 },
58                 /* high RAM */ {
59                         .phys_start = 0x3b700000,
60                         .virt_start = 0x00200000,
61                         .size = 0x3aff000,
62                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
63                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA |
64                                 JAILHOUSE_MEM_LOADABLE,
65                 },
66                 /* IVSHMEM shared memory region */
67                 {
68                         .phys_start = 0x3f1ff000,
69                         .virt_start = 0x3f1ff000,
70                         .size = 0x1000,
71                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
72                                 JAILHOUSE_MEM_ROOTSHARED,
73                 },
74         },
75
76         .pio_bitmap = {
77                 [     0/8 ...  0x3f7/8] = -1,
78                 [ 0x3f8/8 ...  0x3ff/8] = 0, /* serial1 */
79                 [ 0x400/8 ... 0xe00f/8] = -1,
80                 [0xe010/8 ... 0xe017/8] = 0, /* OXPCIe952 serial1 */
81                 [0xe018/8 ... 0xffff/8] = -1,
82         },
83
84         .pci_devices = {
85                 {
86                         .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
87                         .domain = 0x0,
88                         .bdf = (0x0f<<3),
89                         .bar_mask = {
90                                 0xffffff00, 0xffffffff, 0x00000000,
91                                 0x00000000, 0xffffffe0, 0xffffffff,
92                         },
93                         .shmem_region = 3,
94                         .num_msix_vectors = 1,
95                 },
96         },
97 };