Removing one peer cell has the implicit effect of resetting its state to
0. Signal this change via an interrupt as well.

Signed-off-by: Jan Kiszka <[email protected]>
---
 hypervisor/ivshmem.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hypervisor/ivshmem.c b/hypervisor/ivshmem.c
index 043fb3c..f8d4feb 100644
--- a/hypervisor/ivshmem.c
+++ b/hypervisor/ivshmem.c
@@ -309,10 +309,13 @@ static void ivshmem_disconnect_cell(struct ivshmem_data 
*iv, int cellnum)
        struct ivshmem_endpoint *remote = &iv->eps[(cellnum + 1) % 2];
        struct ivshmem_endpoint *ive = &iv->eps[cellnum];
 
+       remote->remote = NULL;
+       memory_barrier();
+       arch_ivshmem_write_doorbell(ive);
+
        ive->device->ivshmem_endpoint = NULL;
        ive->device = NULL;
        ive->remote = NULL;
-       remote->remote = NULL;
 }
 
 /**
-- 
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.

Reply via email to