]>
Commit | Line | Data |
---|---|---|
b700e7f0 SJ |
1 | /* |
2 | * livepatch.h - x86-specific Kernel Live Patching Core | |
3 | * | |
4 | * Copyright (C) 2014 Seth Jennings <sjenning@redhat.com> | |
5 | * Copyright (C) 2014 SUSE | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or | |
8 | * modify it under the terms of the GNU General Public License | |
9 | * as published by the Free Software Foundation; either version 2 | |
10 | * of the License, or (at your option) any later version. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with this program; if not, see <http://www.gnu.org/licenses/>. | |
19 | */ | |
20 | ||
21 | #ifndef _ASM_X86_LIVEPATCH_H | |
22 | #define _ASM_X86_LIVEPATCH_H | |
23 | ||
5d4351ba | 24 | #include <asm/setup.h> |
b700e7f0 | 25 | #include <linux/module.h> |
b5bfc517 | 26 | #include <linux/ftrace.h> |
b700e7f0 | 27 | |
12cf89b5 | 28 | #ifdef CONFIG_LIVEPATCH |
b9dfe0be JK |
29 | static inline int klp_check_compiler_support(void) |
30 | { | |
b700e7f0 | 31 | #ifndef CC_USING_FENTRY |
b9dfe0be | 32 | return 1; |
b700e7f0 | 33 | #endif |
b9dfe0be JK |
34 | return 0; |
35 | } | |
4421f8f0 MB |
36 | int klp_write_module_reloc(struct module *mod, unsigned long type, |
37 | unsigned long loc, unsigned long value); | |
b700e7f0 | 38 | |
b5bfc517 LB |
39 | static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip) |
40 | { | |
41 | regs->ip = ip; | |
42 | } | |
b700e7f0 | 43 | #else |
12cf89b5 | 44 | #error Live patching support is disabled; check CONFIG_LIVEPATCH |
b700e7f0 SJ |
45 | #endif |
46 | ||
47 | #endif /* _ASM_X86_LIVEPATCH_H */ |