2 * Jailhouse, a Linux-based partitioning hypervisor
4 * Copyright (c) Siemens AG, 2014
6 * This work is licensed under the terms of the GNU GPL, version 2. See
7 * the COPYING file in the top-level directory.
9 * Configuration for ${product[0]} ${product[1]}
10 * created with '${argstr}'
12 * NOTE: This config expects the following to be appended to your kernel cmdline
13 * "memmap=${hex(ourmem[1])}$${hex(ourmem[0])}"
16 #include <linux/types.h>
17 #include <jailhouse/cell-config.h>
19 #define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0])
22 struct jailhouse_system header;
23 __u64 cpus[${int((cpucount + 63) / 64)}];
24 struct jailhouse_memory mem_regions[${len(regions)}];
25 struct jailhouse_irqchip irqchips[1];
26 __u8 pio_bitmap[0x2000];
27 struct jailhouse_pci_device pci_devices[${len(pcidevices)}];
28 struct jailhouse_pci_capability pci_caps[${len(pcicaps)}];
29 } __attribute__((packed)) config = {
31 .hypervisor_memory = {
32 .phys_start = ${hex(hvmem[0])},
33 .size = ${hex(hvmem[1])},
35 .platform_info.x86 = {
36 .mmconfig_base = ${hex(mmconfig.base)},
37 .mmconfig_end_bus = ${hex(mmconfig.end_bus)},
38 .pm_timer_address = ${hex(pm_timer_base)},
40 % for d in dmar_units:
47 .cpu_set_size = sizeof(config.cpus),
48 .num_memory_regions = ARRAY_SIZE(config.mem_regions),
49 .num_irqchips = ARRAY_SIZE(config.irqchips),
50 .pio_bitmap_size = ARRAY_SIZE(config.pio_bitmap),
51 .num_pci_devices = ARRAY_SIZE(config.pci_devices),
52 .num_pci_caps = ARRAY_SIZE(config.pci_caps),
57 % for n in range(int(cpucount / 64)):
61 ${'0x%016x,' % ((1 << (cpucount % 64)) - 1)}
68 % for c in r.comments:
72 .phys_start = ${hex(r.start)},
73 .virt_start = ${hex(r.start)},
74 .size = ${hex(r.size())},
75 .flags = ${r.flagstr('\t\t')},
82 .address = 0xfec00000,
83 .id = ${hex(ioapic_id)},
84 .pin_bitmap = 0xffffff,
89 [ 0/8 ... 0x3f/8] = -1,
90 [ 0x40/8 ... 0x47/8] = 0xf0, /* PIT */
91 [ 0x48/8 ... 0x5f/8] = -1,
92 [ 0x60/8 ... 0x67/8] = 0, /* HACK: 8042, NMI status/control */
93 [ 0x68/8 ... 0x6f/8] = -1,
94 [ 0x70/8 ... 0x77/8] = 0xfc, /* RTC */
95 [ 0x78/8 ... 0x3af/8] = -1,
96 [ 0x3b0/8 ... 0x3df/8] = 0x00, /* VGA */
97 [ 0x3e0/8 ... 0xcff/8] = -1,
98 [ 0xd00/8 ... 0xffff/8] = 0, /* HACK: PCI bus */
102 % for d in pcidevices:
106 .domain = ${hex(d.domain)},
107 .bdf = ${hex(d.bdf())},
108 .caps_start = ${d.caps_start},
109 .num_caps = ${d.num_caps},
116 % for comment in c.comments:
121 .start = ${hex(c.start)},