]> rtime.felk.cvut.cz Git - jailhouse.git/blob - configs/e1000-demo.c
jailhouse: inmates: bench: Add -R option -- repeats count.
[jailhouse.git] / configs / e1000-demo.c
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Minimal configuration for PCI demo inmate:
5  * 1 CPU, 1 MB RAM, 1 serial port, 1 Intel HDA PCI device
6  *
7  * Copyright (c) Siemens AG, 2014
8  *
9  * Authors:
10  *  Jan Kiszka <jan.kiszka@siemens.com>
11  *
12  * This work is licensed under the terms of the GNU GPL, version 2.  See
13  * the COPYING file in the top-level directory.
14  */
15
16 #include <linux/types.h>
17 #include <jailhouse/cell-config.h>
18
19 #define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0])
20
21 struct {
22         struct jailhouse_cell_desc cell;
23         __u64 cpus[1];
24         struct jailhouse_memory mem_regions[3];
25         __u8 pio_bitmap[0x2000];
26         struct jailhouse_pci_device pci_devices[1];
27         struct jailhouse_pci_capability pci_caps[1];
28 } __attribute__((packed)) config = {
29         .cell = {
30                 .signature = JAILHOUSE_CELL_DESC_SIGNATURE,
31                 .name = "e1000-demo",
32                 .flags = JAILHOUSE_CELL_PASSIVE_COMMREG,
33
34                 .cpu_set_size = sizeof(config.cpus),
35                 .num_memory_regions = ARRAY_SIZE(config.mem_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 = ARRAY_SIZE(config.pci_caps),
40         },
41
42         .cpus = {
43                 0x4,
44         },
45
46         .mem_regions = {
47                 /* RAM */ {
48                         .phys_start = 0x3f100000,
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                 /* e1000 BAR0 */ {
62                         .phys_start = 0xfebc0000,
63                         .virt_start = 0xfebc0000,
64                         .size = 0x00020000,
65                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
66                 },
67         },
68
69         .pio_bitmap = {
70                 [     0/8 ...  0x2f7/8] = -1,
71                 [ 0x2f8/8 ...  0x2ff/8] = 0, /* serial2 */
72                 [ 0x300/8 ... 0xbfff/8] = -1,
73                 [0xc000/8 ... 0xc03f/8] = 0, /* e1000 */
74                 [0xc040/8 ... 0xdfff/8] = -1,
75                 [0xe000/8 ... 0xe007/8] = 0, /* OXPCIe952 serial2 */
76                 [0xe008/8 ... 0xffff/8] = -1,
77         },
78
79         .pci_devices = {
80                 { /* Intel e1000 @00:19.0 */
81                         .type = JAILHOUSE_PCI_TYPE_DEVICE,
82                         .domain = 0x0000,
83                         .bdf = 0x00c8,
84                         .caps_start = 0,
85                         .num_caps = 1,
86                         .num_msi_vectors = 1,
87                         .msi_64bits = 1,
88                 },
89         },
90
91         .pci_caps = {
92                 { /* Intel e1000 @00:19.0 */
93                         .id = 0x5,
94                         .start = 0xd0,
95                         .len = 14,
96                         .flags = JAILHOUSE_PCICAPS_WRITE,
97                 },
98         },
99 };