]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: re-initialise lazy FPU/VEC counters on every fault
authorNicholas Piggin <npiggin@gmail.com>
Tue, 23 Jun 2020 23:41:39 +0000 (09:41 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 16 Jul 2020 03:00:24 +0000 (13:00 +1000)
commitf6e0ff93b53211994e27aaf35686cd6bbe236c64
tree8274b88fe87bc0005a27b6478ebcdba9f8a4ca74
parent956bb296b25d7973db9eeada4e0af08d76a01038
powerpc: re-initialise lazy FPU/VEC counters on every fault

When a FP/VEC/VSX unavailable fault loads registers and enables the
facility in the MSR, re-set the lazy restore counters to 1 rather
than incrementing them so every fault gets the same number of
restores before the next fault.

This probably shouldn't be a practical change because if a lazy counter
was non-zero then it should have been restored and would not cause a
fault when userspace tries to access it. However the code and comment
implies otherwise so that's misleading and unnecessary.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200623234139.2262227-3-npiggin@gmail.com
arch/powerpc/kernel/fpu.S
arch/powerpc/kernel/vector.S