提交 d338c73c 编写于 作者: J Jeremy Fitzhardinge 提交者: Ingo Molnar

x86: add memory clobber to save/loadsegment

Add "memory" clobbers to savesegment and loadsegment, since they can
affect memory accesses and we never want the compiler to reorder them
with respect to memory references.
Signed-off-by: NJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Cc: Stephen Tweedie <sct@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 bea41808
......@@ -153,14 +153,14 @@ extern void load_gs_index(unsigned);
"jmp 2b\n" \
".previous\n" \
_ASM_EXTABLE(1b,3b) \
: :"r" (value), "r" (0))
: :"r" (value), "r" (0) : "memory")
/*
* Save a segment register away
*/
#define savesegment(seg, value) \
asm volatile("mov %%" #seg ",%0":"=rm" (value))
asm("mov %%" #seg ",%0":"=rm" (value) : : "memory")
static inline unsigned long get_limit(unsigned long segment)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册