From: Andrew Cooper Date: Wed, 5 Oct 2016 11:42:15 +0000 (+0100) Subject: xen/common: Replace incorrect mandatory barriers with SMP barriers X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~3263 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ea33d31b0c3d04576d7076d91bb415d44370c899;p=xen.git xen/common: Replace incorrect mandatory barriers with SMP barriers Mandatory barriers are only for use with reduced-cacheability MMIO mappings. All of these uses are just to deal with shared memory between multiple processors, so use the smp_*() which are the correct barriers for the purpose. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich Reviewed-by: Stefano Stabellini --- diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index e2c4097071..a425a9ea08 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -993,7 +993,7 @@ __gnttab_map_grant_ref( mt = &maptrack_entry(lgt, handle); mt->domid = op->dom; mt->ref = op->ref; - wmb(); + smp_wmb(); write_atomic(&mt->flags, op->flags); if ( need_iommu ) diff --git a/xen/common/time.c b/xen/common/time.c index 721ada8a69..a7caea99e0 100644 --- a/xen/common/time.c +++ b/xen/common/time.c @@ -103,7 +103,7 @@ void update_domain_wallclock_time(struct domain *d) wc_version = &shared_info(d, wc_version); *wc_version = version_update_begin(*wc_version); - wmb(); + smp_wmb(); sec = wc_sec + d->time_offset_seconds; shared_info(d, wc_sec) = sec; @@ -117,7 +117,7 @@ void update_domain_wallclock_time(struct domain *d) shared_info(d, wc_sec_hi) = sec >> 32; #endif - wmb(); + smp_wmb(); *wc_version = version_update_end(*wc_version); spin_unlock(&wc_lock); diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c index 907ab40cde..c6f7d32af7 100644 --- a/xen/common/vm_event.c +++ b/xen/common/vm_event.c @@ -31,9 +31,9 @@ #include /* for public/io/ring.h macros */ -#define xen_mb() mb() -#define xen_rmb() rmb() -#define xen_wmb() wmb() +#define xen_mb() smp_mb() +#define xen_rmb() smp_rmb() +#define xen_wmb() smp_wmb() #define vm_event_ring_lock_init(_ved) spin_lock_init(&(_ved)->ring_lock) #define vm_event_ring_lock(_ved) spin_lock(&(_ved)->ring_lock)