From: Jan Kiszka <[email protected]>

Account for the config format changes, including the addition of a demo
ivshmem device to the non-root linux cell. Changes are analogous to
those to qemu-x86 and linux-x86-demo.

Signed-off-by: Jan Kiszka <[email protected]>
---
 .../jailhouse/files/linux-nuc6cay-demo.c           | 75 +++++++++++++++++-----
 recipes-jailhouse/jailhouse/files/nuc6cay.c        | 70 +++++++++++++++-----
 2 files changed, 112 insertions(+), 33 deletions(-)

diff --git a/recipes-jailhouse/jailhouse/files/linux-nuc6cay-demo.c 
b/recipes-jailhouse/jailhouse/files/linux-nuc6cay-demo.c
index 5211f2f..8366d6b 100644
--- a/recipes-jailhouse/jailhouse/files/linux-nuc6cay-demo.c
+++ b/recipes-jailhouse/jailhouse/files/linux-nuc6cay-demo.c
@@ -20,8 +20,8 @@
 struct {
        struct jailhouse_cell_desc cell;
        __u64 cpus[1];
-       struct jailhouse_memory mem_regions[4];
-       struct jailhouse_pci_device pci_devices[1];
+       struct jailhouse_memory mem_regions[12];
+       struct jailhouse_pci_device pci_devices[2];
 } __attribute__((packed)) config = {
        .cell = {
                .signature = JAILHOUSE_CELL_DESC_SIGNATURE,
@@ -40,6 +40,41 @@ struct {
        },
 
        .mem_regions = {
+               /* IVSHMEM shared memory regions (demo) */
+               {
+                       .phys_start = 0x3f0f0000,
+                       .virt_start = 0x3f0f0000,
+                       .size = 0x1000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED,
+               },
+               {
+                       .phys_start = 0x3f0f1000,
+                       .virt_start = 0x3f0f1000,
+                       .size = 0x9000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_ROOTSHARED,
+               },
+               {
+                       .phys_start = 0x3f0fa000,
+                       .virt_start = 0x3f0fa000,
+                       .size = 0x2000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED,
+               },
+               {
+                       .phys_start = 0x3f0fc000,
+                       .virt_start = 0x3f0fc000,
+                       .size = 0x2000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_ROOTSHARED,
+               },
+               {
+                       .phys_start = 0x3f0fe000,
+                       .virt_start = 0x3f0fe000,
+                       .size = 0x2000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_ROOTSHARED,
+               },
+               /* IVSHMEM shared memory regions (networking) */
+               JAILHOUSE_SHMEM_NET_REGIONS(0x3f100000, 1),
                /* low RAM */ {
                        .phys_start = 0x3a600000,
                        .virt_start = 0,
@@ -56,32 +91,38 @@ struct {
                /* high RAM */ {
                        .phys_start = 0x3a700000,
                        .virt_start = 0x00200000,
-                       .size = 0x4a00000,
+                       .size = 0x4900000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                                JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA |
                                JAILHOUSE_MEM_LOADABLE,
                },
-               /* IVSHMEM shared memory region */
-               {
-                       .phys_start = 0x3f100000,
-                       .virt_start = 0x3f100000,
-                       .size = 0xff000,
-                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
-                               JAILHOUSE_MEM_ROOTSHARED,
-               },
        },
 
        .pci_devices = {
+               /* IVSHMEM: 00:10.0 */
                {
                        .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
+                       .iommu = 1,
                        .domain = 0x0,
                        .bdf = 0x10 << 3,
-                       .bar_mask = {
-                               0xffffff00, 0xffffffff, 0x00000000,
-                               0x00000000, 0xffffffe0, 0xffffffff,
-                       },
-                       .num_msix_vectors = 1,
-                       .shmem_region = 3,
+                       .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_MSIX,
+                       .num_msix_vectors = 16,
+                       .shmem_regions_start = 0,
+                       .shmem_dev_id = 2,
+                       .shmem_peers = 3,
+                       .shmem_protocol = JAILHOUSE_SHMEM_PROTO_UNDEFINED,
+               },
+               /* IVSHMEM: 00:11.0 */
+               {
+                       .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
+                       .iommu = 1,
+                       .domain = 0x0,
+                       .bdf = 0x11 << 3,
+                       .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_MSIX,
+                       .num_msix_vectors = 3,
+                       .shmem_regions_start = 5,
+                       .shmem_dev_id = 1,
+                       .shmem_peers = 2,
                        .shmem_protocol = JAILHOUSE_SHMEM_PROTO_VETH,
                },
        },
diff --git a/recipes-jailhouse/jailhouse/files/nuc6cay.c 
b/recipes-jailhouse/jailhouse/files/nuc6cay.c
index 5b3b84e..7600745 100644
--- a/recipes-jailhouse/jailhouse/files/nuc6cay.c
+++ b/recipes-jailhouse/jailhouse/files/nuc6cay.c
@@ -41,10 +41,10 @@
 struct {
        struct jailhouse_system header;
        __u64 cpus[1];
-       struct jailhouse_memory mem_regions[54];
+       struct jailhouse_memory mem_regions[62];
        struct jailhouse_irqchip irqchips[1];
        struct jailhouse_pio pio_regions[6];
-       struct jailhouse_pci_device pci_devices[21];
+       struct jailhouse_pci_device pci_devices[22];
        struct jailhouse_pci_capability pci_caps[53];
 } __attribute__((packed)) config = {
        .header = {
@@ -96,6 +96,39 @@ struct {
        },
 
        .mem_regions = {
+               /* IVSHMEM shared memory regions (demo) */
+               {
+                       .phys_start = 0x3f0f0000,
+                       .virt_start = 0x3f0f0000,
+                       .size = 0x1000,
+                       .flags = JAILHOUSE_MEM_READ,
+               },
+               {
+                       .phys_start = 0x3f0f1000,
+                       .virt_start = 0x3f0f1000,
+                       .size = 0x9000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
+               },
+               {
+                       .phys_start = 0x3f0fa000,
+                       .virt_start = 0x3f0fa000,
+                       .size = 0x2000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
+               },
+               {
+                       .phys_start = 0x3f0fc000,
+                       .virt_start = 0x3f0fc000,
+                       .size = 0x2000,
+                       .flags = JAILHOUSE_MEM_READ,
+               },
+               {
+                       .phys_start = 0x3f0fe000,
+                       .virt_start = 0x3f0fe000,
+                       .size = 0x2000,
+                       .flags = JAILHOUSE_MEM_READ,
+               },
+               /* IVSHMEM shared memory regions (networking) */
+               JAILHOUSE_SHMEM_NET_REGIONS(0x3f100000, 0),
                /* MemRegion: 00000000-0003efff : System RAM */
                {
                        .phys_start = 0x0,
@@ -479,14 +512,7 @@ struct {
                {
                        .phys_start = 0x3a600000,
                        .virt_start = 0x3a600000,
-                       .size = 0x4b00000,
-                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
-               },
-               /* IVSHMEM shared memory region */
-               {
-                       .phys_start = 0x3f100000,
-                       .virt_start = 0x3f100000,
-                       .size = 0xff000,
+                       .size = 0x4a00000,
                        .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
                },
        },
@@ -878,12 +904,24 @@ struct {
                        .iommu = 1,
                        .domain = 0x0,
                        .bdf = 0x10 << 3,
-                       .bar_mask = {
-                               0xffffff00, 0xffffffff, 0x00000000,
-                               0x00000000, 0xffffffe0, 0xffffffff,
-                       },
-                       .num_msix_vectors = 1,
-                       .shmem_region = 53,
+                       .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_MSIX,
+                       .num_msix_vectors = 16,
+                       .shmem_regions_start = 0,
+                       .shmem_dev_id = 0,
+                       .shmem_peers = 3,
+                       .shmem_protocol = JAILHOUSE_SHMEM_PROTO_UNDEFINED,
+               },
+               /* IVSHMEM: 00:11.0 */
+               {
+                       .type = JAILHOUSE_PCI_TYPE_IVSHMEM,
+                       .iommu = 1,
+                       .domain = 0x0,
+                       .bdf = 0x11 << 3,
+                       .bar_mask = JAILHOUSE_IVSHMEM_BAR_MASK_MSIX,
+                       .num_msix_vectors = 3,
+                       .shmem_regions_start = 5,
+                       .shmem_dev_id = 0,
+                       .shmem_peers = 2,
                        .shmem_protocol = JAILHOUSE_SHMEM_PROTO_VETH,
                },
        },
-- 
2.16.4

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/67a7e0e1d48832baa4aab40482fbe9037034d767.1579170887.git.jan.kiszka%40siemens.com.

Reply via email to