]> rtime.felk.cvut.cz Git - jailhouse.git/blob - configs/ivshmem-demo.c
jailhouse: configs: Add the novaboot root cell config. It was generated using jailhou...
[jailhouse.git] / configs / ivshmem-demo.c
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Copyright (c) Siemens AG, 2013, 2014
5  *
6  * Authors:
7  *  Henning Schild <henning.schild@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 #include <linux/types.h>
14 #include <jailhouse/cell-config.h>
15
16 #define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0])
17
18 struct {
19         struct jailhouse_cell_desc cell;
20         __u64 cpus[1];
21         struct jailhouse_memory mem_regions[3];
22         __u8 pio_bitmap[0x2000];
23         struct jailhouse_pci_device pci_devices[1];
24         struct jailhouse_pci_capability pci_caps[0];
25 } __attribute__((packed)) config = {
26         .cell = {
27                 .signature = JAILHOUSE_CELL_DESC_SIGNATURE,
28                 .name = "ivshmem-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 = ARRAY_SIZE(config.pci_caps),
37         },
38
39         .cpus = {
40                 0b0100,
41         },
42
43         .mem_regions = {
44                 /* RAM */ {
45                         .phys_start = 0x3f000000,
46                         .virt_start = 0,
47                         .size = 0x00100000,
48                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
49                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_LOADABLE,
50                 },
51                 /* communication region */ {
52                         .virt_start = 0x00100000,
53                         .size = 0x00001000,
54                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
55                                 JAILHOUSE_MEM_COMM_REGION,
56                 },
57                 /* IVSHMEM shared memory region */
58                 {
59                         .phys_start = 0x3f1ff000,
60                         .virt_start = 0x3f1ff000,
61                         .size = 0x1000,
62                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
63                                 JAILHOUSE_MEM_ROOTSHARED,
64                 },
65         },
66
67         .pio_bitmap = {
68                 [     0/8 ...  0x3f7/8] = -1,
69                 [ 0x3f8/8 ...  0x3ff/8] = 0, /* serial1 */
70                 [ 0x400/8 ... 0xffff/8] = -1,
71         },
72
73         .pci_devices = {
74                 {
75                         .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
76                         .domain = 0x0,
77                         .bdf = (0x0f<<3),
78                         .bar_mask = {
79                                 0xffffff00, 0xffffffff, 0x00000000,
80                                 0x00000000, 0xffffffe0, 0xffffffff,
81                         },
82                         .shmem_region = 2,
83                         .num_msix_vectors = 1,
84                 },
85         },
86 };