Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Export tm_enable()/tm_disable/tm_abort() APIs

This patch exports tm_enable()/tm_disable/tm_abort() APIs, which
will be used for PR KVM transactional memory logic.

Signed-off-by: Simon Guo <wei.guo.simon@gmail.com>
Reviewed-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Simon Guo and committed by
Michael Ellerman
eacbb218 ab3759b5

+16 -2
+3
arch/powerpc/include/asm/asm-prototypes.h
··· 141 141 void pnv_power9_force_smt4_catch(void); 142 142 void pnv_power9_force_smt4_release(void); 143 143 144 + void tm_enable(void); 145 + void tm_disable(void); 146 + void tm_abort(uint8_t cause); 144 147 #endif /* _ASM_POWERPC_ASM_PROTOTYPES_H */
-2
arch/powerpc/include/asm/tm.h
··· 10 10 11 11 #ifndef __ASSEMBLY__ 12 12 13 - extern void tm_enable(void); 14 13 extern void tm_reclaim(struct thread_struct *thread, 15 14 uint8_t cause); 16 15 extern void tm_reclaim_current(uint8_t cause); 17 16 extern void tm_recheckpoint(struct thread_struct *thread); 18 - extern void tm_abort(uint8_t cause); 19 17 extern void tm_save_sprs(struct thread_struct *thread); 20 18 extern void tm_restore_sprs(struct thread_struct *thread); 21 19
+12
arch/powerpc/kernel/tm.S
··· 12 12 #include <asm/ptrace.h> 13 13 #include <asm/reg.h> 14 14 #include <asm/bug.h> 15 + #include <asm/export.h> 15 16 16 17 #ifdef CONFIG_VSX 17 18 /* See fpu.S, this is borrowed from there */ ··· 56 55 or r4, r4, r3 57 56 mtmsrd r4 58 57 1: blr 58 + EXPORT_SYMBOL_GPL(tm_enable); 59 + 60 + _GLOBAL(tm_disable) 61 + mfmsr r4 62 + li r3, MSR_TM >> 32 63 + sldi r3, r3, 32 64 + andc r4, r4, r3 65 + mtmsrd r4 66 + blr 67 + EXPORT_SYMBOL_GPL(tm_disable); 59 68 60 69 _GLOBAL(tm_save_sprs) 61 70 mfspr r0, SPRN_TFHAR ··· 89 78 _GLOBAL(tm_abort) 90 79 TABORT(R3) 91 80 blr 81 + EXPORT_SYMBOL_GPL(tm_abort); 92 82 93 83 /* void tm_reclaim(struct thread_struct *thread, 94 84 * uint8_t cause)
+1
arch/powerpc/mm/hash_utils_64.c
··· 64 64 #include <asm/trace.h> 65 65 #include <asm/ps3.h> 66 66 #include <asm/pte-walk.h> 67 + #include <asm/asm-prototypes.h> 67 68 68 69 #ifdef DEBUG 69 70 #define DBG(fmt...) udbg_printf(fmt)