Skip to content

powerpc: Hardware transactional memory support for POWER8

Michael Neuling linuxppc-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest17 patches 6 repliesIn review

v2 changes from the cover letter

Adds signal handling
Removes some code for detecting when to restore all register or not Added tabort for local tlb invalidates
Rebased on benh's next tree

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17powerpc: Add new CPU feature bit for transactional memoryarch/powerpc/include/asm/cputable.h+7 -00 replies
1/17powerpc: Add new CPU feature bit for transactional memoryarch/powerpc/include/asm/cputable.h+7 -00 replies
1/17powerpc: Add new CPU feature bit for transactional memoryarch/powerpc/include/asm/cputable.h+7 -00 replies
2/17powerpc: Add new instructions for transactional memoryarch/powerpc/include/asm/ppc-opcode.h+10 -00 replies
2/17powerpc: Add new instructions for transactional memoryarch/powerpc/include/asm/ppc-opcode.h+10 -00 replies
2/17powerpc: Add new instructions for transactional memoryarch/powerpc/include/asm/ppc-opcode.h+10 -00 replies
3/17powerpc: Add additional state needed for transactional memory to thread structarch/powerpc/include/asm/processor.h+28 -00 replies
3/17powerpc: Add additional state needed for transactional memory to thread structarch/powerpc/include/asm/processor.h+28 -00 replies
3/17powerpc: Add additional state needed for transactional memory to thread structarch/powerpc/include/asm/processor.h+28 -00 replies
4/17powerpc: New macros for transactional memory supportarch/powerpc/include/asm/ppc_asm.h arch/powerpc/include/asm/processor.h arch/powerpc/kernel/asm-offsets.c +3 more+141 -00 replies
4/17powerpc: New macros for transactional memory supportarch/powerpc/include/asm/ppc_asm.h arch/powerpc/include/asm/processor.h arch/powerpc/kernel/asm-offsets.c +3 more+134 -00 replies
4/17powerpc: New macros for transactional memory supportarch/powerpc/include/asm/ppc_asm.h arch/powerpc/include/asm/processor.h arch/powerpc/kernel/asm-offsets.c +3 more+134 -00 replies
5/17powerpc: Register defines for various transactional memory registersarch/powerpc/include/asm/reg.h+27 -00 replies
5/17powerpc: Register defines for various transactional memory registersarch/powerpc/include/asm/reg.h+27 -00 replies
5/17powerpc: Register defines for various transactional memory registersarch/powerpc/include/asm/reg.h+27 -00 replies
6/17powerpc: Add transactional memory paca scratch register to show_regsarch/powerpc/include/asm/paca.h arch/powerpc/kernel/asm-offsets.c arch/powerpc/kernel/entry_64.S +1 more+9 -00 replies
6/17powerpc: Add transactional memory paca scratch register to show_regsarch/powerpc/include/asm/paca.h arch/powerpc/kernel/asm-offsets.c arch/powerpc/kernel/entry_64.S +1 more+9 -02 replies
6/17powerpc: Add transactional memory paca scratch register to show_regsarch/powerpc/include/asm/paca.h arch/powerpc/kernel/asm-offsets.c arch/powerpc/kernel/entry_64.S +1 more+11 -00 replies
7/17powerpc: Add helper functions for transactional memory context switchingarch/powerpc/include/asm/reg.h arch/powerpc/include/asm/tm.h arch/powerpc/kernel/Makefile +1 more+406 -10 replies
7/17powerpc: Add helper functions for transactional memory context switchingarch/powerpc/include/asm/reg.h arch/powerpc/include/asm/tm.h arch/powerpc/kernel/Makefile +1 more+411 -10 replies
7/17powerpc: Add helper functions for transactional memory context switchingarch/powerpc/include/asm/reg.h arch/powerpc/include/asm/tm.h arch/powerpc/kernel/Makefile +1 more+411 -10 replies
8/17powerpc: Add FP/VSX and VMX register load functions for transactional memoryarch/powerpc/kernel/fpu.S arch/powerpc/kernel/vector.S+105 -00 replies
8/17powerpc: Add FP/VSX and VMX register load functions for transactional memoryarch/powerpc/kernel/fpu.S arch/powerpc/kernel/vector.S+105 -02 replies
8/17powerpc: Add FP/VSX and VMX register load functions for transactional memoryarch/powerpc/kernel/fpu.S arch/powerpc/kernel/vector.S+105 -00 replies
9/17powerpc: Add reclaim and recheckpoint functions for context switching transactional memory processesarch/powerpc/kernel/process.c+112 -00 replies
9/17powerpc: Add reclaim and recheckpoint functions for context switching transactional memory processesarch/powerpc/kernel/process.c+112 -00 replies
9/17powerpc: Add reclaim and recheckpoint functions for context switching transactional memory processesarch/powerpc/kernel/process.c+112 -00 replies
10/17powerpc: Add transactional memory unavaliable execption handlerarch/powerpc/kernel/exceptions-64s.S arch/powerpc/kernel/traps.c+40 -00 replies
10/17powerpc: Add transactional memory unavaliable execption handlerarch/powerpc/kernel/exceptions-64s.S arch/powerpc/kernel/traps.c+40 -00 replies
10/17powerpc: Add transactional memory unavaliable execption handlerarch/powerpc/kernel/exceptions-64s.S arch/powerpc/kernel/traps.c+40 -00 replies
11/17powerpc: Assembler routines for FP/VSX/VMX unavailable during a transactionarch/powerpc/kernel/traps.c+95 -00 replies
11/17powerpc: Routines for FP/VSX/VMX unavailable during a transactionarch/powerpc/kernel/traps.c+83 -00 replies
11/17powerpc: Routines for FP/VSX/VMX unavailable during a transactionarch/powerpc/kernel/traps.c+83 -00 replies
12/17powerpc: Hook in new transactional memory codearch/powerpc/kernel/exceptions-64s.S arch/powerpc/kernel/fpu.S arch/powerpc/kernel/process.c +3 more+104 -60 replies
12/17powerpc: Hook in new transactional memory codearch/powerpc/kernel/exceptions-64s.S arch/powerpc/kernel/process.c arch/powerpc/kernel/traps.c +1 more+115 -40 replies
12/17powerpc: Hook in new transactional memory codearch/powerpc/kernel/exceptions-64s.S arch/powerpc/kernel/process.c arch/powerpc/kernel/traps.c +1 more+115 -40 replies
13/17powerpc: Add new transactional memory state to the signal contextarch/powerpc/include/asm/reg.h arch/powerpc/kernel/signal.h arch/powerpc/kernel/signal_32.c +1 more+830 -160 replies
13/17powerpc: Add new transactional memory state to the signal contextarch/powerpc/include/asm/reg.h arch/powerpc/kernel/signal.h arch/powerpc/kernel/signal_32.c +1 more+830 -160 replies
13/17powerpc: Add new transactional memory state to the signal contextarch/powerpc/include/asm/reg.h arch/powerpc/kernel/signal.h arch/powerpc/kernel/signal_32.c +1 more+830 -160 replies
14/17powerpc: Add transactional memory to POWER8 cpu featuresarch/powerpc/include/asm/cputable.h+1 -10 replies
14/17powerpc: Add transactional memory to POWER8 cpu featuresarch/powerpc/include/asm/cputable.h+2 -10 replies
14/17powerpc: Add transactional memory to POWER8 cpu featuresarch/powerpc/include/asm/cputable.h+2 -10 replies
15/17powerpc: Add config option for transactional memoryarch/powerpc/Kconfig+8 -00 replies
15/17powerpc: Add config option for transactional memoryarch/powerpc/Kconfig+8 -02 replies
15/17powerpc: Add config option for transactional memoryarch/powerpc/Kconfig+8 -00 replies
16/17powerpc: Add transactional memory to pseries and ppc64 defconfigsarch/powerpc/configs/ppc64_defconfig arch/powerpc/configs/pseries_defconfig+4 -00 replies
16/17powerpc: Add transactional memory to pseries and ppc64 defconfigsarch/powerpc/configs/ppc64_defconfig arch/powerpc/configs/pseries_defconfig+4 -00 replies
16/17powerpc: Add transactional memory to pseries and ppc64 defconfigsarch/powerpc/configs/ppc64_defconfig arch/powerpc/configs/pseries_defconfig+4 -00 replies
17/17powerpc: Documentation for transactional memory on powerpcDocumentation/powerpc/transactional_memory.txt+175 -00 replies
17/17powerpc: Documentation for transactional memory on powerpcDocumentation/powerpc/transactional_memory.txt+175 -00 replies
17/17powerpc: Documentation for transactional memory on powerpcDocumentation/powerpc/transactional_memory.txt+175 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/17] powerpc: Hardware transactional memory support for POWER8

