]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
configs: qemu: add a virtual PCI device to qemu config
authorHenning Schild <henning.schild@siemens.com>
Wed, 26 Nov 2014 19:20:10 +0000 (20:20 +0100)
committerJan Kiszka <jan.kiszka@siemens.com>
Tue, 2 Dec 2014 06:21:36 +0000 (07:21 +0100)
This adds a virtual PCI device of type ivshmem to the root-cell on qemu.
Starting a cell with an ivshmem at the same bdf, refering to the same
memory will allow the two cells to connect.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
[Jan: adjusted memory regions to avoid overlappings]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
configs/qemu-vm.c

index b5a7167b43fc87b1fc167b48c768626f3c962521..24f1daadcf287729547393968fafc6148aedf6a9 100644 (file)
 struct {
        struct jailhouse_system header;
        __u64 cpus[1];
-       struct jailhouse_memory mem_regions[11];
+       struct jailhouse_memory mem_regions[13];
        struct jailhouse_irqchip irqchips[1];
        __u8 pio_bitmap[0x2000];
-       struct jailhouse_pci_device pci_devices[7];
+       struct jailhouse_pci_device pci_devices[8];
        struct jailhouse_pci_capability pci_caps[5];
 } __attribute__((packed)) config = {
        .header = {
@@ -76,10 +76,17 @@ struct {
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                                JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
                },
-               /* RAM */ {
+               /* RAM (inmates) */ {
                        .phys_start = 0x3f000000,
                        .virt_start = 0x3f000000,
-                       .size = 0xfdf000,
+                       .size = 0x1ff000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
+               },
+               /* RAM */ {
+                       .phys_start = 0x3f200000,
+                       .virt_start = 0x3f200000,
+                       .size = 0xddf000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                                JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA,
                },
@@ -145,6 +152,13 @@ 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 = {
@@ -227,6 +241,13 @@ struct {
                        .msix_region_size = 0x1000,
                        .msix_address = 0xfebf6000,
                },
+               {
+                       .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
+                       .domain = 0x0,
+                       .bdf = (0x0f<<3),
+                       .shmem_region = 12,
+                       .num_msix_vectors = 1,
+               },
        },
 
        .pci_caps = {