The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Andy Whitcroft <apw@canonical.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	David Woodhouse <dwmw@amazon.co.uk>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32bit
Date: Wed, 14 Mar 2018 12:51:25 +0100	[thread overview]
Message-ID: <20180314115125.GS4043@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20180314112427.22351-1-apw@canonical.com>

On Wed, Mar 14, 2018 at 11:24:27AM +0000, Andy Whitcroft wrote:
> In 9e0e3c5130e9 ("x86/speculation, objtool: Annotate indirect calls/jumps
> for objtool") we added annotations for CALL_NOSPEC/JMP_NOSPEC on x86 64bit.
> We did not annotate the 32bit path.  Annotate it similarly.
> 
> Signed-off-by: Andy Whitcroft <apw@canonical.com>
> ---
>  arch/x86/include/asm/nospec-branch.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
>     While reviewing indirect calls in our builds I noted that the
>     i386 retpoline CALL_NOSPEC is not annotated safe even though
>     its amd64 equivalent is.  I cannot see any reason this is not
>     also inherantly safe.  Peter was there a reason that you did
>     not annotate this one too?  Anyhow, on the assumption this was
>     just missed, this patch annotates it.

Yeah, just an oversight aided by the fact that I (obviously) never build
32bit kernels.

> diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
> index d0dabeae0505..07886162bdf8 100644
> --- a/arch/x86/include/asm/nospec-branch.h
> +++ b/arch/x86/include/asm/nospec-branch.h
> @@ -183,7 +183,10 @@
>   * otherwise we'll run out of registers. We don't care about CET
>   * here, anyway.
>   */
> -# define CALL_NOSPEC ALTERNATIVE("call *%[thunk_target]\n",	\
> +# define CALL_NOSPEC 						\
> +	ALTERNATIVE(						\
> +	ANNOTATE_RETPOLINE_SAFE					\
> +	"call *%[thunk_target]\n",				\
>  	"       jmp    904f;\n"					\
>  	"       .align 16\n"					\
>  	"901:	call   903f;\n"					\

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

  reply	other threads:[~2018-03-14 11:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14 11:24 [PATCH 1/1] x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32bit Andy Whitcroft
2018-03-14 11:51 ` Peter Zijlstra [this message]
2018-03-14 12:24   ` Ingo Molnar
2018-03-14 12:28 ` [tip:x86/pti] x86/speculation, objtool: Annotate indirect calls/jumps for objtool on 32-bit kernels tip-bot for Andy Whitcroft
2018-03-14 13:03   ` Josh Poimboeuf
2018-03-14 13:39     ` Ingo Molnar
2018-03-14 13:51       ` Josh Poimboeuf

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=20180314115125.GS4043@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=apw@canonical.com \
    --cc=dwmw@amazon.co.uk \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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