From: Henning Schild <[email protected]> Since 3e970ab533c4 we can specify a protocol to run on the ivshmem channel. This patch considers a protocol mismatch between the two endpoints a configuration error and does not connect them to each other.
Signed-off-by: Henning Schild <[email protected]> [Jan: rebased] Signed-off-by: Jan Kiszka <[email protected]> --- Documentation/inter-cell-communication.txt | 3 ++- hypervisor/ivshmem.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Documentation/inter-cell-communication.txt b/Documentation/inter-cell-communication.txt index 2d0eded..dbaea06 100644 --- a/Documentation/inter-cell-communication.txt +++ b/Documentation/inter-cell-communication.txt @@ -61,7 +61,8 @@ cell config you should make sure that "iommu" is set to the correct value, try using the same value that works for the other pci devices. The link between two such virtual PCI devices is established by using the same "bdf". The size and location of the shared memory can be configured freely but -you have to make sure that the values match on both sides. +you have to make sure that the values match on both sides. The "shmem_protocol" +has to match as well. For an example have a look at the cell configuration files of qemu and the ivshmem-demo. diff --git a/hypervisor/ivshmem.c b/hypervisor/ivshmem.c index eace458..a9e8440 100644 --- a/hypervisor/ivshmem.c +++ b/hypervisor/ivshmem.c @@ -337,9 +337,10 @@ int ivshmem_init(struct cell *cell, struct pci_device *device) peer_mem = jailhouse_cell_mem_regions(peer_dev->cell->config) + peer_dev->info->shmem_region; - /* check that the regions of both peers match */ + /* check that the regions and protocols of both peers match */ if (peer_mem->phys_start != mem->phys_start || - peer_mem->size != mem->size) + peer_mem->size != mem->size || + peer_dev->info->shmem_protocol != dev_info->shmem_protocol) return trace_error(-EINVAL); printk("Shared memory connection established: " -- 2.1.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]. For more options, visit https://groups.google.com/d/optout.