POWER8 implements hardware transactional memory support. This patch series adds kernel support so that user programs can use this hardware transactional memory and the new state is properly context switched. It is not currently used by the kernel itself.

This patch series was originally developed by Matt Evans.

v2 changes
Adds signal handling
Removes some code for detecting when to restore all register or not Added tabort for local tlb invalidates
Rebased on benh's next tree

Basic overview of a POWER8 hardware transaction memory
=====================================================
Hardware transactional memory is a feature that enables a different form of atomic memory access. Several new instructions are presented to delimit transactions; transactions are guaranteed to either complete atomically or roll back and undo any partial changes.

A simple transaction looks like this:

begin_move_money:
tbegin
beq abort_handler

  ld    r4, SAVINGS_ACCT(r3)
  ld    r5, CURRENT_ACCT(r3)
  subi  r5, r5, 1
  addi  r4, r4, 1
  std   r4, SAVINGS_ACCT(r3)
  std   r5, CURRENT_ACCT(r3)

tend

b continue

abort_handler:
... test for odd failures ...

/* Retry the transaction if it failed because it conflicted with
* someone else: */
b begin_move_money

The 'tbegin' instruction denotes the start point, and 'tend' the end point. Between these points the processor is in 'Transactional' state; any memory references will complete in one go if there are no conflicts with other transactional or non-transactional accesses within the system. In this example, the transaction completes as though it were normal straight-line code IF no other processor has touched SAVINGS_ACCT(r3) or CURRENT_ACCT(r3); an atomic move of money from the current account to the savings account has been performed. Even though the normal ld/std instructions are used (note no lwarx/stwcx), either *both* SAVINGS_ACCT(r3) and CURRENT_ACCT(r3) will be updated, or neither will be updated.

If, in the meantime, there is a conflict with the locations accessed by the transaction, the transaction will be aborted by the CPU. Register and memory state will roll back to that at the 'tbegin', and control will continue from 'tbegin+4'. The branch to abort_handler will be taken this second time; the abort handler can check the cause of the failure, and retry.

Checkpointed registers include all GPRs, FPRs, VRs/VSRs, LR, CCR/CR, CTR, FPCSR and a few other status/flag regs;