Am Wed, 30 Nov 2016 18:19:27 +0100
schrieb Jan Kiszka <[email protected]>:

> On 2016-11-30 17:50, Henning Schild wrote:
> > 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]>
> > 
> > diff --git a/Documentation/inter-cell-communication.txt
> > b/Documentation/inter-cell-communication.txt ---
> > a/Documentation/inter-cell-communication.txt +++
> > b/Documentation/inter-cell-communication.txt @@ -61,7 +61,8 @@
> >   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
> > --- a/hypervisor/ivshmem.c
> > +++ b/hypervisor/ivshmem.c
> > @@ -396,7 +396,9 @@
> >  
> >             /* we already have a datastructure, connect second
> > endpoint */ if ((mem0->phys_start == mem->phys_start) &&
> > -               (mem0->size == mem->size)) {
> > +               (mem0->size == mem->size) &&
> > +               (dev0->info->shmem_protocol ==
> > device->info->shmem_protocol)
> > +              ) {
> >                     if ((*ivp)->eps[1].device)
> >                             return trace_error(-EBUSY);
> >                     ivshmem_connect_cell(*ivp, device, mem, 1);
> >   
> 
> Makes sense.

This is just following the - so far - pretty strict matching.
Matching the protocol is useful to prevent a connection of two device
drivers that got tricked by misconfiguration.

> BTW, I was wondering these days if we cannot relax the matching
> criteria to identical shmem regions and, with with patch, protocol.
> This should simplify the configuration a bit. What do you think?

The bdf matching could be removed, but so far i see the 1to1 mapping
more as a feature to prevent confusion. You can look at multiple lspcis
and know what is connected to what, and even lspci -v could not tell
you because we do not use BARs.

> Jan
> 

-- 
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.

Reply via email to