Skip to content

FP/VEC/VSX switching optimisations

Cyril Bur linuxppc-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 4 repliesIn review

Changes in V3 from the cover letter

Addressed review comments from Michael Neuling
- Made commit message in 4/9 better reflect the patch
- Removed overuse of #ifdef blocks and redundant condition in 5/9
- Split 6/8 in two to better prepare for 7,8,9
- Removed #ifdefs in 6/9

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9selftests/powerpc: Test the preservation of FPU and VMX regs across syscalltools/testing/selftests/powerpc/Makefile tools/testing/selftests/powerpc/basic_asm.h tools/testing/selftests/powerpc/math/.gitignore +5 more+620 -11 reply
2/9selftests/powerpc: Test preservation of FPU and VMX regs across preemptiontools/testing/selftests/powerpc/math/.gitignore tools/testing/selftests/powerpc/math/Makefile tools/testing/selftests/powerpc/math/fpu_asm.S +3 more+308 -30 replies
3/9selftests/powerpc: Test FPU and VMX regs in signal ucontexttools/testing/selftests/powerpc/math/.gitignore tools/testing/selftests/powerpc/math/Makefile tools/testing/selftests/powerpc/math/fpu_signal.c +1 more+296 -10 replies
4/9powerpc: Explicitly disable math features when copying threadarch/powerpc/kernel/process.c+1 -00 replies
5/9powerpc: Restore FPU/VEC/VSX if previously usedarch/powerpc/include/asm/processor.h arch/powerpc/kernel/asm-offsets.c arch/powerpc/kernel/entry_64.S +3 more+107 -140 replies
6/9powerpc: Prepare for splitting giveup_{fpu, altivec, vsx} in twoarch/powerpc/include/asm/reg.h arch/powerpc/include/asm/switch_to.h arch/powerpc/kernel/process.c+45 -10 replies
7/9powerpc: Add the ability to save FPU without giving it uparch/powerpc/include/asm/switch_to.h arch/powerpc/kernel/fpu.S arch/powerpc/kernel/process.c+17 -190 replies
8/9powerpc: Add the ability to save Altivec without giving it uparch/powerpc/include/asm/switch_to.h arch/powerpc/kernel/process.c arch/powerpc/kernel/vector.S+17 -220 replies
9/9powerpc: Add the ability to save VSX without giving it uparch/powerpc/include/asm/switch_to.h arch/powerpc/kernel/ppc_ksyms.c arch/powerpc/kernel/process.c +1 more+30 -370 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/9] FP/VEC/VSX switching optimisations

Cover-letter for V1 of the series is at
https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-November/136350.html

Cover-letter for V2 of the series is at
https://lists.ozlabs.org/pipermail/linuxppc-dev/2016-January/138054.html

Changes in V3:
Addressed review comments from Michael Neuling
- Made commit message in 4/9 better reflect the patch
- Removed overuse of #ifdef blocks and redundant condition in 5/9
- Split 6/8 in two to better prepare for 7,8,9
- Removed #ifdefs in 6/9

Changes in V4:
- Addressed non ABI compliant ASM macros in 1/9
- Fixed build breakage due to changing #ifdefs in V3 (6/9)
- Reordered some conditions in if statements

Changes in V5:
- Enhanced basic-asm.h to provide ABI independent macro as pointed out by Naveen Rao.
- Tested for both BE and LE builds. Had to disable -flto from the selftests/powerpc Makefile as it didn't play well with the custom ASM.
- Added some extra debugging output to the vmx_signal testcase
- Fixed comments in testing code
- Updated VSX test code to use GCC Altivec macros

Changes in V6:
- Removed recursive definition of CFLAGS in math/Makefile
- Corrected the use of the word param in favour of doubleword
- Reordered some code in basic-asm.h and neatened some comments

Cyril Bur (9):
selftests/powerpc: Test the preservation of FPU and VMX regs across
syscall
selftests/powerpc: Test preservation of FPU and VMX regs across
preemption
selftests/powerpc: Test FPU and VMX regs in signal ucontext
powerpc: Explicitly disable math features when copying thread
powerpc: Restore FPU/VEC/VSX if previously used
powerpc: Prepare for splitting giveup_{fpu,altivec,vsx} in two
powerpc: Add the ability to save FPU without giving it up
powerpc: Add the ability to save Altivec without giving it up
powerpc: Add the ability to save VSX without giving it up

 arch/powerpc/include/asm/processor.h               |   2 +
 arch/powerpc/include/asm/reg.h                     |   8 +
 arch/powerpc/include/asm/switch_to.h               |  13 +-
 arch/powerpc/kernel/asm-offsets.c                  |   2 +
 arch/powerpc/kernel/entry_64.S                     |  21 +-
 arch/powerpc/kernel/fpu.S                          |  25 +--
 arch/powerpc/kernel/ppc_ksyms.c                    |   4 -
 arch/powerpc/kernel/process.c                      | 168 +++++++++++++--
 arch/powerpc/kernel/vector.S                       |  45 +---
 tools/testing/selftests/powerpc/Makefile           |   3 +-
 tools/testing/selftests/powerpc/basic_asm.h        |  63 ++++++
 tools/testing/selftests/powerpc/math/.gitignore    |   6 +
 tools/testing/selftests/powerpc/math/Makefile      |  21 ++
 tools/testing/selftests/powerpc/math/fpu_asm.S     | 197 +++++++++++++++++
 tools/testing/selftests/powerpc/math/fpu_preempt.c | 113 ++++++++++
 tools/testing/selftests/powerpc/math/fpu_signal.c  | 135 ++++++++++++
 tools/testing/selftests/powerpc/math/fpu_syscall.c |  90 ++++++++
 tools/testing/selftests/powerpc/math/vmx_asm.S     | 234 +++++++++++++++++++++
 tools/testing/selftests/powerpc/math/vmx_preempt.c | 112 ++++++++++
 tools/testing/selftests/powerpc/math/vmx_signal.c  | 156 ++++++++++++++
 tools/testing/selftests/powerpc/math/vmx_syscall.c |  91 ++++++++
 21 files changed, 1426 insertions(+), 83 deletions(-)
 create mode 100644 tools/testing/selftests/powerpc/basic_asm.h
 create mode 100644 tools/testing/selftests/powerpc/math/.gitignore
 create mode 100644 tools/testing/selftests/powerpc/math/Makefile
 create mode 100644 tools/testing/selftests/powerpc/math/fpu_asm.S
 create mode 100644 tools/testing/selftests/powerpc/math/fpu_preempt.c
 create mode 100644 tools/testing/selftests/powerpc/math/fpu_signal.c
 create mode 100644 tools/testing/selftests/powerpc/math/fpu_syscall.c
 create mode 100644 tools/testing/selftests/powerpc/math/vmx_asm.S
 create mode 100644 tools/testing/selftests/powerpc/math/vmx_preempt.c
 create mode 100644 tools/testing/selftests/powerpc/math/vmx_signal.c
 create mode 100644 tools/testing/selftests/powerpc/math/vmx_syscall.c
Signature · 1 line
2.7.2