]> rtime.felk.cvut.cz Git - jailhouse.git/blob - configs/linux-x86-demo.c
jailhouse: inmates: bench: Add -R option -- repeats count.
[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         struct jailhouse_cache cache_regions[1];
25         __u8 pio_bitmap[0x2000];
26         struct jailhouse_pci_device pci_devices[1];
27 } __attribute__((packed)) config = {
28         .cell = {
29                 .signature = JAILHOUSE_CELL_DESC_SIGNATURE,
30                 .name = "linux-x86-demo",
31                 .flags = JAILHOUSE_CELL_PASSIVE_COMMREG,
32
33                 .cpu_set_size = sizeof(config.cpus),
34                 .num_memory_regions = ARRAY_SIZE(config.mem_regions),
35                 .num_cache_regions = ARRAY_SIZE(config.cache_regions),
36                 .num_irqchips = 0,
37                 .pio_bitmap_size = ARRAY_SIZE(config.pio_bitmap),
38                 .num_pci_devices = ARRAY_SIZE(config.pci_devices),
39                 .num_pci_caps = 0,
40         },
41
42         .cpus = {
43                 0xe,
44         },
45
46         .mem_regions = {
47                 /* low RAM */ {
48                         .phys_start = 0x3b600000,
49                         .virt_start = 0,
50                         .size = 0x00100000,
51                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
52                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA |
53                                 JAILHOUSE_MEM_LOADABLE,
54                 },
55                 /* communication region */ {
56                         .virt_start = 0x00100000,
57                         .size = 0x00001000,
58                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
59                                 JAILHOUSE_MEM_COMM_REGION,
60                 },
61                 /* high RAM */ {
62                         .phys_start = 0x3b700000,
63                         .virt_start = 0x00200000,
64                         .size = 0x3aff000,
65                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
66                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA |
67                                 JAILHOUSE_MEM_LOADABLE,
68                 },
69                 /* IVSHMEM shared memory region */
70                 {
71                         .phys_start = 0x3f1ff000,
72                         .virt_start = 0x3f1ff000,
73                         .size = 0x1000,
74                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
75                                 JAILHOUSE_MEM_ROOTSHARED,
76                 },
77         },
78
79         .cache_regions = {
80                 {
81                         .start = 0,
82                         .size = 2,
83                         .type = JAILHOUSE_CACHE_L3,
84                 },
85         },
86
87         .pio_bitmap = {
88                 [     0/8 ...  0x3f7/8] = -1,
89                 [ 0x3f8/8 ...  0x3ff/8] = 0, /* serial1 */
90                 [ 0x400/8 ... 0xe00f/8] = -1,
91                 [0xe010/8 ... 0xe017/8] = 0, /* OXPCIe952 serial1 */
92                 [0xe018/8 ... 0xffff/8] = -1,
93         },
94
95         .pci_devices = {
96                 {
97                         .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
98                         .domain = 0x0,
99                         .bdf = (0x0f<<3),
100                         .bar_mask = {
101                                 0xffffff00, 0xffffffff, 0x00000000,
102                                 0x00000000, 0xffffffe0, 0xffffffff,
103                         },
104                         .shmem_region = 3,
105                         .num_msix_vectors = 1,
106                 },
107         },
108 };