提交 6ca7a8a1 编写于 作者: B Borislav Petkov 提交者: Ingo Molnar

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: NBorislav Petkov <bp@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1419170543-11393-1-git-send-email-bp@alien8.deSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 97bf6af1
...@@ -207,7 +207,7 @@ static inline void fpu_fxsave(struct fpu *fpu) ...@@ -207,7 +207,7 @@ static inline void fpu_fxsave(struct fpu *fpu)
if (config_enabled(CONFIG_X86_32)) if (config_enabled(CONFIG_X86_32))
asm volatile( "fxsave %[fx]" : [fx] "=m" (fpu->state->fxsave)); asm volatile( "fxsave %[fx]" : [fx] "=m" (fpu->state->fxsave));
else if (config_enabled(CONFIG_AS_FXSAVEQ)) else if (config_enabled(CONFIG_AS_FXSAVEQ))
asm volatile("fxsaveq %0" : "=m" (fpu->state->fxsave)); asm volatile("fxsaveq %[fx]" : [fx] "=m" (fpu->state->fxsave));
else { else {
/* Using "rex64; fxsave %0" is broken because, if the memory /* Using "rex64; fxsave %0" is broken because, if the memory
* operand uses any extended registers for addressing, a second * operand uses any extended registers for addressing, a second
...@@ -290,9 +290,11 @@ static inline int fpu_restore_checking(struct fpu *fpu) ...@@ -290,9 +290,11 @@ static inline int fpu_restore_checking(struct fpu *fpu)
static inline int restore_fpu_checking(struct task_struct *tsk) 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 * AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception is
values. "m" is a random variable that should be in L1 */ * 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))) { if (unlikely(static_cpu_has_bug_safe(X86_BUG_FXSAVE_LEAK))) {
asm volatile( asm volatile(
"fnclex\n\t" "fnclex\n\t"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册