Skip to content

Commit

Permalink
x86/fpu: Optimize fpu__activate_fpstate_read()
Browse files Browse the repository at this point in the history
fpu__activate_fpstate_read() is used before FPU registers are
read from the fpstate by ptrace and core dumping.

It's not necessary to unlazy non-current child tasks in this case,
since the reading of registers is non-destructive.

Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Bobby Powers <bobbypowers@gmail.com>
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>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Ingo Molnar committed May 27, 2015
1 parent 0560281 commit 9ba6b79
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions arch/x86/kernel/fpu/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,7 @@ void fpu__activate_fpstate_read(struct fpu *fpu)
if (fpu->fpregs_active) {
fpu__save(fpu);
} else {
if (fpu->fpstate_active) {
/* Invalidate any lazy state: */
fpu->last_cpu = -1;
} else {
if (!fpu->fpstate_active) {
fpstate_init(&fpu->state);

/* Safe to do for current and for stopped child tasks: */
Expand Down

0 comments on commit 9ba6b79

Please sign in to comment.