[PATCH] ivshmem: Notify remote about state change on cell removal

1 view
Skip to first unread message

Jan Kiszka

unread,
Dec 2, 2016, 6:08:14 AM12/2/16
to Jailhouse, Måns Rullgård
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 <jan.k...@siemens.com>
---
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
Reply all
Reply to author
Forward
0 new messages