Loading arch/x86/include/asm/livepatch.h +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #ifndef _ASM_X86_LIVEPATCH_H #define _ASM_X86_LIVEPATCH_H #include <asm/setup.h> #include <linux/module.h> #include <linux/ftrace.h> Loading arch/x86/include/asm/setup.h +7 −0 Original line number Diff line number Diff line Loading @@ -60,17 +60,24 @@ static inline void x86_ce4100_early_setup(void) { } #ifndef _SETUP #include <asm/espfix.h> #include <linux/kernel.h> /* * This is set up by the setup-routine at boot-time */ extern struct boot_params boot_params; extern char _text[]; static inline bool kaslr_enabled(void) { return !!(boot_params.hdr.loadflags & KASLR_FLAG); } static inline unsigned long kaslr_offset(void) { return (unsigned long)&_text - __START_KERNEL; } /* * Do NOT EVER look at the BIOS memory size location. * It does not work on many machines. Loading arch/x86/kernel/machine_kexec_64.c +2 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <asm/io_apic.h> #include <asm/debugreg.h> #include <asm/kexec-bzimage64.h> #include <asm/setup.h> #ifdef CONFIG_KEXEC_FILE static struct kexec_file_ops *kexec_file_loaders[] = { Loading Loading @@ -334,7 +335,7 @@ void arch_crash_save_vmcoreinfo(void) VMCOREINFO_LENGTH(node_data, MAX_NUMNODES); #endif vmcoreinfo_append_str("KERNELOFFSET=%lx\n", (unsigned long)&_text - __START_KERNEL); kaslr_offset()); } /* arch-dependent functionality related to kexec file-based syscall */ Loading arch/x86/kernel/setup.c +1 −1 Original line number Diff line number Diff line Loading @@ -834,7 +834,7 @@ dump_kernel_offset(struct notifier_block *self, unsigned long v, void *p) { if (kaslr_enabled()) { pr_emerg("Kernel Offset: 0x%lx from 0x%lx (relocation range: 0x%lx-0x%lx)\n", (unsigned long)&_text - __START_KERNEL, kaslr_offset(), __START_KERNEL, __START_KERNEL_map, MODULES_VADDR-1); Loading include/linux/livepatch.h +7 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ struct klp_object { struct klp_func *funcs; /* internal */ struct kobject *kobj; struct kobject kobj; struct module *mod; enum klp_state state; }; Loading @@ -123,6 +123,12 @@ struct klp_patch { enum klp_state state; }; #define klp_for_each_object(patch, obj) \ for (obj = patch->objs; obj->funcs; obj++) #define klp_for_each_func(obj, func) \ for (func = obj->funcs; func->old_name; func++) int klp_register_patch(struct klp_patch *); int klp_unregister_patch(struct klp_patch *); int klp_enable_patch(struct klp_patch *); Loading Loading
arch/x86/include/asm/livepatch.h +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #ifndef _ASM_X86_LIVEPATCH_H #define _ASM_X86_LIVEPATCH_H #include <asm/setup.h> #include <linux/module.h> #include <linux/ftrace.h> Loading
arch/x86/include/asm/setup.h +7 −0 Original line number Diff line number Diff line Loading @@ -60,17 +60,24 @@ static inline void x86_ce4100_early_setup(void) { } #ifndef _SETUP #include <asm/espfix.h> #include <linux/kernel.h> /* * This is set up by the setup-routine at boot-time */ extern struct boot_params boot_params; extern char _text[]; static inline bool kaslr_enabled(void) { return !!(boot_params.hdr.loadflags & KASLR_FLAG); } static inline unsigned long kaslr_offset(void) { return (unsigned long)&_text - __START_KERNEL; } /* * Do NOT EVER look at the BIOS memory size location. * It does not work on many machines. Loading
arch/x86/kernel/machine_kexec_64.c +2 −1 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ #include <asm/io_apic.h> #include <asm/debugreg.h> #include <asm/kexec-bzimage64.h> #include <asm/setup.h> #ifdef CONFIG_KEXEC_FILE static struct kexec_file_ops *kexec_file_loaders[] = { Loading Loading @@ -334,7 +335,7 @@ void arch_crash_save_vmcoreinfo(void) VMCOREINFO_LENGTH(node_data, MAX_NUMNODES); #endif vmcoreinfo_append_str("KERNELOFFSET=%lx\n", (unsigned long)&_text - __START_KERNEL); kaslr_offset()); } /* arch-dependent functionality related to kexec file-based syscall */ Loading
arch/x86/kernel/setup.c +1 −1 Original line number Diff line number Diff line Loading @@ -834,7 +834,7 @@ dump_kernel_offset(struct notifier_block *self, unsigned long v, void *p) { if (kaslr_enabled()) { pr_emerg("Kernel Offset: 0x%lx from 0x%lx (relocation range: 0x%lx-0x%lx)\n", (unsigned long)&_text - __START_KERNEL, kaslr_offset(), __START_KERNEL, __START_KERNEL_map, MODULES_VADDR-1); Loading
include/linux/livepatch.h +7 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ struct klp_object { struct klp_func *funcs; /* internal */ struct kobject *kobj; struct kobject kobj; struct module *mod; enum klp_state state; }; Loading @@ -123,6 +123,12 @@ struct klp_patch { enum klp_state state; }; #define klp_for_each_object(patch, obj) \ for (obj = patch->objs; obj->funcs; obj++) #define klp_for_each_func(obj, func) \ for (func = obj->funcs; func->old_name; func++) int klp_register_patch(struct klp_patch *); int klp_unregister_patch(struct klp_patch *); int klp_enable_patch(struct klp_patch *); Loading