From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Julien Grall <julien.grall@arm.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Jan Beulich <JBeulich@suse.com>
Subject: [PATCH 1/4] xen/common: Replace incorrect mandatory barriers with SMP barriers
Date: Mon, 5 Dec 2016 10:05:14 +0000 [thread overview]
Message-ID: <1480932317-22962-2-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1480932317-22962-1-git-send-email-andrew.cooper3@citrix.com>
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 <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien.grall@arm.com>
Restricting to just the $ARCH maintainers, as this is a project-wide sweep
---
xen/common/grant_table.c | 2 +-
xen/common/time.c | 4 ++--
xen/common/vm_event.c | 6 +++---
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index e2c4097..a425a9e 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 721ada8..a7caea9 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 907ab40..c6f7d32 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -31,9 +31,9 @@
#include <xsm/xsm.h>
/* 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)
--
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-12-05 10:05 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-05 10:05 [PATCH 0/4] Fixes to common and x86 barriers Andrew Cooper
2016-12-05 10:05 ` Andrew Cooper [this message]
2016-12-05 10:55 ` [PATCH 1/4] xen/common: Replace incorrect mandatory barriers with SMP barriers Jan Beulich
2016-12-05 19:07 ` Stefano Stabellini
2016-12-05 10:05 ` [PATCH 2/4] xen/x86: Drop erronious barriers Andrew Cooper
2016-12-05 11:18 ` Jan Beulich
2016-12-05 11:25 ` Andrew Cooper
2016-12-05 12:28 ` Jan Beulich
2016-12-05 13:43 ` Andrew Cooper
2016-12-05 13:50 ` Jan Beulich
2016-12-05 13:59 ` Andrew Cooper
2016-12-05 14:07 ` Jan Beulich
2016-12-05 19:14 ` Stefano Stabellini
2016-12-05 19:17 ` Stefano Stabellini
2016-12-06 0:10 ` Andrew Cooper
2016-12-06 20:27 ` Stefano Stabellini
2016-12-06 20:32 ` Stefano Stabellini
2016-12-07 1:03 ` Andrew Cooper
2016-12-07 1:20 ` Stefano Stabellini
2016-12-07 1:46 ` Andrew Cooper
2016-12-07 18:31 ` Julien Grall
2016-12-07 18:44 ` Stefano Stabellini
2016-12-07 18:55 ` Julien Grall
2016-12-05 10:05 ` [PATCH 3/4] xen/x86: Replace incorrect mandatory barriers with SMP barriers Andrew Cooper
2016-12-05 11:47 ` Jan Beulich
2016-12-05 13:29 ` Andrew Cooper
2016-12-05 14:03 ` Jan Beulich
2016-12-05 14:24 ` Andrew Cooper
2016-12-05 14:33 ` Jan Beulich
2016-12-05 10:05 ` [PATCH 4/4] xen/x86: Correct mandatory and SMP barrier definitions Andrew Cooper
2016-12-05 10:11 ` Juergen Gross
2016-12-05 13:45 ` Andrew Cooper
2016-12-05 11:51 ` Jan Beulich
2016-12-05 14:08 ` Andrew Cooper
2016-12-05 12:01 ` David Vrabel
2016-12-05 13:46 ` Andrew Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1480932317-22962-2-git-send-email-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=julien.grall@arm.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).