x86/traps: Have read_cr0() only once in the #NM handler
authorBorislav Petkov <bp@suse.de>
Thu, 17 Jan 2019 12:02:05 +0000 (13:02 +0100)
committerBorislav Petkov <bp@suse.de>
Tue, 22 Jan 2019 13:13:35 +0000 (14:13 +0100)
commitee35b9b9f6d52ba134b4e75442531935f295be7a
treee232599868d0c2c62f87d1ded53f279643289440
parent49a57857aeea06ca831043acbb0fa5e0f50602fd
x86/traps: Have read_cr0() only once in the #NM handler

... instead of twice in the code. In any case, CR0 ends up being read
once anyway:

1. The CONFIG_MATH_EMULATION case does so and exits.
2. The normal case does it once too.

However, read it on function entry instead to make the code even simpler
to follow.

No functional changes.

Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20190117120728.3811-1-bp@alien8.de
arch/x86/kernel/traps.c