From: Cyril Bur <cyrilbur@gmail.com>
To: mpe@ellerman.id.au
Cc: linuxppc-dev@ozlabs.org, mikey@neuling.org,
Anshuman Khandual <khandual@linux.vnet.ibm.com>
Subject: [PATCH 0/5] Consistent TM structures
Date: Wed, 8 Jun 2016 14:00:31 +1000 [thread overview]
Message-ID: <20160608040036.13064-1-cyrilbur@gmail.com> (raw)
Hi,
The reason for this series is outlined in 3/5. I'll reexplain here
quickly.
If userspace doesn't use TM at all then pt_regs, fp_state and vr_state
hold (almost) all the register state of the CPU.
If userspace uses TM then pt_regs is ALWAYS the live state. This may
be a transactional speculative state or if the thread is between
transactions it is just the regular live state. The checkpointed state
(if needed) always exists in ckpt_regs.
This is not true of fp_state and vr_state which MAY hold a live state
when the thread has not entered a transaction but will then contain
checkpointed values once a thread enters a transaction.
transact_fp and transact_vr are used only when a thread is in a
transaction (active or suspended) to keep the live (but speculative)
state.
Here I aim to remove this disconnect and have everything behave like
pt_regs.
For ease of review I've left patches 3, 4 and 5 separate. It probably
makes sense for them to be squashed into one, the naming inconsistency
between 3 and 4 can't be a good idea.
A few apologies for this series:
- I had to write tests to have an idea what I've done is correct,
they're still a bit rough around the edges.
- In the process I made more the asm helpers shared as the powerpc/math
selftests had quite a few things I found useful.
- This pretty much means the 2/5 monster should be a few patches. I'll
split them up.
I didn't want this series held up from initial review while I cleaned
up tests.
Thanks,
Cyril
Cyril Bur (5):
selftests/powerpc: Check for VSX preservation across userspace
preemption
selftests/powerpc: Add test to check TM ucontext creation
powerpc: tm: Always use fp_state and vr_state to store live registers
powerpc: tm: Rename transct_(*) to ck(\1)_state
powerpc: Remove do_load_up_transact_{fpu,altivec}
arch/powerpc/include/asm/processor.h | 20 +--
arch/powerpc/include/asm/tm.h | 5 -
arch/powerpc/kernel/asm-offsets.c | 12 +-
arch/powerpc/kernel/fpu.S | 26 ----
arch/powerpc/kernel/process.c | 48 ++-----
arch/powerpc/kernel/signal.h | 8 +-
arch/powerpc/kernel/signal_32.c | 84 ++++++-------
arch/powerpc/kernel/signal_64.c | 59 ++++-----
arch/powerpc/kernel/tm.S | 95 +++++++-------
arch/powerpc/kernel/traps.c | 12 +-
arch/powerpc/kernel/vector.S | 25 ----
tools/testing/selftests/powerpc/basic_asm.h | 4 +
tools/testing/selftests/powerpc/fpu_asm.h | 72 +++++++++++
tools/testing/selftests/powerpc/gpr_asm.h | 96 ++++++++++++++
tools/testing/selftests/powerpc/math/Makefile | 4 +-
tools/testing/selftests/powerpc/math/fpu_asm.S | 73 +----------
tools/testing/selftests/powerpc/math/vmx_asm.S | 85 +------------
tools/testing/selftests/powerpc/math/vsx_asm.S | 57 +++++++++
tools/testing/selftests/powerpc/math/vsx_preempt.c | 140 +++++++++++++++++++++
tools/testing/selftests/powerpc/tm/Makefile | 9 +-
.../powerpc/tm/tm-signal-context-chk-fpu.c | 94 ++++++++++++++
.../powerpc/tm/tm-signal-context-chk-gpr.c | 96 ++++++++++++++
.../powerpc/tm/tm-signal-context-chk-vmx.c | 112 +++++++++++++++++
.../powerpc/tm/tm-signal-context-chk-vsx.c | 127 +++++++++++++++++++
.../selftests/powerpc/tm/tm-signal-context-chk.c | 102 +++++++++++++++
tools/testing/selftests/powerpc/tm/tm-signal.S | 105 ++++++++++++++++
tools/testing/selftests/powerpc/vmx_asm.h | 98 +++++++++++++++
tools/testing/selftests/powerpc/vsx_asm.h | 71 +++++++++++
28 files changed, 1343 insertions(+), 396 deletions(-)
create mode 100644 tools/testing/selftests/powerpc/fpu_asm.h
create mode 100644 tools/testing/selftests/powerpc/gpr_asm.h
create mode 100644 tools/testing/selftests/powerpc/math/vsx_asm.S
create mode 100644 tools/testing/selftests/powerpc/math/vsx_preempt.c
create mode 100644 tools/testing/selftests/powerpc/tm/tm-signal-context-chk-fpu.c
create mode 100644 tools/testing/selftests/powerpc/tm/tm-signal-context-chk-gpr.c
create mode 100644 tools/testing/selftests/powerpc/tm/tm-signal-context-chk-vmx.c
create mode 100644 tools/testing/selftests/powerpc/tm/tm-signal-context-chk-vsx.c
create mode 100644 tools/testing/selftests/powerpc/tm/tm-signal-context-chk.c
create mode 100644 tools/testing/selftests/powerpc/tm/tm-signal.S
create mode 100644 tools/testing/selftests/powerpc/vmx_asm.h
create mode 100644 tools/testing/selftests/powerpc/vsx_asm.h
--
2.8.3
next reply other threads:[~2016-06-08 4:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-08 4:00 Cyril Bur [this message]
2016-06-08 4:00 ` [PATCH 1/5] selftests/powerpc: Check for VSX preservation across userspace preemption Cyril Bur
2016-06-09 1:35 ` Daniel Axtens
2016-06-09 3:52 ` Michael Ellerman
2016-06-10 6:10 ` Cyril Bur
2016-06-08 4:00 ` [PATCH 2/5] selftests/powerpc: Add test to check TM ucontext creation Cyril Bur
2016-06-09 5:12 ` Daniel Axtens
2016-06-10 5:55 ` Cyril Bur
2016-06-08 4:00 ` [PATCH 3/5] powerpc: tm: Always use fp_state and vr_state to store live registers Cyril Bur
2016-06-28 3:53 ` Simon Guo
2016-06-30 1:31 ` Cyril Bur
2016-07-17 3:25 ` Simon Guo
2016-07-18 1:28 ` Cyril Bur
2016-07-20 9:36 ` Simon Guo
2016-06-08 4:00 ` [PATCH 4/5] powerpc: tm: Rename transct_(*) to ck(\1)_state Cyril Bur
2016-06-08 4:00 ` [PATCH 5/5] powerpc: Remove do_load_up_transact_{fpu,altivec} Cyril Bur
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160608040036.13064-1-cyrilbur@gmail.com \
--to=cyrilbur@gmail.com \
--cc=khandual@linux.vnet.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=mikey@neuling.org \
--cc=mpe@ellerman.id.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).