]> rtime.felk.cvut.cz Git - jailhouse.git/blob - configs/tiny-demo.c
x86: Use safer pattern with AMD IOMMU to block DMA requests
[jailhouse.git] / configs / tiny-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, 2014
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         struct jailhouse_cache cache_regions[1];
25         __u8 pio_bitmap[0x2000];
26 } __attribute__((packed)) config = {
27         .cell = {
28                 .signature = JAILHOUSE_CELL_DESC_SIGNATURE,
29                 .name = "tiny-demo",
30                 .flags = JAILHOUSE_CELL_PASSIVE_COMMREG,
31
32                 .cpu_set_size = sizeof(config.cpus),
33                 .num_memory_regions = ARRAY_SIZE(config.mem_regions),
34                 .num_cache_regions = ARRAY_SIZE(config.cache_regions),
35                 .num_irqchips = 0,
36                 .pio_bitmap_size = ARRAY_SIZE(config.pio_bitmap),
37                 .num_pci_devices = 0,
38         },
39
40         .cpus = {
41                 0x4,
42         },
43
44         .mem_regions = {
45                 /* RAM */ {
46                         .phys_start = 0x3f100000,
47                         .virt_start = 0,
48                         .size = 0x00100000,
49                         .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
50                                 JAILHOUSE_MEM_EXECUTE | 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         },
59
60         .cache_regions = {
61                 {
62                         .start = 2,
63                         .size = 1,
64                         .type = JAILHOUSE_CACHE_L3,
65                 },
66         },
67
68         .pio_bitmap = {
69                 [     0/8 ...  0x2f7/8] = -1,
70                 [ 0x2f8/8 ...  0x2ff/8] = 0, /* serial2 */
71                 [ 0x300/8 ... 0xdfff/8] = -1,
72                 [0xe000/8 ... 0xe007/8] = 0, /* OXPCIe952 serial2 */
73                 [0xe008/8 ... 0xffff/8] = -1,
74         },
75 };