livepatch.h (0337966d121ebebf73a1c346123e8112796e684e) | livepatch.h (ed1cd6deb013a11959d17a94e35ce159197632da) |
---|---|
1/* 2 * livepatch.h - powerpc-specific Kernel Live Patching Core 3 * 4 * Copyright (C) 2015-2016, SUSE, IBM Corp. 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version 2 --- 7 unchanged lines hidden (view full) --- 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, see <http://www.gnu.org/licenses/>. 18 */ 19#ifndef _ASM_POWERPC_LIVEPATCH_H 20#define _ASM_POWERPC_LIVEPATCH_H 21 22#include <linux/module.h> 23#include <linux/ftrace.h> | 1/* 2 * livepatch.h - powerpc-specific Kernel Live Patching Core 3 * 4 * Copyright (C) 2015-2016, SUSE, IBM Corp. 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version 2 --- 7 unchanged lines hidden (view full) --- 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, see <http://www.gnu.org/licenses/>. 18 */ 19#ifndef _ASM_POWERPC_LIVEPATCH_H 20#define _ASM_POWERPC_LIVEPATCH_H 21 22#include <linux/module.h> 23#include <linux/ftrace.h> |
24#include <linux/sched/task_stack.h> |
|
24 25#ifdef CONFIG_LIVEPATCH 26static inline int klp_check_compiler_support(void) 27{ 28 return 0; 29} 30 31static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip) --- 6 unchanged lines hidden (view full) --- 38{ 39 /* 40 * Live patch works only with -mprofile-kernel on PPC. In this case, 41 * the ftrace location is always within the first 16 bytes. 42 */ 43 return ftrace_location_range(faddr, faddr + 16); 44} 45 | 25 26#ifdef CONFIG_LIVEPATCH 27static inline int klp_check_compiler_support(void) 28{ 29 return 0; 30} 31 32static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip) --- 6 unchanged lines hidden (view full) --- 39{ 40 /* 41 * Live patch works only with -mprofile-kernel on PPC. In this case, 42 * the ftrace location is always within the first 16 bytes. 43 */ 44 return ftrace_location_range(faddr, faddr + 16); 45} 46 |
46static inline void klp_init_thread_info(struct thread_info *ti) | 47static inline void klp_init_thread_info(struct task_struct *p) |
47{ 48 /* + 1 to account for STACK_END_MAGIC */ | 48{ 49 /* + 1 to account for STACK_END_MAGIC */ |
49 ti->livepatch_sp = (unsigned long *)(ti + 1) + 1; | 50 task_thread_info(p)->livepatch_sp = end_of_stack(p) + 1; |
50} 51#else | 51} 52#else |
52static void klp_init_thread_info(struct thread_info *ti) { } | 53static inline void klp_init_thread_info(struct task_struct *p) { } |
53#endif /* CONFIG_LIVEPATCH */ 54 55#endif /* _ASM_POWERPC_LIVEPATCH_H */ | 54#endif /* CONFIG_LIVEPATCH */ 55 56#endif /* _ASM_POWERPC_LIVEPATCH_H */ |