All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/tm: Document h/rfid and mtmsrd quirk
@ 2020-03-25  4:05 Michael Neuling
  2020-06-09  5:29 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Neuling @ 2020-03-25  4:05 UTC (permalink / raw)
  To: mpe; +Cc: Michael Neuling, linuxppc-dev, npiggin, Gustavo Romero

The ISA has a quirk that's useful for the Linux implementation.
Document it here so others are less likely to trip over it.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
---
 .../powerpc/transactional_memory.rst          | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/Documentation/powerpc/transactional_memory.rst b/Documentation/powerpc/transactional_memory.rst
index 09955103ac..74ae71001a 100644
--- a/Documentation/powerpc/transactional_memory.rst
+++ b/Documentation/powerpc/transactional_memory.rst
@@ -245,3 +245,30 @@ POWER9N DD2.2.
 Guest migration from POWER8 to POWER9 will work with POWER9N DD2.2 and
 POWER9C DD1.2. Since earlier POWER9 processors don't support TM
 emulation, migration from POWER8 to POWER9 is not supported there.
+
+Kernel implementation
+=====================
+
+h/rfid mtmsrd quirk
+===================
+
+As defined in the ISA, rfid has a quirk which is useful in early
+exception handling. When in a userspace transaction and we enter the
+kernel via some exception, MSR will end up as TM=0 and TS=01 (ie. TM
+off but TM suspended). Regularly the kernel will want change bits in
+the MSR and will perform an rfid to do this. In this case rfid can
+have SRR0 TM = 0 and TS = 00 (ie. TM off and non transaction) and the
+resulting MSR will retain TM = 0 and TS=01 from before (ie. stay in
+suspend). This is a quirk in the architecture as this would normally
+be a transition from TS=01 to TS=00 (ie. suspend -> non transactional)
+which is an illegal transition.
+
+This quirk is described the architecture in the definition of rfid
+with these lines:
+
+  if (MSR 29:31 ¬ = 0b010 | SRR1 29:31 ¬ = 0b000) then
+     MSR 29:31 <- SRR1 29:31
+
+hrfid and mtmsrd have the same quirk.
+
+The Linux kernel uses this quirk in it's early exception handling.
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc/tm: Document h/rfid and mtmsrd quirk
  2020-03-25  4:05 [PATCH] powerpc/tm: Document h/rfid and mtmsrd quirk Michael Neuling
@ 2020-06-09  5:29 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2020-06-09  5:29 UTC (permalink / raw)
  To: mpe, Michael Neuling; +Cc: linuxppc-dev, npiggin, Gustavo Romero

On Wed, 25 Mar 2020 15:05:46 +1100, Michael Neuling wrote:
> The ISA has a quirk that's useful for the Linux implementation.
> Document it here so others are less likely to trip over it.

Applied to powerpc/next.

[1/1] powerpc/tm: Document h/rfid and mtmsrd quirk
      https://git.kernel.org/powerpc/c/b8707e2374f68cac79de553ae1ee5c35913813bd

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-09  6:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25  4:05 [PATCH] powerpc/tm: Document h/rfid and mtmsrd quirk Michael Neuling
2020-06-09  5:29 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.