linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@kernel.org>
To: nick.desaulniers@gmail.com, Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	Andrew Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	natechancellor@gmail.com, X86 ML <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86/mm: annotate no_context with UNWIND_HINTS
Date: Sun, 14 Oct 2018 20:43:18 -0700	[thread overview]
Message-ID: <CALCETrUZoBtxoR9u=72CSmNa-793EZySMd7TjH_BmHcrNSvLZg@mail.gmail.com> (raw)
In-Reply-To: <20181015003726.29103-1-nick.desaulniers@gmail.com>

On Sun, Oct 14, 2018 at 5:37 PM Nick Desaulniers
<nick.desaulniers@gmail.com> wrote:
>
> Fixes the objtool warning:
> arch/x86/mm/fault.o: warning: objtool: no_context()+0x220: unreachable
> instruction
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/204
> Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
> ---
>  arch/x86/mm/fault.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
> index 47bebfe6efa7..057d2178fa19 100644
> --- a/arch/x86/mm/fault.c
> +++ b/arch/x86/mm/fault.c
> @@ -760,9 +760,11 @@ no_context(struct pt_regs *regs, unsigned long error_code,
>                  * and then double-fault, though, because we're likely to
>                  * break the console driver and lose most of the stack dump.
>                  */
> -               asm volatile ("movq %[stack], %%rsp\n\t"
> +               asm volatile (UNWIND_HINT_SAVE
> +                             "movq %[stack], %%rsp\n\t"
>                               "call handle_stack_overflow\n\t"
> -                             "1: jmp 1b"
> +                             "1: jmp 1b\n\t"
> +                             UNWIND_HINT_RESTORE
>                               : ASM_CALL_CONSTRAINT
>                               : "D" ("kernel stack overflow (page fault)"),
>                                 "S" (regs), "d" (address),

NAK.  Just below this snippet is unreachable();

Can you reply with objtool -dr output on a problematic fault.o?  Josh,
it *looks* like annotate_unreachable() should be doing the right
thing, but something is clearly busted.

Also, shouldn't compiler-clang.h contain a reasonable definition of
unreachable()?

--Andy

  reply	other threads:[~2018-10-15  3:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15  0:37 [PATCH] x86/mm: annotate no_context with UNWIND_HINTS Nick Desaulniers
2018-10-15  3:43 ` Andy Lutomirski [this message]
2018-10-15  5:17   ` Nathan Chancellor
2018-10-15 14:22     ` Josh Poimboeuf
2018-10-15 14:34     ` Andy Lutomirski
2018-10-15 15:22       ` Nathan Chancellor
2018-10-15 15:31         ` Josh Poimboeuf
2018-10-15 16:03           ` Andy Lutomirski
2018-10-15 16:07             ` Nathan Chancellor
2018-10-15 16:20             ` Josh Poimboeuf
2018-10-15 16:57             ` Nick Desaulniers
2018-10-15 17:23               ` Nick Desaulniers

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='CALCETrUZoBtxoR9u=72CSmNa-793EZySMd7TjH_BmHcrNSvLZg@mail.gmail.com' \
    --to=luto@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=natechancellor@gmail.com \
    --cc=nick.desaulniers@gmail.com \
    --cc=peterz@infradead.org \
    --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;
as well as URLs for NNTP newsgroup(s).