clflush is a light weight but not serializing instruction, so
hence memory fence is necessary to make sure all load/store
visible before flush cache line.

Signed-off-by: Tiejun Chen <tiejun.c...@intel.com>
---
 xen/drivers/passthrough/vtd/x86/vtd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/drivers/passthrough/vtd/x86/vtd.c 
b/xen/drivers/passthrough/vtd/x86/vtd.c
index 109234e..fd2ff04 100644
--- a/xen/drivers/passthrough/vtd/x86/vtd.c
+++ b/xen/drivers/passthrough/vtd/x86/vtd.c
@@ -56,7 +56,9 @@ unsigned int get_cache_line_size(void)
 
 void cacheline_flush(char * addr)
 {
+    mb();
     clflush(addr);
+    mb();
 }
 
 void flush_all_cache()
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to