linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhenzhong Duan <zhenzhong.duan@oracle.com>
To: Peter Zijlstra <peterz@infradead.org>
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: Thu, 1 Nov 2018 17:21:38 +0800	[thread overview]
Message-ID: <e5de6bcd-a7d1-7d48-868f-1a5168332dfc@oracle.com> (raw)
In-Reply-To: <20181101085634.GC3159@hirez.programming.kicks-ass.net>

On 2018/11/1 16:56, Peter Zijlstra wrote:
> On Thu, Nov 01, 2018 at 10:02:14AM +0800, Zhenzhong Duan wrote:
>>> Hmm, what about the case where we have RETPOLINE runtime disabled? Then
>>> the CALL_NOSPEC alternative patches in an indirect call again, and the
>>> retpolines are gone.
>>
>> Is RETPOLINE runtime toggle supported in upstream? I don't see such code.
> 
> arch/x86/kernel/cpu/bugs.c look for the "nospectre_v2" and related
> options. That will avoid X86_FEATURE_RETPOLINE from being set, and thus
> the JMP_NOSPEC and CALL_NOSPEC alternatives will not patch out the
> indirect jump / call.
> 
Yes, in this case there are also indirect branches. I'll drop 3rd patch 
in v2.

Thanks
Zhenzhong

      reply	other threads:[~2018-11-01  9:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30  6:55 [PATCH 3/3] kprobes/x86: Simplify indirect-jump check in retpoline Zhenzhong Duan
2018-10-30  8:36 ` Peter Zijlstra
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 [this message]

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=e5de6bcd-a7d1-7d48-868f-1a5168332dfc@oracle.com \
    --to=zhenzhong.duan@oracle.com \
    --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=peterz@infradead.org \
    --cc=srinivas.eeda@oracle.com \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).