[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFCv4,26/35] plat/virtio: Use better iormb/iowmb on arm64



Hi, Justin.
What is the purpose of the inline assembly part from the read barrier __iormb()?
I understand that the "memory" clobber acts as a compiler memory barrier, but I
couldn't get the role of the actual assembly code.
Also, don't we need a "memory" clobber for __iowmb() too?

+#define __iormb(v)                                                     \
+({                                                                     \
+       unsigned long tmp;                                              \
+       dmb(oshld);                                                     \
+                                                                       \
+       asm volatile("eor       %0, %1, %1\n"                           \
+                    "cbnz      %0, ."                                  \
+                    : "=r" (tmp) : "r" ((unsigned long)(v))            \
+                    : "memory");                                       \
+})
+
+#define __iowmb()              dmb(oshst)

Reviewed-by: Razvan Virtan <virtanrazvan@xxxxxxxxx>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.