[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181205224906.824483ea3c5d1d5b7712c99a@kernel.org>
Date: Wed, 5 Dec 2018 22:49:06 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Borislav Petkov <bp@...en8.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Andrew Banman <andrew.banman@....com>,
Dimitri Sivanich <dimitri.sivanich@....com>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Mike Travis <mike.travis@....com>,
"Steven Rostedt (VMware)" <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
Yi Wang <wang.yi59@....com.cn>, linux-acpi@...r.kernel.org
Subject: Re: [PATCH] x86/kernel: Fix more -Wmissing-prototypes warnings
Hi Borislav,
On Wed, 5 Dec 2018 11:11:31 +0100
Borislav Petkov <bp@...en8.de> wrote:
> From: Borislav Petkov <bp@...e.de>
>
> ... with the goal of eventually enabling -Wmissing-prototypes by
> default. At least on x86.
>
> Make functions static where possible, otherwise add prototypes or make
> them visible through includes.
OK, and I have some comments for kprobe's parts.
[...]
> diff --git a/arch/x86/kernel/kprobes/common.h b/arch/x86/kernel/kprobes/common.h
> index 2b949f4fd4d8..f0fc628c4bb7 100644
> --- a/arch/x86/kernel/kprobes/common.h
> +++ b/arch/x86/kernel/kprobes/common.h
> @@ -91,6 +91,8 @@ extern int __copy_instruction(u8 *dest, u8 *src, u8 *real, struct insn *insn);
> extern void synthesize_reljump(void *dest, void *from, void *to);
> extern void synthesize_relcall(void *dest, void *from, void *to);
>
> +extern void *trampoline_handler(struct pt_regs *regs);
> +
I would like to put this prototype inside arch/x86/kernel/kprobes/core.c,
since that is locally used.
> #ifdef CONFIG_OPTPROBES
> extern int setup_detour_execution(struct kprobe *p, struct pt_regs *regs, int reenter);
> extern unsigned long __recover_optprobed_insn(kprobe_opcode_t *buf, unsigned long addr);
[...]
> diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
> index e909413e4e38..91d19d6a2892 100644
> --- a/include/linux/kprobes.h
> +++ b/include/linux/kprobes.h
> @@ -379,6 +379,9 @@ int enable_kprobe(struct kprobe *kp);
>
> void dump_kprobe(struct kprobe *kp);
>
> +void __weak *alloc_insn_page(void);
> +void __weak free_insn_page(void *page);
Should we declare prototypes for __weak functions? Anyway, we should remove
__weak from the prototypes.
Thank you,
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists