diff options
author | Michael Neuling <mikey@neuling.org> | 2020-03-25 15:05:46 +1100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-05-20 23:39:57 +1000 |
commit | b8707e2374f68cac79de553ae1ee5c35913813bd (patch) | |
tree | 15930a6428aa1a2bed6dcca5db79fa8787144895 /Documentation/powerpc/transactional_memory.rst | |
parent | 91ffeaa7e5dd62753e23a1204dc7ecd11f26eadc (diff) | |
download | linux-b8707e2374f68cac79de553ae1ee5c35913813bd.tar.bz2 |
powerpc/tm: Document h/rfid and mtmsrd quirk
The ISA has a quirk that's useful for the Linux implementation.
Document it here so others are less likely to trip over it.
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200325040546.3091563-1-mikey@neuling.org
Diffstat (limited to 'Documentation/powerpc/transactional_memory.rst')
-rw-r--r-- | Documentation/powerpc/transactional_memory.rst | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Documentation/powerpc/transactional_memory.rst b/Documentation/powerpc/transactional_memory.rst index 09955103acb4..b5b09bf00966 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. |