From: Jan Kiszka <[email protected]>

This ensures that a guest will not see its data lagging behind the
signal when triggering the ivshmem doorbell. We are going to demand this
property from the ivshmem interface.

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

diff --git a/hypervisor/arch/arm-common/ivshmem.c 
b/hypervisor/arch/arm-common/ivshmem.c
index 98206f05..14e31da4 100644
--- a/hypervisor/arch/arm-common/ivshmem.c
+++ b/hypervisor/arch/arm-common/ivshmem.c
@@ -18,8 +18,15 @@ void arch_ivshmem_trigger_interrupt(struct ivshmem_endpoint 
*ive,
 {
        unsigned int irq_id = ive->irq_cache.id[vector];
 
-       if (irq_id)
+       if (irq_id) {
+               /*
+                * Ensure that all data written by the sending guest is visible
+                * to the target before triggering the interrupt.
+                */
+               memory_barrier();
+
                irqchip_set_pending(NULL, irq_id);
+       }
 }
 
 int arch_ivshmem_update_msix(struct ivshmem_endpoint *ive, unsigned int vector,
-- 
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/cb8d79bbc2caee07fbc2d9ed86af15e040a70c35.1583516039.git.jan.kiszka%40siemens.com.

Reply via email to