From: Peter Zijlstra <peterz@infradead.org>
To: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>,
mingo@redhat.com, konrad.wilk@oracle.com, dwmw@amazon.co.uk,
tglx@linutronix.de,
Srinivas REDDY Eeda <srinivas.eeda@oracle.com>,
bp@suse.de, hpa@zytor.com
Subject: Re: [PATCH 3/3] kprobes/x86: Simplify indirect-jump check in retpoline
Date: Tue, 30 Oct 2018 09:36:50 +0100 [thread overview]
Message-ID: <20181030083650.GB1459@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <cc8f9981-f327-4238-8378-262579584db4@default>
On Mon, Oct 29, 2018 at 11:55:06PM -0700, Zhenzhong Duan wrote:
> Since CONFIG_RETPOLINE hard depends on compiler support now, so
> replacing indirect-jump check with the range check is safe in that case.
Can we put kprobes on module init text before we run alternatives on it?
> @@ -240,20 +242,16 @@ static int insn_jump_into_range(struct insn *insn, unsigned long start, int len)
>
> static int insn_is_indirect_jump(struct insn *insn)
> {
> - int ret = __insn_is_indirect_jump(insn);
> + int ret;
>
> #ifdef CONFIG_RETPOLINE
> - /*
> - * Jump to x86_indirect_thunk_* is treated as an indirect jump.
> - * Note that even with CONFIG_RETPOLINE=y, the kernel compiled with
> - * older gcc may use indirect jump. So we add this check instead of
> - * replace indirect-jump check.
> - */
> - if (!ret)
> + /* Jump to x86_indirect_thunk_* is treated as an indirect jump. */
> ret = insn_jump_into_range(insn,
> (unsigned long)__indirect_thunk_start,
> (unsigned long)__indirect_thunk_end -
> (unsigned long)__indirect_thunk_start);
> +#else
> + ret = __insn_is_indirect_jump(insn);
> #endif
> return ret;
> }
The resulting code is indented wrong.
next prev parent reply other threads:[~2018-10-30 15:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 6:55 Zhenzhong Duan
2018-10-30 8:36 ` Peter Zijlstra [this message]
2018-10-31 6:01 ` Zhenzhong Duan
2018-10-31 13:53 ` Peter Zijlstra
2018-10-31 14:00 ` Peter Zijlstra
2018-11-01 2:02 ` Zhenzhong Duan
2018-11-01 8:56 ` Peter Zijlstra
2018-11-01 9:21 ` Zhenzhong Duan
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=20181030083650.GB1459@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bp@suse.de \
--cc=dwmw@amazon.co.uk \
--cc=hpa@zytor.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=srinivas.eeda@oracle.com \
--cc=tglx@linutronix.de \
--cc=zhenzhong.duan@oracle.com \
/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
all inboxes | Powered by JetHome®