From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2017-08-16 06:01:38
VSX uses a combination of the old vector registers, the old FP registers
and new "second halves" of the FP registers.
Thus when we need to see the VSX state in the thread struct
(flush_vsx_to_thread) or when we'll use the VSX in the kernel
(enable_kernel_vsx) we need to ensure they are all flushed into
the thread struct if either of them is individually enabled.
Unfortunately we only tested if the whole VSX was enabled, not
if they were individually enabled.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/kernel/process.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2017-08-16 06:01:31
__giveup_fpu() already does it and we cannot have MSR_VSX set
without having MSR_FP also set.
This also adds a warning to check we indeed do
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/kernel/process.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2017-08-16 06:02:32
On Wed, 2017-08-16 at 16:01 +1000, Benjamin Herrenschmidt wrote:
VSX uses a combination of the old vector registers, the old FP registers
and new "second halves" of the FP registers.
Thus when we need to see the VSX state in the thread struct
(flush_vsx_to_thread) or when we'll use the VSX in the kernel
(enable_kernel_vsx) we need to ensure they are all flushed into
the thread struct if either of them is individually enabled.
Unfortunately we only tested if the whole VSX was enabled, not
if they were individually enabled.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2017-08-16 06:02:41
__giveup_vsx/save_vsx are completely equivalent to testing MSR_FP
and MSR_VEC and calling the corresponding giveup/save function so
just remove the spurious VSX cases. Also add WARN_ONs checking that
we never have VSX enabled without the two other.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/kernel/process.c | 33 ++++++++-------------------------
1 file changed, 8 insertions(+), 25 deletions(-)
From: Michael Ellerman <hidden> Date: 2017-08-17 13:03:07
On Wed, 2017-08-16 at 06:01:14 UTC, Benjamin Herrenschmidt wrote:
VSX uses a combination of the old vector registers, the old FP registers
and new "second halves" of the FP registers.
Thus when we need to see the VSX state in the thread struct
(flush_vsx_to_thread) or when we'll use the VSX in the kernel
(enable_kernel_vsx) we need to ensure they are all flushed into
the thread struct if either of them is individually enabled.
Unfortunately we only tested if the whole VSX was enabled, not
if they were individually enabled.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>