Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3442896imm; Sun, 14 Oct 2018 20:44:09 -0700 (PDT) X-Google-Smtp-Source: ACcGV60WzDJj7w2y0HIZe3EXV1fVmY5wbdqi9yur1JBklq6BOJ0oWO+wqBXV4EgoPKT9gIH9eBfw X-Received: by 2002:a62:642:: with SMTP id 63-v6mr15667411pfg.190.1539575049898; Sun, 14 Oct 2018 20:44:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539575049; cv=none; d=google.com; s=arc-20160816; b=G4G8sgwE8K6q3qfTyAl4w59eZWELpqUyCUn3S0dfcRuWIOGxaxZDBUNB5y3X5ltQ/3 Nb9sFOdiLS+fr/mn1y0g9vhFrOEMx8kmdaaLYUnJkxLmkq3OrCcNnl6un79ljLTbEI7K r1BmTWrpKXajipcnm82FMn8fZSSueFzsqUlRrweF5jyCtR27tZYUPRc3ZjbPEuIlJX4y oEjtNYTjo/h1Z8Syt+woIAPK52j22V/NgUcuSAv922NxcJZxK2EEb4MuUpZOpHX1Whk8 /PrVeIarByWWDZVDlTE0FYHw/xh6Hprc11qCXhJqzf+S/ZZ7BSz/rXznbavSkBJLcjPd t3mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Z6uGDXRf3CpCfa0P8qKNxa2wLafqLjGsVTQfQmztaqs=; b=aN0l5AZD4rm8Rfqm5dcAec/2ht3ENntsPd0XYWqMWEFq1L0tq87cc8Coo2EW1fVMna 578Y25ERPiAC35WIpPnSfWjWycyDbnCmWitb35vO1MidDB7tAd9pTDPHogrBgvccijYA 9049T506gwLW+ZiTHkzBr5g57CjYvEYLbv1e7X8HpQGCu3Pd5ha/y4SPbHb88o/eydQ5 dJnckf7ccAWYZZsT3qiZpZjOWFV++CzwzDTHB1iILtFa11xJrqQ5eAMIWhq2k9/fGmEl 7+3wv0R/lhSbY5lT2GEws0VMMFmFau9WBxnVDzwb3UdIqN+814zDauuAw4ussvOH8UDX mn/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0BIArQ4c; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g136-v6si6168017pfb.196.2018.10.14.20.43.53; Sun, 14 Oct 2018 20:44:09 -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=@kernel.org header.s=default header.b=0BIArQ4c; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726536AbeJOL0x (ORCPT + 99 others); Mon, 15 Oct 2018 07:26:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:49116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbeJOL0w (ORCPT ); Mon, 15 Oct 2018 07:26:52 -0400 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 476B320895 for ; Mon, 15 Oct 2018 03:43:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539575011; bh=eXlhtT/0yW/EpHseOYQMo5PoWvMH6BDErrGmYMeqKKA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=0BIArQ4ccTwJRjHQCGOWdIKWxT2gX3B330dbRrVyIBvNEsKK5gVmp4hKt/ppwGwe8 MDpqrSM/u04FkOP5Wpfx2jpEsKoI9UpKlTp93zJ8NSb5C9aMXi0km+/kmUWvTjAj5o 7E43YbF0+a1MBbexbsS2grNu9yg9DoHV82mmcvnc= Received: by mail-wm1-f51.google.com with SMTP id 193-v6so18005457wme.3 for ; Sun, 14 Oct 2018 20:43:31 -0700 (PDT) X-Gm-Message-State: ABuFfohe0KFVyyAWD0ZQplwbiwHsyB7B/9J6AWUVf+udyo9Fs26z1Zzh oOHVgom3k7B6QvRggpD5v71XFQT+Klp5Q85pv24Vvg== X-Received: by 2002:a1c:f312:: with SMTP id q18-v6mr11544011wmq.14.1539575009617; Sun, 14 Oct 2018 20:43:29 -0700 (PDT) MIME-Version: 1.0 References: <20181015003726.29103-1-nick.desaulniers@gmail.com> In-Reply-To: <20181015003726.29103-1-nick.desaulniers@gmail.com> From: Andy Lutomirski Date: Sun, 14 Oct 2018 20:43:18 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86/mm: annotate no_context with UNWIND_HINTS To: nick.desaulniers@gmail.com, Josh Poimboeuf Cc: Dave Hansen , Andrew Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , natechancellor@gmail.com, X86 ML , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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