All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: david.nospam.hopwood@blueyonder.co.uk
Cc: xen-devel@lists.sourceforge.net
Subject: Re: x86-64 tools fix question
Date: Wed, 02 Mar 2005 00:52:05 -0600	[thread overview]
Message-ID: <42256295.9020906@us.ibm.com> (raw)
In-Reply-To: <42255FFB.2030900@blueyonder.co.uk>

David Hopwood wrote:

> Jerone Young wrote:
> See volume 1, section 3.9.2 of the AMD64 architecture manual
> (http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_875_7044,00.html), 
>
> quoted below for convenience.
>
> This should be guaranteed to work:
>
> #define rmb() __asm__ __volatile__ ( "mfence" : : : "memory" )
> #define wmb() __asm__ __volatile__ ( "mfence" : : : "memory" )

sfence and lfence would seem to be more appropriate.  mfence would seem 
to be appropriate for an mb() macro (which is usually also defined--but 
in this case not necessary).

> but may be overkill. Are these macros used in any performance-critical
> situations? If not then the overkill wouldn't matter.

Not at all.  They're currently used to prevent race conditions within 
the domain control channel ring queue.  This queue is relatively 
low-traffic.

The confusion stemmed from the x86-32 code that doesn't actually 
implement a wmb() since no relevant architecture does out-of-order stores.

x86-64 is another story.  The linux includes still have the same 
comments indicating that wmb() is not necessary (an obvious 
cut-and-paste job) even though wmb() is defined to sfence.  To make 
matters worse, the wmb() is wrapped in the same CONFIG_UNORDERED_IO 
guarded (that's enabled by default in x86-64 but disabled by default in 
x86-32).

It's understandably confusing.  I'm hoping we can do a much better job 
in Xen in supporting both architectures to avoid these sort of confusions.

Regards,
Anthony Liguori


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

      reply	other threads:[~2005-03-02  6:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-01 19:56 x86-64 tools fix question Jerone Young
2005-03-01 20:37 ` Keir Fraser
2005-03-01 21:23   ` Anthony Liguori
2005-03-01 22:24     ` [PATCH] cpu barriers moved and x86-64 barriers add Jerone Young
2005-03-02 17:27       ` Jerone Young
2005-03-02  6:40 ` x86-64 tools fix question David Hopwood
2005-03-02  6:52   ` Anthony Liguori [this message]

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=42256295.9020906@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=david.nospam.hopwood@blueyonder.co.uk \
    --cc=xen-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.