Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4053743imm; Mon, 15 Oct 2018 08:23:26 -0700 (PDT) X-Google-Smtp-Source: ACcGV61jo/e0Yh6aUizEzP7n1skj7zuplM8hDUxwKxMwVmOvD4jVkIO+/6QREmEGmnp1WZE/0GfK X-Received: by 2002:a63:f848:: with SMTP id v8-v6mr16262707pgj.82.1539617006320; Mon, 15 Oct 2018 08:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539617006; cv=none; d=google.com; s=arc-20160816; b=DJUx5iCCjEK2NTJsytghsRWFwWhG4pGNPaYgCMLb4MZv5vDRpnRy8IzzBpkZJMS9cm CQMw/rue9oLR3k+T+300aUVAXxXb3F6edRwmNhqesYGt+/ICBhTbvQ7iTpm+hrrTQoZo Q7Nyw58ffaACfAfo2VZ5aDVVMVHJa+jXvRahV/LuUtaYQ0U5JC2xYBkuGhJFTSisNHG9 wYhupCec7ocaZzRN00vZ8TpTK974MgUSLlDfbnuoEpRXTi4uF6ipOTK3jCGn6EpkTCWu rpAiuPY4UNDEMbYfMSXLUhziAueXeTc71QZ7Ous0vL4S8n191cPpRL12TpQXR9xcZKf2 ghfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Y1VfnFGwCv0ySMyMdQcTkAYnhJ4OYown2fCIIp61nbY=; b=a2xG4a36Fi2gTdQRQQlfFx9XaqMjhCcGfZTGGWYY1Q+iD8hRtaSNtlwXDk4y568Ey4 1AvRlUS6+gGxzXpJ1bYs/gR5GpIhQSFUoX6OPBq9m/JhmrXfv745kqYIKSzPd0SA5Aq3 Eu5oycWghiwQMyb/L+ssbVOcRpiuiqzomx2QqC7eNwM3KGADzfUkL3Q/bwkdkhQ73klb llHr1MmVrfZ/uHFmKv7x8emzYuVjJG7OAzj3j/iE/hJTo9b/ScRKEYZHabfQYJaYnVDM Qx2aF/AJIXMQRR04BUTxQKVCRGdqDYgn8B5hSHgD0Vm4PbnHmh17FuR3FSVWKVyonMuE YUGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZGPBK2mK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k19-v6si11244725pfb.216.2018.10.15.08.23.11; Mon, 15 Oct 2018 08:23:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZGPBK2mK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbeJOXII (ORCPT + 99 others); Mon, 15 Oct 2018 19:08:08 -0400 Received: from mail-wm1-f48.google.com ([209.85.128.48]:36699 "EHLO mail-wm1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726545AbeJOXII (ORCPT ); Mon, 15 Oct 2018 19:08:08 -0400 Received: by mail-wm1-f48.google.com with SMTP id a8-v6so20008420wmf.1 for ; Mon, 15 Oct 2018 08:22:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Y1VfnFGwCv0ySMyMdQcTkAYnhJ4OYown2fCIIp61nbY=; b=ZGPBK2mKffyL7uPrhO70FBP/TDHvMfeLwKRMlK5hd+DslhBGFcmUdq8hqJtF8hWuxQ Vxxn3pPI87Y+CeCF+j04EBr4Kzyz8LR5+B5QwlC9oV5NL/kMphIF9D071MYpMLRJxecQ hY2h02PFNfETuTgsm8nD4oQ/ZcvCt0aWL5zr9LmPDDmdX2oHSttiQXqYgfDpnNCEwH0O OwywMNG1DtLeFfm2aVC84mCeM79iEeO5xt41Dvb1MyFDafYTzHTPOWTcEBTan4qH5V3Y ueRjWlgU1jEmwk6C6XZTmcPvTvS/opo/QxENcbqFLOrrqYNCPqoPgsqdlOTIP08XxlOR ZTnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Y1VfnFGwCv0ySMyMdQcTkAYnhJ4OYown2fCIIp61nbY=; b=XdTOFEC+5l0GcGqKC4l2vXyMZIxP9I8xZTRdPhEnltBTzLFr1m+J1dezKYgm9hj5U6 USAtc4PyQpEYAKao515+dR1lqZI45eCUJKiKeQRC1WnHZ000tcGxApEWjQ1Hl1FrSFR5 rCsZyWYny0kcoBUemL0ZwjfkXGXnTd4yllEi3tCd4cvt3GGuJDMKTH9GB9yV2kSQmrjA 4/1JAaD98sVf2EpklmWO23Mh8iuIyFM1uDR/8FU9+qDJdSO5wowadj/Ro9hfDSKo8T8E nl2X4cBTmRdLGvLjII8dsFG1NgY/lcl3ZyGsk/L6JU7M15WT0UIwW/UgJ7bIGjmJrvlR e0QQ== X-Gm-Message-State: ABuFfoiTTCG2RXGCJCvlbAOWMSGPFqbCMk5RAzvy7NTRs9tvosdACQi2 j6zy2zbhm1FdFj/YsgVAlnE= X-Received: by 2002:a1c:d04e:: with SMTP id h75-v6mr14003619wmg.92.1539616944228; Mon, 15 Oct 2018 08:22:24 -0700 (PDT) Received: from flashbox ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id l140-v6sm11099199wmb.24.2018.10.15.08.22.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Oct 2018 08:22:23 -0700 (PDT) Date: Mon, 15 Oct 2018 08:22:21 -0700 From: Nathan Chancellor To: Andy Lutomirski Cc: Andy Lutomirski , nick.desaulniers@gmail.com, Josh Poimboeuf , Dave Hansen , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , X86 ML , LKML Subject: Re: [PATCH] x86/mm: annotate no_context with UNWIND_HINTS Message-ID: <20181015152221.GA16375@flashbox> References: <20181015003726.29103-1-nick.desaulniers@gmail.com> <20181015051705.GA20687@flashbox> <2CCAF5D3-1B11-43BF-93E4-72C2603A184F@amacapital.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2CCAF5D3-1B11-43BF-93E4-72C2603A184F@amacapital.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 15, 2018 at 07:34:14AM -0700, Andy Lutomirski wrote: > > > > On Oct 14, 2018, at 10:17 PM, Nathan Chancellor 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 > >> 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 > >>> --- > >>> 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? Here you go: https://nathanchance.me/downloads/.tmp/fault.o Thanks, Nathan