[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LSU.2.21.2004151633010.13470@pobox.suse.cz>
Date: Wed, 15 Apr 2020 16:34:26 +0200 (CEST)
From: Miroslav Benes <mbenes@...e.cz>
To: Josh Poimboeuf <jpoimboe@...hat.com>
cc: live-patching@...r.kernel.org, linux-kernel@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Jessica Yu <jeyu@...nel.org>
Subject: Re: [PATCH 1/7] livepatch: Apply vmlinux-specific KLP relocations
early
Just a nit below
> diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h
> index e894e74905f3..d9e9b76f6054 100644
> --- a/include/linux/livepatch.h
> +++ b/include/linux/livepatch.h
> @@ -234,14 +234,30 @@ void klp_shadow_free_all(unsigned long id, klp_shadow_dtor_t dtor);
> struct klp_state *klp_get_state(struct klp_patch *patch, unsigned long id);
> struct klp_state *klp_get_prev_state(unsigned long id);
>
> +int klp_write_relocations(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
> + const char *shstrtab, const char *strtab,
> + unsigned int symindex, struct module *pmod,
> + const char *objname);
> +
> #else /* !CONFIG_LIVEPATCH */
>
> +struct klp_object;
> +
Is the forward declaration necessary here?
> static inline int klp_module_coming(struct module *mod) { return 0; }
> static inline void klp_module_going(struct module *mod) {}
> static inline bool klp_patch_pending(struct task_struct *task) { return false; }
> static inline void klp_update_patch_state(struct task_struct *task) {}
> static inline void klp_copy_process(struct task_struct *child) {}
>
> +static inline
> +int klp_write_relocations(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
> + const char *shstrtab, const char *strtab,
> + unsigned int symindex, struct module *pmod,
> + const char *objname)
> +{
> + return 0;
> +}
> +
> #endif /* CONFIG_LIVEPATCH */
Miroslav
Powered by blists - more mailing lists