From: Masami Hiramatsu <mhiramat@kernel.org>
To: Borislav Petkov <bp@alien8.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
Andrew Banman <andrew.banman@hpe.com>,
Dimitri Sivanich <dimitri.sivanich@hpe.com>,
"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mike Travis <mike.travis@hpe.com>,
"Steven Rostedt (VMware)" <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>,
Yi Wang <wang.yi59@zte.com.cn>,
linux-acpi@vger.kernel.org
Subject: Re: [PATCH] x86/kernel: Fix more -Wmissing-prototypes warnings
Date: Wed, 5 Dec 2018 22:49:06 +0900 [thread overview]
Message-ID: <20181205224906.824483ea3c5d1d5b7712c99a@kernel.org> (raw)
In-Reply-To: <20181205101131.28996-1-bp@alien8.de>
Hi Borislav,
On Wed, 5 Dec 2018 11:11:31 +0100
Borislav Petkov <bp@alien8.de> wrote:
> From: Borislav Petkov <bp@suse.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@kernel.org>
next prev parent reply other threads:[~2018-12-05 13:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-05 10:11 [PATCH] x86/kernel: Fix more -Wmissing-prototypes warnings Borislav Petkov
2018-12-05 12:44 ` Rafael J. Wysocki
2018-12-05 13:49 ` Masami Hiramatsu [this message]
2018-12-05 14:24 ` Borislav Petkov
2018-12-05 16:25 ` Ingo Molnar
2018-12-05 17:15 ` Borislav Petkov
2018-12-07 14:42 ` Masami Hiramatsu
2018-12-07 19:48 ` Borislav Petkov
2018-12-08 5:56 ` Masami Hiramatsu
2018-12-07 15:21 ` Masami Hiramatsu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181205224906.824483ea3c5d1d5b7712c99a@kernel.org \
--to=mhiramat@kernel.org \
--cc=andrew.banman@hpe.com \
--cc=bp@alien8.de \
--cc=dimitri.sivanich@hpe.com \
--cc=hpa@zytor.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.travis@hpe.com \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=wang.yi59@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox