xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: xen-devel@lists.xen.org
Cc: Boris Ostrovsky <boris.ostrovky@oracle.com>,
	David Vrabel <david.vrabel@citrix.com>
Subject: [PATCH 1/3] x86/xen: use memory barriers when enabling local irqs
Date: Tue, 13 Aug 2013 15:31:34 +0100	[thread overview]
Message-ID: <1376404296-7012-2-git-send-email-david.vrabel@citrix.com> (raw)
In-Reply-To: <1376404296-7012-1-git-send-email-david.vrabel@citrix.com>

From: David Vrabel <david.vrabel@citrix.com>

Because vcpu->evtchn_upcall_mask and vcpu->evtchn_upcall_pending are
be written by Xen as well as the guest, using barrier() (a
compiler-only barrier) in xen_enable_irq() and xen_restore_fl() is not
sufficient.

Use mb() (a full memory barrier) instead.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
 arch/x86/xen/irq.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/xen/irq.c b/arch/x86/xen/irq.c
index 01a4dc0..1a8d0d4 100644
--- a/arch/x86/xen/irq.c
+++ b/arch/x86/xen/irq.c
@@ -60,7 +60,7 @@ static void xen_restore_fl(unsigned long flags)
 
 	if (flags == 0) {
 		preempt_check_resched();
-		barrier(); /* unmask then check (avoid races) */
+		mb(); /* unmask then check (avoid races) */
 		if (unlikely(vcpu->evtchn_upcall_pending))
 			xen_force_evtchn_callback();
 	}
@@ -93,7 +93,7 @@ static void xen_irq_enable(void)
 	/* Doesn't matter if we get preempted here, because any
 	   pending event will get dealt with anyway. */
 
-	barrier(); /* unmask then check (avoid races) */
+	mb(); /* unmask then check (avoid races) */
 	if (unlikely(vcpu->evtchn_upcall_pending))
 		xen_force_evtchn_callback();
 }
-- 
1.7.2.5

  reply	other threads:[~2013-08-13 14:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13 14:31 [PATCH 0/3] Linux: fix some event handling bugs David Vrabel
2013-08-13 14:31 ` David Vrabel [this message]
2013-08-13 15:16   ` [PATCH 1/3] x86/xen: use memory barriers when enabling local irqs Jan Beulich
2013-08-13 15:18   ` Boris Ostrovsky
2013-08-13 14:31 ` [PATCH 2/3] x86/xen: disable premption " David Vrabel
2013-08-13 14:31 ` [PATCH 3/3] xen/events: document behaviour when scanning the start word for events David Vrabel
2013-08-13 14:49 ` [PATCH 0/3] Linux: fix some event handling bugs David Vrabel

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=1376404296-7012-2-git-send-email-david.vrabel@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=boris.ostrovky@oracle.com \
    --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).