summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/livepatch.h
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2016-03-24 12:04:04 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2016-04-14 07:47:06 +0200
commit5d31a96e6c0187f2c5d7004e005fd094a1277e9e (patch)
tree5d2bf3efea21bedf6a0df86b66f4c420fd06190e /arch/powerpc/include/asm/livepatch.h
parentpowerpc/livepatch: Add livepatch header (diff)
downloadlinux-5d31a96e6c0187f2c5d7004e005fd094a1277e9e.tar.xz
linux-5d31a96e6c0187f2c5d7004e005fd094a1277e9e.zip
powerpc/livepatch: Add livepatch stack to struct thread_info
In order to support live patching we need to maintain an alternate stack of TOC & LR values. We use the base of the stack for this, and store the "live patch stack pointer" in struct thread_info. Unlike the other fields of thread_info, we can not statically initialise that value, so it must be done at run time. This patch just adds the code to support that, it is not enabled until the next patch which actually adds live patch support. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Acked-by: Balbir Singh <bsingharora@gmail.com>
Diffstat (limited to 'arch/powerpc/include/asm/livepatch.h')
-rw-r--r--arch/powerpc/include/asm/livepatch.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/livepatch.h b/arch/powerpc/include/asm/livepatch.h
index ad36e8e34fa1..a402f7f94896 100644
--- a/arch/powerpc/include/asm/livepatch.h
+++ b/arch/powerpc/include/asm/livepatch.h
@@ -49,6 +49,14 @@ static inline unsigned long klp_get_ftrace_location(unsigned long faddr)
*/
return ftrace_location_range(faddr, faddr + 16);
}
+
+static inline void klp_init_thread_info(struct thread_info *ti)
+{
+ /* + 1 to account for STACK_END_MAGIC */
+ ti->livepatch_sp = (unsigned long *)(ti + 1) + 1;
+}
+#else
+static void klp_init_thread_info(struct thread_info *ti) { }
#endif /* CONFIG_LIVEPATCH */
#endif /* _ASM_POWERPC_LIVEPATCH_H */