linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Michael Neuling <mikey@neuling.org>,
	linuxppc-dev@lists.ozlabs.org, Matt Evans <matt@ozlabs.org>
Subject: [PATCH 02/17] powerpc: Add new instructions for transactional memory
Date: Thu, 14 Feb 2013 13:21:30 +1100	[thread overview]
Message-ID: <1360808505-10086-3-git-send-email-mikey@neuling.org> (raw)
In-Reply-To: <1360808505-10086-1-git-send-email-mikey@neuling.org>

Here we define the new instructions we need for transactional memory in the
kernel.  This is so we can support compiling with binutils that don't support
the new transactional memory instructions.

Transactional memory results in two sets of architected state (GPRs/VSRs
etc).

treclaim allows us to read the checkpointed state (from the tbegin) so that we
can store it away on a context switch.  It does this by overwriting the exiting
architected state, so you have to save that away before you treclaim.  treclaim
will also abort a transaction, so you can give a register value which contains
an abort reason.

trecheckpoint allows us to inject into the checkpointed state as if it were at
the tbegin.  It does this by copying the current architected state into the
checkpointed state.

Signed-off-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 arch/powerpc/include/asm/ppc-opcode.h |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index 0fd1928..8752bc8 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -129,6 +129,9 @@
 #define PPC_INST_TLBSRX_DOT		0x7c0006a5
 #define PPC_INST_XXLOR			0xf0000510
 #define PPC_INST_XVCPSGNDP		0xf0000780
+#define PPC_INST_TRECHKPT		0x7c0007dd
+#define PPC_INST_TRECLAIM		0x7c00075d
+#define PPC_INST_TABORT			0x7c00071d
 
 #define PPC_INST_NAP			0x4c000364
 #define PPC_INST_SLEEP			0x4c0003a4
@@ -294,4 +297,11 @@
 #define PPC_NAP			stringify_in_c(.long PPC_INST_NAP)
 #define PPC_SLEEP		stringify_in_c(.long PPC_INST_SLEEP)
 
+/* Transactional memory instructions */
+#define TRECHKPT		stringify_in_c(.long PPC_INST_TRECHKPT)
+#define TRECLAIM(r)		stringify_in_c(.long PPC_INST_TRECLAIM \
+					       | __PPC_RA(r))
+#define TABORT(r)		stringify_in_c(.long PPC_INST_TABORT \
+					       | __PPC_RA(r))
+
 #endif /* _ASM_POWERPC_PPC_OPCODE_H */
