]> git.karo-electronics.de Git - linux-beck.git/commit
x86/fpu: Improve the initialization logic of 'err' around xstate_fault() constraints
authorIngo Molnar <mingo@kernel.org>
Mon, 25 May 2015 09:59:35 +0000 (11:59 +0200)
committerIngo Molnar <mingo@kernel.org>
Mon, 25 May 2015 10:49:38 +0000 (12:49 +0200)
commit685c9616248c4f0d57e0d81d3236c80bdce1af46
tree0d18add6677728299f34cd781206cb51d5591d45
parent87b6559d0a37cd82b4b2ffe38f88c0d4ac6ee7e2
x86/fpu: Improve the initialization logic of 'err' around xstate_fault() constraints

There's a confusing aspect of how xstate_fault() constraints are
handled by the FPU register/memory copying functions in
fpu/internal.h: they use "0" (0) to signal that the asm code
will not always set 'err' to a valid value.

But 'err' is already initialized to 0 in C code, which is duplicated
by the asm() constraint. Should the initialization value ever be
changed, it might become subtly inconsistent with the not too clear
asm() constraint.

Use 'err' as the value of the input variable instead, to clarify
this all.

Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/fpu/internal.h