Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3999315imm; Mon, 15 Oct 2018 07:34:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV60bk7KBIGAl1rLkeVPeVzWB1JBYjCImB2aYR9Hc1cTIMsLd1Dh9gBGeE4ZoKMMIFDrJ9dgR X-Received: by 2002:a17:902:4001:: with SMTP id b1-v6mr17583481pld.89.1539614096696; Mon, 15 Oct 2018 07:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539614096; cv=none; d=google.com; s=arc-20160816; b=M4X2fujN70lSagBZWwdCymCNkhZ7xskemnnrm3GSrps5zZGjA4GxoAs+lRf+8jgQvC boS6Y0oktILwRQNXpNPKGdDtdxyZkk5SSPzrvbQoxXdv6HyAT8qGSffO4s+fijW/0IgU aCkWYjMTOo3pPDOehgx5G1SUY2WJvF8lvOpATg27fuwIWlutU9dX780yjyUhUVoEmMYD SpDVw4Hp/ECJ+P2W76lspfdJtl48i2vfftjFufw9ylG2mIi29I/80Fj9aTmKTyloMQx9 Zq+bXpitwXI3byhs0iPDr0vDOSqx/Tj6cuQ+ps3olDzIXLwHLu/1KG8oDVKnaIxBCej4 YQ6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=hpZkYp1Yf6YBX/Aa7c+FCQ2Rb3agjYTIhO0baQKGCDY=; b=WaEBeVP0sAKHteIX6kXMPOKKZurPDO3ps2p3qkGg/4evH7zILEdRop5ArnR/MYKfpB h83TPS5tCiXTZT1tQ8y+NqbI0HBc+G80JAd1nVD5yGtg7cM9TcaheI8R/+EoPYOpRiEj rXART/ltKKUUdXoK0pOBlcLC5ZG9/S8WQ9+hWEsXdY/MP6S9uvxf7vgULA/BfFdiNK+Q hBR+6ygBPM5aSs8kSExwqGjGU/WUEfgMWuJtFDDpR6KfZH+FAwciojl4jwdjAO/nsWLP uxoS1kQBG4szxDuVTvSaPcvtp7fs6a4uGYdc0ovJgwqXmc2DqOj5nx5e4lLNE6+00Wjv SuLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=v7VCPbMj; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12-v6si4621067plv.147.2018.10.15.07.34.39; Mon, 15 Oct 2018 07:34:56 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=v7VCPbMj; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726653AbeJOWTs (ORCPT + 99 others); Mon, 15 Oct 2018 18:19:48 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:42284 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726571AbeJOWTs (ORCPT ); Mon, 15 Oct 2018 18:19:48 -0400 Received: by mail-pl1-f196.google.com with SMTP id c8-v6so9395436plo.9 for ; Mon, 15 Oct 2018 07:34:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=hpZkYp1Yf6YBX/Aa7c+FCQ2Rb3agjYTIhO0baQKGCDY=; b=v7VCPbMjQgH/Vma5a8LLRjcJPzlcai9+lQisdF85II8koTl2IbBph0xYzr7/OqG0pX ewpDIPuasF9rDpbs7qFT/zkVyUCo1gMJcBJLIL22pIRsT4wBDYUkDOYaZr5aLWNPX9gC pq82HQZMCTF5uCPf/Dk4R/Cu5MA4HTVORKIsvqwIzOVxvF1VQA+6O+gFAuvPuOVXO39h cythAaxngsaJURCet7aMeIvXB15nwG9+BFVj4ZmEdBzntZAT2EgCnaEvEspm+0FhqCLW sCWUoONaKBMj9OdW5yh0mRuojGnr8b5GuSmBfW9qXSDaQFnvnwe2b0aTJnvz6/vzUMXe 3KOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=hpZkYp1Yf6YBX/Aa7c+FCQ2Rb3agjYTIhO0baQKGCDY=; b=CLIUTuo+GV17N6fx0C1C0k3tAsWWBoTUsmbs8ZO1u2ySXpi9aPYJVVgDz94ErZ28HL OJHocFwbNdAwybGg1OmIQNWymk40R704OEfhgEvUYbTTxIQFTMmFfrOLTRZi/HX+IrZh lYTgy2K9z5syToFaQamNGUmw0hPf4daVkI5ov7xPlTW3aA65I+4w8S/dJjSJpSdIoNmH vR77dc42HBWTeUw8P1SrR8OSvM/L277+uoNjUEPUZ3+z+XAkup/9XyVDfl9zT+4VPcfK rS3kBCx5IQ1TqJH+FCnzTzhW0QFa8YRBPW5zyXAEKkwfDM369BPxMCxIaSpbs9K9ldiP xqnw== X-Gm-Message-State: ABuFfojj+Nkx0Ej5eTP7Df+emdaziQsNVvWnxAwr+giMnE5/ew+vPfRo 3RBuUcapHrLamhXBG6MnXB7abA== X-Received: by 2002:a17:902:7142:: with SMTP id u2-v6mr17528297plm.154.1539614056020; Mon, 15 Oct 2018 07:34:16 -0700 (PDT) Received: from ?IPv6:2601:646:c200:7429:256b:27ea:55f0:e526? ([2601:646:c200:7429:256b:27ea:55f0:e526]) by smtp.gmail.com with ESMTPSA id x73-v6sm15333631pfk.139.2018.10.15.07.34.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 07:34:14 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] x86/mm: annotate no_context with UNWIND_HINTS From: Andy Lutomirski X-Mailer: iPhone Mail (16A366) In-Reply-To: <20181015051705.GA20687@flashbox> Date: Mon, 15 Oct 2018 07:34:14 -0700 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 Content-Transfer-Encoding: quoted-printable Message-Id: <2CCAF5D3-1B11-43BF-93E4-72C2603A184F@amacapital.net> References: <20181015003726.29103-1-nick.desaulniers@gmail.com> <20181015051705.GA20687@flashbox> To: Nathan Chancellor Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Oct 14, 2018, at 10:17 PM, Nathan Chancellor = wrote: >=20 >> 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: >>>=20 >>> Fixes the objtool warning: >>> arch/x86/mm/fault.o: warning: objtool: no_context()+0x220: unreachable >>> instruction >>>=20 >>> 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(-) >>>=20 >>> 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 erro= r_code, >>> * and then double-fault, though, because we're likely to= >>> * break the console driver and lose most of the stack du= mp. >>> */ >>> - 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), >>=20 >> NAK. Just below this snippet is unreachable(); >>=20 >> 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. >>=20 >> Also, shouldn't compiler-clang.h contain a reasonable definition of >> unreachable()? >>=20 >> --Andy >=20 > Hi Andy, >=20 > 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 >=20 >=20 Hmm, -dr wasn=E2=80=99t quite enough to dump the .discard bits, assuming the= y=E2=80=99re there at all. Can you just put the whole .o file somewhere?=