mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: Andy Lutomirski <luto@amacapital.net>,
	Andy Lutomirski <luto@kernel.org>,
	nick.desaulniers@gmail.com,
	Dave Hansen <dave.hansen@linux.intel.com>,
	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>, X86 ML <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86/mm: annotate no_context with UNWIND_HINTS
Date: Mon, 15 Oct 2018 10:31:44 -0500	[thread overview]
Message-ID: <20181015153144.buuow3yof2njjzjm@treble> (raw)
In-Reply-To: <20181015152221.GA16375@flashbox>

On Mon, Oct 15, 2018 at 08:22:21AM -0700, Nathan Chancellor wrote:
> > >>> @@ -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
> > > 
> > > Hi Andy,
> > > 
> > > Did you mean 'objdump -dr'? If so, here you go (rather long, sorry if I
> > > should have pasted it here instead):
> > > https://gist.github.com/nathanchance/f038bb0a6653b975bb8a4e64fcd5503e
> > > 
> > > 
> > 
> > Hmm, -dr wasn’t quite enough to dump the .discard bits, assuming they’re there at all. Can you just put the whole .o file somewhere?
> 
> Here you go: https://nathanchance.me/downloads/.tmp/fault.o

$ eu-readelf -S /tmp/fault.o  |grep reachable
[12] .discard.reachable   PROGBITS     0000000000000000 00002bc0 00000014  0        0   0  1
[13] .rela.discard.reachable RELA         0000000000000000 00002bd8 00000078 24 I     32  12  8

That confirms that you need a clang version of the unreachable() macro.

-- 
Josh

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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15  0:37 Nick Desaulniers
2018-10-15  3:43 ` Andy Lutomirski
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 [this message]
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=20181015153144.buuow3yof2njjzjm@treble \
    --to=jpoimboe@redhat.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=luto@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

all inboxes | Powered by JetHome®