linux-brain/arch/x86/include/asm/fpu
Thomas Gleixner 12f8d6e7f2 x86/fpu: Return proper error codes from user access functions
[ Upstream commit aee8c67a4faa40a8df4e79316dbfc92d123989c1 ]

When *RSTOR from user memory raises an exception, there is no way to
differentiate them. That's bad because it forces the slow path even when
the failure was not a fault. If the operation raised eg. #GP then going
through the slow path is pointless.

Use _ASM_EXTABLE_FAULT() which stores the trap number and let the exception
fixup return the negated trap number as error.

This allows to separate the fast path and let it handle faults directly and
avoid the slow path for all other exceptions.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210623121457.601480369@linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-20 16:10:47 +02:00
..
api.h x86/fpu: Add kernel_fpu_begin_mask() to selectively initialize state 2021-01-27 11:47:49 +01:00
internal.h x86/fpu: Return proper error codes from user access functions 2021-07-20 16:10:47 +02:00
regset.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
signal.h x86/fpu: Remove fpu->initialized usage in __fpu__restore_sig() 2019-04-09 19:27:29 +02:00
types.h x86/fpu: Remove fpu->initialized 2019-04-10 15:42:40 +02:00
xstate.h x86/fpu: Inline fpu__xstate_clear_all_cpu_caps() 2019-07-07 12:01:47 +02:00