]> rtime.felk.cvut.cz Git - jailhouse.git/blob - configs/apic-demo.c
046a7826cc50f6e9cadacdc1a9433e586bf11072
[jailhouse.git] / configs / apic-demo.c
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Minimal configuration for demo inmates, 1 CPU, 1 MB RAM, 1 serial port
5  *
6  * Copyright (c) Siemens AG, 2013
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[2];
24         __u8 pio_bitmap[0x2000];
25 } __attribute__((packed)) config = {
26         .cell = {
27                 .name = "apic-demo",
28
29                 .cpu_set_size = sizeof(config.cpus),
30                 .num_memory_regions = ARRAY_SIZE(config.mem_regions),
31                 .num_irqchips = 0,
32                 .pio_bitmap_size = ARRAY_SIZE(config.pio_bitmap),
33                 .num_pci_devices = 0,
34         },
35
36         .cpus = {
37                 0x8,
38         },
39
40         .mem_regions = {
41                 /* RAM */ {
42                         .phys_start = 0x3f000000,
43                         .virt_start = 0,
44                         .size = 0x00100000,
45                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
46                                 JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_LOADABLE,
47                 },
48                 /* communication region */ {
49                         .virt_start = 0x00100000,
50                         .size = 0x00001000,
51                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
52                                 JAILHOUSE_MEM_COMM_REGION,
53                 },
54         },
55
56         .pio_bitmap = {
57                 [     0/8 ...  0x3f7/8] = -1,
58                 [ 0x3f8/8 ...  0x3ff/8] = 0, /* serial1 */
59                 [ 0x400/8 ... 0xe00f/8] = -1,
60                 [0xe010/8 ... 0xe017/8] = 0, /* OXPCIe952 serial1 */
61                 [0xe018/8 ... 0xffff/8] = -1,
62         },
63 };