x86, fpu: Use a symbolic name for asm operand
Borislav Petkov
maintainerPATCH 1/1 x86, fpu: Use a symbolic name for asm operand
From: Borislav Petkov <[email protected]>
Fix up the else-case in fpu_fxsave() which seems like it has been overlooked. Correct comment style in restore_fpu_checking() while at it.
Signed-off-by Borislav Petkov <[email protected]>
--- arch/x86/include/asm/fpu-internal.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
arch/x86/include/asm/fpu-internal.h +6 -4
@@ -207,7 +207,7 @@ static inline void fpu_fxsave(struct fpu *fpu)if (config_enabled (CONFIG_X86_32 )) asmvolatile ("fxsave %[fx]" : [fx]"=m" (fpu->state->fxsave));else if (config_enabled (CONFIG_AS_FXSAVEQ )) - asmvolatile ("fxsaveq %0" :"=m" (fpu->state->fxsave)); + asmvolatile ("fxsaveq %[fx]" : [fx]"=m" (fpu->state->fxsave));else {/* Using "rex64; fxsave %0" is broken because, if the memory * operand uses any extended registers for addressing, a second
@@ -290,9 +290,11 @@ static inline int fpu_restore_checking(struct fpu *fpu)static inline int restore_fpu_checking (struct task_struct *tsk) { -/* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception -is pending. Clear the x87 state here by setting it to fixed -values. "m" is a random variable that should be in L1 */ +/* +* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception is +* pending. Clear the x87 state here by setting it to fixed values. +* "m" is a random variable that should be in L1. +*/ if (unlikely (static_cpu_has_bug_safe (X86_BUG_FXSAVE_LEAK ))) { asmvolatile ( "fnclex\n\t"
Signature · 1 line
2.2.0.33.gc18b867
tip-bot for Borislav Petkov
merge bot[tip:x86/fpu] x86/fpu: Use a symbolic name for asm operand
x86/fpu: Use a symbolic name for asm operand
Commit-ID: 6ca7a8a15035add0a4f9b2fd658118d41dbeb20c Gitweb: http://git.kernel.org/tip/6ca7a8a15035add0a4f9b2fd658118d41dbeb20c Author: Borislav Petkov <[email protected]> AuthorDate: Sun, 21 Dec 2014 15:02:23 +0100 Committer: Ingo Molnar <[email protected]> CommitDate: Tue, 23 Dec 2014 10:41:12 +0100
x86/fpu: Use a symbolic name for asm operand
Fix up the else-case in fpu_fxsave() which seems like it has been overlooked. Correct comment style in restore_fpu_checking() while at it.
Signed-off-by Borislav Petkov <[email protected]>
Cc Linus Torvalds <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- arch/x86/include/asm/fpu-internal.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
arch/x86/include/asm/fpu-internal.h +6 -4
@@ -207,7 +207,7 @@ static inline void fpu_fxsave(struct fpu *fpu)if (config_enabled (CONFIG_X86_32 )) asmvolatile ("fxsave %[fx]" : [fx]"=m" (fpu->state->fxsave));else if (config_enabled (CONFIG_AS_FXSAVEQ )) - asmvolatile ("fxsaveq %0" :"=m" (fpu->state->fxsave)); + asmvolatile ("fxsaveq %[fx]" : [fx]"=m" (fpu->state->fxsave));else {/* Using "rex64; fxsave %0" is broken because, if the memory * operand uses any extended registers for addressing, a second
@@ -290,9 +290,11 @@ static inline int fpu_restore_checking(struct fpu *fpu)static inline int restore_fpu_checking (struct task_struct *tsk) { -/* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception -is pending. Clear the x87 state here by setting it to fixed -values. "m" is a random variable that should be in L1 */ +/* +* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception is +* pending. Clear the x87 state here by setting it to fixed values. +* "m" is a random variable that should be in L1. +*/ if (unlikely (static_cpu_has_bug_safe (X86_BUG_FXSAVE_LEAK ))) { asmvolatile ( "fnclex\n\t"