-- 
1.7.10.4

  parent reply	other threads:[~2013-02-14  2:21 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27  2:47 [PATCH 00/16] powerpc: Hardware transactional memory support for POWER8 Michael Neuling
2012-11-27  2:47 ` [PATCH 01/16] powerpc: Add new CPU feature bit for transactional memory Michael Neuling
2012-11-27  2:47 ` [PATCH 02/16] powerpc: Add new instructions " Michael Neuling
2012-11-27  2:47 ` [PATCH 03/16] powerpc: Add additional state needed for transactional memory to thread struct Michael Neuling
2012-11-27  2:47 ` [PATCH 04/16] powerpc: New macros for transactional memory support Michael Neuling
2012-11-27  2:47 ` [PATCH 05/16] powerpc: Register defines for various transactional memory registers Michael Neuling
2012-11-27  2:47 ` [PATCH 06/16] powerpc: Add transactional memory paca scratch register to show_regs Michael Neuling
2012-11-27  2:47 ` [PATCH 07/16] powerpc: Add helper functions for transactional memory context switching Michael Neuling
2012-11-27  2:48 ` [PATCH 08/16] powerpc: Add FP/VSX and VMX register load functions for transactional memory Michael Neuling
2012-11-27  2:48 ` [PATCH 09/16] powerpc: Add reclaim and recheckpoint functions for context switching transactional memory processes Michael Neuling
2012-11-27  2:48 ` [PATCH 10/16] powerpc: Add transactional memory unavaliable execption handler Michael Neuling
2012-11-27  2:48 ` [PATCH 11/16] powerpc: Assembler routines for FP/VSX/VMX unavailable during a transaction Michael Neuling
2012-11-27  2:48 ` [PATCH 12/16] powerpc: Hook in new transactional memory code Michael Neuling
2012-11-27  2:48 ` [PATCH 13/16] powerpc: Add transactional memory to POWER8 cpu features Michael Neuling
2012-11-27  2:48 ` [PATCH 14/16] powerpc: Add config option for transactional memory Michael Neuling
2012-11-27  2:48 ` [PATCH 15/16] powerpc: Add transactional memory to pseries and ppc64 defconfigs Michael Neuling
2012-11-27  2:48 ` [PATCH 16/16] powerpc: Documentation for transactional memory on powerpc Michael Neuling
2013-01-18  5:48 ` [PATCH 00/17] powerpc: Hardware transactional memory support for POWER8 Michael Neuling
2013-01-18  5:48   ` [PATCH 01/17] powerpc: Add new CPU feature bit for transactional memory Michael Neuling
2013-01-18  5:48   ` [PATCH 02/17] powerpc: Add new instructions " Michael Neuling
2013-01-18  5:48   ` [PATCH 03/17] powerpc: Add additional state needed for transactional memory to thread struct Michael Neuling
2013-01-18  5:48   ` [PATCH 04/17] powerpc: New macros for transactional memory support Michael Neuling
2013-01-18  5:48   ` [PATCH 05/17] powerpc: Register defines for various transactional memory registers Michael Neuling
2013-01-18  5:48   ` [PATCH 06/17] powerpc: Add transactional memory paca scratch register to show_regs Michael Neuling
2013-01-18  5:48   ` [PATCH 07/17] powerpc: Add helper functions for transactional memory context switching Michael Neuling
2013-01-18  5:48   ` [PATCH 08/17] powerpc: Add FP/VSX and VMX register load functions for transactional memory Michael Neuling
2013-01-18  5:48   ` [PATCH 09/17] powerpc: Add reclaim and recheckpoint functions for context switching transactional memory processes Michael Neuling
2013-01-18  5:48   ` [PATCH 10/17] powerpc: Add transactional memory unavaliable execption handler Michael Neuling
2013-01-18  5:48   ` [PATCH 11/17] powerpc: Assembler routines for FP/VSX/VMX unavailable during a transaction Michael Neuling
2013-01-18  5:48   ` [PATCH 12/17] powerpc: Hook in new transactional memory code Michael Neuling
2013-01-18  5:48   ` [PATCH 13/17] powerpc: Add new transactional memory state to the signal context Michael Neuling
2013-01-18  5:48   ` [PATCH 14/17] powerpc: Add transactional memory to POWER8 cpu features Michael Neuling
2013-01-18  5:48   ` [PATCH 15/17] powerpc: Add config option for transactional memory Michael Neuling
2013-01-18  5:48   ` [PATCH 16/17] powerpc: Add transactional memory to pseries and ppc64 defconfigs Michael Neuling
2013-01-18  5:48   ` [PATCH 17/17] powerpc: Documentation for transactional memory on powerpc Michael Neuling
2013-02-13  4:31   ` [PATCH 00/17] powerpc: Hardware transactional memory support for POWER8 Michael Neuling
2013-02-13  4:31     ` [PATCH 01/17] powerpc: Add new CPU feature bit for transactional memory Michael Neuling
2013-02-13  4:31     ` [PATCH 02/17] powerpc: Add new instructions " Michael Neuling
2013-02-13  4:31     ` [PATCH 03/17] powerpc: Add additional state needed for transactional memory to thread struct Michael Neuling
2013-02-13  4:31     ` [PATCH 04/17] powerpc: New macros for transactional memory support Michael Neuling
2013-02-13  4:31     ` [PATCH 05/17] powerpc: Register defines for various transactional memory registers Michael Neuling
2013-02-13  4:31     ` [PATCH 06/17] powerpc: Add transactional memory paca scratch register to show_regs Michael Neuling
2013-02-13 13:52       ` Kumar Gala
2013-02-14  1:53         ` Michael Neuling
2013-02-13  4:31     ` [PATCH 07/17] powerpc: Add helper functions for transactional memory context switching Michael Neuling
2013-02-13  4:31     ` [PATCH 08/17] powerpc: Add FP/VSX and VMX register load functions for transactional memory Michael Neuling
2013-02-13 13:54       ` Kumar Gala
2013-02-14  1:53         ` Michael Neuling
2013-02-13  4:31     ` [PATCH 09/17] powerpc: Add reclaim and recheckpoint functions for context switching transactional memory processes Michael Neuling
2013-02-13  4:31     ` [PATCH 10/17] powerpc: Add transactional memory unavaliable execption handler Michael Neuling
2013-02-13  4:31     ` [PATCH 11/17] powerpc: Routines for FP/VSX/VMX unavailable during a transaction Michael Neuling
2013-02-13  4:31     ` [PATCH 12/17] powerpc: Hook in new transactional memory code Michael Neuling
2013-02-13  4:31     ` [PATCH 13/17] powerpc: Add new transactional memory state to the signal context Michael Neuling
2013-02-13  4:31     ` [PATCH 14/17] powerpc: Add transactional memory to POWER8 cpu features Michael Neuling
2013-02-13  4:31     ` [PATCH 15/17] powerpc: Add config option for transactional memory Michael Neuling
2013-02-13 14:02       ` Kumar Gala
2013-02-14  1:52         ` Michael Neuling
2013-02-13  4:31     ` [PATCH 16/17] powerpc: Add transactional memory to pseries and ppc64 defconfigs Michael Neuling
2013-02-13  4:31     ` [PATCH 17/17] powerpc: Documentation for transactional memory on powerpc Michael Neuling
2013-02-14  2:21     ` [PATCH 00/17] powerpc: Hardware transactional memory support for POWER8 Michael Neuling
2013-02-14  2:21       ` [PATCH 01/17] powerpc: Add new CPU feature bit for transactional memory Michael Neuling
2013-02-14  2:21       ` Michael Neuling [this message]
2013-02-14  2:21       ` [PATCH 03/17] powerpc: Add additional state needed for transactional memory to thread struct Michael Neuling
2013-02-14  2:21       ` [PATCH 04/17] powerpc: New macros for transactional memory support Michael Neuling
2013-02-14  2:21       ` [PATCH 05/17] powerpc: Register defines for various transactional memory registers Michael Neuling
2013-02-14  2:21       ` [PATCH 06/17] powerpc: Add transactional memory paca scratch register to show_regs Michael Neuling
2013-02-14  2:21       ` [PATCH 07/17] powerpc: Add helper functions for transactional memory context switching Michael Neuling
2013-02-14  2:21       ` [PATCH 08/17] powerpc: Add FP/VSX and VMX register load functions for transactional memory Michael Neuling
2013-02-14  2:21       ` [PATCH 09/17] powerpc: Add reclaim and recheckpoint functions for context switching transactional memory processes Michael Neuling
2013-02-14  2:21       ` [PATCH 10/17] powerpc: Add transactional memory unavaliable execption handler Michael Neuling
2013-02-14  2:21       ` [PATCH 11/17] powerpc: Routines for FP/VSX/VMX unavailable during a transaction Michael Neuling
2013-02-14  2:21       ` [PATCH 12/17] powerpc: Hook in new transactional memory code Michael Neuling
2013-02-14  2:21       ` [PATCH 13/17] powerpc: Add new transactional memory state to the signal context Michael Neuling
2013-02-14  2:21       ` [PATCH 14/17] powerpc: Add transactional memory to POWER8 cpu features Michael Neuling
2013-02-14  2:21       ` [PATCH 15/17] powerpc: Add config option for transactional memory Michael Neuling
2013-02-14  2:21       ` [PATCH 16/17] powerpc: Add transactional memory to pseries and ppc64 defconfigs Michael Neuling
2013-02-14  2:21       ` [PATCH 17/17] powerpc: Documentation for transactional memory on powerpc Michael Neuling

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=1360808505-10086-3-git-send-email-mikey@neuling.org \
    --to=mikey@neuling.org \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=matt@ozlabs.org \
    /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).