]> rtime.felk.cvut.cz Git - jailhouse.git/blobdiff - configs/qemu-vm.c
jailhouse: inmates: bench: Add -R option -- repeats count.
[jailhouse.git] / configs / qemu-vm.c
old mode 100644 (file)
new mode 100755 (executable)
index 44429fb..8a8a38a
@@ -1,20 +1,29 @@
 /*
  * Jailhouse, a Linux-based partitioning hypervisor
  *
- * Test configuration for QEMU Q35 VM, 1 GB RAM, 64 MB hypervisor (-192K ACPI)
- * Command line:
- * qemu-system-x86_64 -machine q35 -m 1G -enable-kvm -smp 4 \
- *  -drive file=/path/to/image,id=disk,if=none -device ide-hd,drive=disk \
- *  -virtfs local,path=/local/path,security_model=passthrough,mount_tag=host \
- *  -cpu kvm64,-kvm_pv_eoi,-kvm_steal_time,-kvm_asyncpf,-kvmclock,+vmx,+x2apic
+ * Test configuration for QEMU Q35 VM, 1 GB RAM, 4 cores,
+ * 6 MB hypervisor, 60 MB inmates (-4K shared mem device)
  *
- * Copyright (c) Siemens AG, 2013
+ * Copyright (c) Siemens AG, 2013-2015
  *
  * Authors:
  *  Jan Kiszka <jan.kiszka@siemens.com>
  *
  * This work is licensed under the terms of the GNU GPL, version 2.  See
  * the COPYING file in the top-level directory.
+ *
+ * QEMU command line for Intel-based setups:
+ * qemu-system-x86_64 -machine q35 -m 1G -enable-kvm -smp 4 \
+ *  -drive file=/path/to/image,id=disk,if=none -device ide-hd,drive=disk \
+ *  -virtfs local,path=/local/path,security_model=passthrough,mount_tag=host \
+ *  -cpu kvm64,-kvm_pv_eoi,-kvm_steal_time,-kvm_asyncpf,-kvmclock,+vmx,+x2apic
+ *
+ * QEMU command line for AMD-based setups:
+ * qemu-system-x86_64 /path/to/image -m 1G -enable-kvm -smp 4 \
+ *  -virtfs local,path=/local/path,security_model=passthrough,mount_tag=host \
+ *  -cpu host,-kvm_pv_eoi,-kvm_steal_time,-kvm_asyncpf,-kvmclock,+svm,+x2apic
+ *
+ * Guest kernel command line appendix: memmap=66M$0x3b000000
  */
 
 #include <linux/types.h>
 struct {
        struct jailhouse_system header;
        __u64 cpus[1];
-       struct jailhouse_memory mem_regions[11];
+       struct jailhouse_memory mem_regions[14];
        struct jailhouse_irqchip irqchips[1];
        __u8 pio_bitmap[0x2000];
-       struct jailhouse_pci_device pci_devices[7];
-       struct jailhouse_pci_capability pci_caps[5];
+       struct jailhouse_pci_device pci_devices[11];
+       struct jailhouse_pci_capability pci_caps[4];
 } __attribute__((packed)) config = {
        .header = {
+               .signature = JAILHOUSE_SYSTEM_SIGNATURE,
                .hypervisor_memory = {
                        .phys_start = 0x3b000000,
-                       .size = 0x4000000,
+                       .size = 0x600000,
+               },
+               .debug_console = {
+                       .phys_start = 0x3f8,
                },
                .platform_info.x86 = {
                        .mmconfig_base = 0xb0000000,
                        .mmconfig_end_bus = 0xff,
                        .pm_timer_address = 0x608,
-                       .dmar_unit_base = {
-                               0xfed90000,
+                       .iommu_units = {
+                               {
+                                       .base = 0xfed90000,
+                                       .size = 0x1000,
+                               },
                        },
                },
                .interrupt_limit = 256,
@@ -69,10 +85,17 @@ struct {
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                                JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
                },
+               /* RAM (inmates) */ {
+                       .phys_start = 0x3b600000,
+                       .virt_start = 0x3b600000,
+                       .size = 0x3bff000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
+               },
                /* RAM */ {
-                       .phys_start = 0x3f000000,
-                       .virt_start = 0x3f000000,
-                       .size = 0xfdf000,
+                       .phys_start = 0x3f200000,
+                       .virt_start = 0x3f200000,
+                       .size = 0xddf000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                                JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
                },
@@ -82,11 +105,11 @@ struct {
                        .size = 0x30000,
                        .flags = JAILHOUSE_MEM_READ,
                },
-               /* MemRegion: fc000000-fc3fffff : vesafb */
+               /* MemRegion: fd000000-fdffffff : vesafb */
                {
-                       .phys_start = 0xfc000000,
-                       .virt_start = 0xfc000000,
-                       .size = 0x400000,
+                       .phys_start = 0xfd000000,
+                       .virt_start = 0xfd000000,
+                       .size = 0x1000000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
                },
                /* MemRegion: feb80000-febbffff : 0000:00:02.0 */
@@ -131,6 +154,14 @@ struct {
                        .size = 0x1000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
                },
+               /* MemRegion: febf6000-febf6fff : virtio-9p */
+               {
+                       .phys_start = 0xfebf6000,
+                       .virt_start = 0xfebf6000,
+                       .size = 0x1000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
+               },
+
                /* MemRegion: fed00000-fed003ff : PNP0103:00 */
                {
                        .phys_start = 0xfed00000,
@@ -138,13 +169,22 @@ struct {
                        .size = 0x1000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
                },
+               /* IVSHMEM shared memory region */
+               {
+                       .phys_start = 0x3f1ff000,
+                       .virt_start = 0x3f1ff000,
+                       .size = 0x1000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
+               },
        },
 
        .irqchips = {
                /* IOAPIC */ {
                        .address = 0xfec00000,
-                       .id = 0xff01,
-                       .pin_bitmap = 0xffffff,
+                       .id = 0xff00,
+                       .pin_bitmap = {
+                                   0xffffff
+                       },
                },
        },
 
@@ -153,18 +193,27 @@ struct {
                [  0x20/8 ...   0x3f/8] = -1,
                [  0x40/8 ...   0x47/8] = 0xf0, /* PIT */
                [  0x48/8 ...   0x5f/8] = -1,
-               [  0x60/8 ...   0x67/8] = 0xec, /* HACK: NMI status/control */
+               [  0x60/8 ...   0x67/8] = 0xfd, /*0xec HACK: NMI status/control */
                [  0x68/8 ...   0x6f/8] = -1,
                [  0x70/8 ...   0x77/8] = 0xfc, /* rtc */
                [  0x78/8 ...   0x7f/8] = -1,
                [  0x80/8 ...   0x87/8] = 0xfe, /* port 80 (delays) */
-               [  0x88/8 ...  0x2f7/8] = -1,
+
+               [  0x88/8 ...   0xe7/8] = -1,
+               [  0xe8/8 ...   0xef/8] = 0xdf, /*port 0xed delay experimental*/
+               [  0xf0/8 ...  0x1c7/8] = -1,
+
+               [ 0x1c8/8 ...  0x1cf/8] = 0x3f, /* vbe */
+               [ 0x1d0/8 ...  0x1d7/8] = 0xfe, /* vbe */
+               [ 0x1d8/8 ...  0x2f7/8] = -1,
                [ 0x2f8/8 ...  0x2ff/8] = 0, /* serial2 */
                [ 0x300/8 ...  0x3af/8] = -1,
                [ 0x3b0/8 ...  0x3df/8] = 0, /* VGA */
                [ 0x3e0/8 ...  0x3ef/8] = -1,
                [ 0x3f0/8 ...  0x3f7/8] = 0, /* floppy */
-               [ 0x3f8/8 ... 0x5657/8] = -1,
+               [ 0x3f8/8 ...  0x3ff/8] = 0,
+               [ 0x400/8 ...  0x407/8] = 0xfb, /* invalid but accessed by X */
+               [ 0x408/8 ... 0x5657/8] = -1,
                [0x5658/8 ... 0x565f/8] = 0xf0, /* vmport */
                [0x5660/8 ... 0xbfff/8] = -1,
                [0xc000/8 ... 0xc0ff/8] = 0, /* PCI devices */
@@ -191,6 +240,28 @@ struct {
                        .num_msi_vectors = 1,
                        .msi_64bits = 1,
                },
+
+               {/*uhci_hcd 00:1d.0*/
+                       .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .domain = 0x0000,
+                       .bdf = 0x00e8,
+               },
+               {/*uhci_hcd 00:1d.1*/
+                       .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .domain = 0x0000,
+                       .bdf = 0x00e9,
+               },
+               {/*uhci_hcd 00:1d.2*/
+                       .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .domain = 0x0000,
+                       .bdf = 0x00ea,
+               },
+               {/*ehci_pci 00:1d.7*/
+                       .type = JAILHOUSE_PCI_TYPE_DEVICE,
+                       .domain = 0x0000,
+                       .bdf = 0x00ef,
+               },
+
                { /* ISA bridge */
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
                        .domain = 0x0000,
@@ -210,7 +281,7 @@ struct {
                        .domain = 0x0000,
                        .bdf = 0x00fb,
                },
-               { /* virtio-9p-pci */
+               /*{ // virtio-9p-pci /
                        .type = JAILHOUSE_PCI_TYPE_DEVICE,
                        .domain = 0x0000,
                        .bdf = 0x00ff,
@@ -219,7 +290,19 @@ struct {
                        .num_msix_vectors = 2,
                        .msix_region_size = 0x1000,
                        .msix_address = 0xfebf6000,
+               },*/
+               {
+                       .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
+                       .domain = 0x0,
+                       .bdf = (0x0f<<3),
+                       .bar_mask = {
+                               0xffffff00, 0xffffffff, 0x00000000,
+                               0x00000000, 0xffffffe0, 0xffffffff,
+                       },
+                       .shmem_region = 12,
+                       .num_msix_vectors = 1,
                },
+
        },
 
        .pci_caps = {
@@ -242,15 +325,15 @@ struct {
                },
                {
                        .id = 0x5,
-                       .start = 0x50,
+                       .start = 0x80,
                        .len = 14,
                        .flags = JAILHOUSE_PCICAPS_WRITE,
                },
-               { /* virtio-9p-pci */
+               /*{ // virtio-9p-pci //
                        .id = 0x11,
                        .start = 0x40,
                        .len = 12,
                        .flags = JAILHOUSE_PCICAPS_WRITE,
-               },
+               },*/
        },
 };