mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Palfrader <peter@palfrader.org>,
	Avi Kivity <avi@redhat.com>, Greg KH <gregkh@suse.de>,
	linux-kernel@vger.kernel.org, stable@kernel.org,
	stable-review@kernel.org, akpm@linux-foundation.org,
	alan@lxorguk.ukuu.org.uk, Glauber Costa <glommer@redhat.com>,
	Zachary Amsden <zamsden@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [patch 134/149] x86, paravirt: Add a global synchronization point 	for pvclock
Date: Tue, 13 Jul 2010 17:02:42 -0700	[thread overview]
Message-ID: <1600b961-b476-453d-9fd7-d98dbc8e5ed5@email.android.com> (raw)

I believe that's how it is actually implemented though, and I believe we'd have failures all over if that was not true.

"Jeremy Fitzhardinge" <jeremy@goop.org> wrote:

>On 07/13/2010 03:14 PM, H. Peter Anvin wrote:
>> Actually, I believe volatile operations (including asm volatile) are
>> strictly ordered *with respect to other volatile operations*. 
>
>The documentation makes no reference to that property; in fact it
>suggests it is outright not true:
>
>    Note that even a volatile `asm' instruction can be moved relative to
>    other
>    code, including across jump instructions.  For example, on many targets
>    there is a system register which can be set to control the rounding
>    mode of floating point operations.  You might try setting it with a
>    volatile `asm', like this PowerPC example:
>
>                asm volatile("mtfsf 255,%0" : : "f" (fpenv));
>                sum = x + y;
>
>    This will not work reliably, as the compiler may move the addition
>    back before the volatile `asm'.  To make it work you need to add an
>    artificial dependency to the `asm' referencing a variable in the
>    code you don't want moved, for example:
>
>             asm volatile ("mtfsf 255,%1" : "=X"(sum): "f"(fpenv));
>             sum = x + y;
>
>    Similarly, you can't expect a sequence of volatile `asm'
>    instructions to remain perfectly consecutive.
>    [...]
>    An `asm' instruction without any output operands will be treated
>    identically to a volatile `asm' instruction.
>
>>  As such I
>> would think we'd want to keep the "memory" clobber here, to make it
>> strictly ordered with regards to *all* memory operations.
>>   
>
>That would keep its overall effect consistent.
>
>    J

-- 
Sent from my mobile phone.  Please pardon any lack of formatting.

             reply	other threads:[~2010-07-14  0:04 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-14  0:02 H. Peter Anvin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-07-01 17:51 [patch 000/149] 2.6.32.16 stable review Greg KH
2010-07-01 17:32 ` [patch 134/149] x86, paravirt: Add a global synchronization point for pvclock Greg KH
2010-07-07 12:47   ` Peter Palfrader
2010-07-07 13:51     ` Glauber Costa
2010-07-07 14:33       ` Peter Palfrader
2010-07-07 15:15         ` Gleb Natapov
2010-07-07 20:05           ` Peter Palfrader
2010-07-08  5:31             ` Gleb Natapov
2010-07-08  8:51               ` Peter Palfrader
2010-07-08 11:03                 ` Gleb Natapov
2010-07-07 18:15         ` Glauber Costa
2010-07-07 20:11           ` Zachary Amsden
2010-07-07 21:08             ` Glauber Costa
2010-07-08  9:41     ` Avi Kivity
2010-07-13 10:23       ` Peter Palfrader
2010-07-13 13:23         ` Avi Kivity
2010-07-13 14:19           ` Peter Palfrader
2010-07-13 15:57             ` Avi Kivity
2010-07-13 16:22               ` Peter Palfrader
2010-07-13 16:34                 ` Avi Kivity
2010-07-13 16:40                   ` Avi Kivity
2010-07-13 16:45                     ` Avi Kivity
2010-07-13 17:25                       ` Peter Palfrader
2010-07-13 17:50                         ` Linus Torvalds
2010-07-13 17:59                           ` Linus Torvalds
2010-07-13 18:21                             ` Jeremy Fitzhardinge
2010-07-13 22:14                               ` H. Peter Anvin
2010-07-13 23:49                                 ` Jeremy Fitzhardinge
2010-07-14  0:15                                   ` Linus Torvalds
2010-07-14 17:19                                     ` Jeremy Fitzhardinge
2010-07-14 17:30                                       ` H. Peter Anvin
2010-07-14 17:34                                         ` Jeremy Fitzhardinge
2010-07-14 17:45                                           ` H. Peter Anvin
2010-07-14 17:57                                             ` Jeremy Fitzhardinge
2010-07-14 18:08                                               ` H. Peter Anvin
2010-07-14 18:15                                                 ` Jeremy Fitzhardinge
2010-07-14 18:19                                                   ` H. Peter Anvin
2010-07-14 20:58                                                     ` Jeremy Fitzhardinge
2010-07-14 18:23                                                   ` Linus Torvalds
2010-07-14 18:18                                                 ` H.J. Lu
2010-07-14 19:00                                                   ` H. Peter Anvin
2010-07-14 19:32                                                     ` H.J. Lu
2010-07-14 19:36                                                       ` H. Peter Anvin
2010-07-14 19:40                                                         ` H.J. Lu
2010-07-14 21:11                                                           ` Jeremy Fitzhardinge
2010-07-14 19:58                                                             ` H. Peter Anvin
2010-07-14 20:33                                                             ` H. Peter Anvin
2010-07-14 20:16                                               ` Avi Kivity
2010-07-14 20:40                                                 ` Jeremy Fitzhardinge
2010-07-14 20:45                                                   ` Zachary Amsden
2010-07-14 20:54                                                     ` Zachary Amsden
2010-07-14 21:11                                                     ` Jeremy Fitzhardinge
2010-07-16  4:48                                                     ` H. Peter Anvin
2010-07-14 20:50                                                   ` H. Peter Anvin
2010-07-14 21:11                                                     ` Jeremy Fitzhardinge
2010-07-13 18:23                             ` Peter Palfrader
2010-07-13 16:53                   ` Peter Palfrader
2010-07-13 16:34               ` Linus Torvalds
2010-07-13 18:04                 ` Avi Kivity
2010-07-13 18:15                   ` Linus Torvalds
2010-07-27 17:46                     ` Jeremy Fitzhardinge
2010-07-27 17:52                       ` H. Peter Anvin
2010-07-13 18:25                   ` Peter Palfrader

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=1600b961-b476-453d-9fd7-d98dbc8e5ed5@email.android.com \
    --to=hpa@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=avi@redhat.com \
    --cc=glommer@redhat.com \
    --cc=gregkh@suse.de \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=peter@palfrader.org \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=zamsden@redhat.com \
    /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

Powered by JetHome