x86: fix rdrand asm()
authorJan Beulich <jbeulich@suse.com>
Thu, 26 Sep 2013 08:11:00 +0000 (10:11 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 26 Sep 2013 08:11:00 +0000 (10:11 +0200)
commit573fd5bd2d8bd068a6cea7ae5fcc58b962d43a78
tree5140d0ac2d32456dcaaec3d681fd3f84582610c4
parent7099bd90e1b84cb6a0143835ba050a445161715d
x86: fix rdrand asm()

Just learned the hard way that at least for non-volatile asm()s gcc
indeed does what the documentation says: It may move it across jumps
(i.e. ahead of the cpu_has() check). While the documentation claims
that this can also happen for volatile asm()s, if that was the case
we'd have many more problems in our code (and e,g, Linux would too).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/include/asm-x86/random.h