[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <2CCAF5D3-1B11-43BF-93E4-72C2603A184F@amacapital.net>
Date: Mon, 15 Oct 2018 07:34:14 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Nathan Chancellor <natechancellor@...il.com>
Cc: Andy Lutomirski <luto@...nel.org>, nick.desaulniers@...il.com,
Josh Poimboeuf <jpoimboe@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>, X86 ML <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86/mm: annotate no_context with UNWIND_HINTS
> On Oct 14, 2018, at 10:17 PM, Nathan Chancellor <natechancellor@...il.com> wrote:
>
>> On Sun, Oct 14, 2018 at 08:43:18PM -0700, Andy Lutomirski wrote:
>> On Sun, Oct 14, 2018 at 5:37 PM Nick Desaulniers
>> <nick.desaulniers@...il.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@...il.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
>
> 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?
Powered by blists - more mailing lists