diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2012-11-21 17:41:21 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2012-11-26 18:52:48 -0500 |
commit | cb7cb2864e758a1b040040bc55e404c677c911cb (patch) | |
tree | 3e2a2b9fb95d1d181567630645b7162bb1893258 /arch/x86/kvm/emulate.c | |
parent | 9489e9dcae718d5fde988e4a684a0f55b5f94d17 (diff) |
x86, kvm: Remove incorrect redundant assembly constraint
In __emulate_1op_rax_rdx, we use "+a" and "+d" which are input/output
constraints, and *then* use "a" and "d" as input constraints. This is
incorrect, but happens to work on some versions of gcc.
However, it breaks gcc with -O0 and icc, and may break on future
versions of gcc.
Reported-and-tested-by: Melanie Blower <melanie.blower@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Link: http://lkml.kernel.org/r/B3584E72CFEBED439A3ECA9BCE67A4EF1B17AF90@FMSMSX107.amr.corp.intel.com
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 39171cb307ea..bba39bfa1c4b 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -426,8 +426,7 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt) | |||
426 | _ASM_EXTABLE(1b, 3b) \ | 426 | _ASM_EXTABLE(1b, 3b) \ |
427 | : "=m" ((ctxt)->eflags), "=&r" (_tmp), \ | 427 | : "=m" ((ctxt)->eflags), "=&r" (_tmp), \ |
428 | "+a" (*rax), "+d" (*rdx), "+qm"(_ex) \ | 428 | "+a" (*rax), "+d" (*rdx), "+qm"(_ex) \ |
429 | : "i" (EFLAGS_MASK), "m" ((ctxt)->src.val), \ | 429 | : "i" (EFLAGS_MASK), "m" ((ctxt)->src.val)); \ |
430 | "a" (*rax), "d" (*rdx)); \ | ||
431 | } while (0) | 430 | } while (0) |
432 | 431 | ||
433 | /* instruction has only one source operand, destination is implicit (e.g. mul, div, imul, idiv) */ | 432 | /* instruction has only one source operand, destination is implicit (e.g. mul, div, imul, idiv) */ |