Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3505078imm; Sun, 14 Oct 2018 22:17:58 -0700 (PDT) X-Google-Smtp-Source: ACcGV63OJoK+6lsJWKmYDgPusqGjtDLNnN47ogs/i3+dGERdNLk79DF5Yua5SFqCn2wVoHWcZC8F X-Received: by 2002:a17:902:7045:: with SMTP id h5-v6mr4472698plt.211.1539580678900; Sun, 14 Oct 2018 22:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539580678; cv=none; d=google.com; s=arc-20160816; b=0hULz3ZX9KU88v9P8GGJpCR1p5Dee2M2/W98q8HqHmA+wzLEouGoWL0f/ekNGTEKY4 5ftzSn178S9FnD+ELpbvHyCR3wE+s4onoy6BkwRMjHaQTZEXU/PmXdbNp99FhiYVqu79 iiX+U6ouhDJ5Gw/4NBDt/DTFBF15kEcz2AfpqwaeWf68cO6Re5ByhPFpSog2opu55nor NXIVeBYXrJFe3LJ1lfrC6uiPRRsbNND2O5/x14mU0qGtzVDtjzyIN7SCw3vTYDR/EumT OfYBrsJvoUGswiXvB9GXXfeY6dd56CMt9emvlhsxVhgXmaw4FsQ+sKUpkIRpgs85bGSX lmYw== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=G7scxTHofyfLz6cHewgOfbzH3drfg6Biu7YDoFSBCC4=; b=ZAWSAaX0j8iX02/ViSJ8JzrvQARaBbHVoezFI0BVqsQEYIhre6J8yXhLOfj1Suxx5b ncYDMqOTr7OX19Gxwa8l/Q4bMk0g5h9iWik5+2VzIKn1d1wO6Ywqow0lYg1uif4mutPs z4n88thSrtCWf3CAKbIgLiiPCIJX1kWm6XurtEd/ZQfSeVG7BgYBa+AHc65nf23W+Mjf 5h/eY9ETljc0+z+hIEdxP5IAX0FeRDhenWZscbH10yCyo2rjNejU+Ol/uH9UZzheZRQ9 uJl1kxpcDVyel6vn9RJlZbVMFw7f3B+vZxa6rir9YRyA9HGSngrYJXRWe9pyGMqJB7dT uZAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LOXbYdqo; 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 o12-v6si10092565pfh.9.2018.10.14.22.17.44; Sun, 14 Oct 2018 22:17:58 -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=LOXbYdqo; 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 S1726681AbeJONAr (ORCPT + 99 others); Mon, 15 Oct 2018 09:00:47 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:44532 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726424AbeJONAr (ORCPT ); Mon, 15 Oct 2018 09:00:47 -0400 Received: by mail-wr1-f66.google.com with SMTP id 63-v6so19614483wra.11 for ; Sun, 14 Oct 2018 22:17:09 -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:in-reply-to:user-agent; bh=G7scxTHofyfLz6cHewgOfbzH3drfg6Biu7YDoFSBCC4=; b=LOXbYdqol7i71SR7DI/E/mJiBgen6/5OLeSNeEmtfgOB1+MwEtMZnzH9aRHNlE0QyO ua1ZbjYXuk4ApPs/Co1FXBrZSiVE2tJjI0HYM64C/xnalzWvs+tyZHD/yxpjL9nuzMGQ QjcoM7lEcs19xXoUpJa5P7bbcQiWJ0+niIcNoL9fXSZBInMK8PvLNhmI1cfpoI0snKGy i7pzbKC6zWCpQ4NVStdgnSTAc7rzAze3/RxnHvMGz1f05Zo0SbJMxGTWp6dbzk4p557G QQ74ZtR9X9v31ZKB8b+cHZ3faNEOr8Brd0I21O6617ZHIiZcIauW6Zkb8f6y52vctsiQ dlqA== 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:in-reply-to:user-agent; bh=G7scxTHofyfLz6cHewgOfbzH3drfg6Biu7YDoFSBCC4=; b=b2AY54yTe92Ah8MrGVN7dbIz7JrWHfP63jmxtc40G+/1Oggrb6KlGnVOYPeJxMo/gI mq1MGeZjc3rIAMYLlHfVFeYLOvJxljxNwcLfymXD070W0RQAtE3jrXqgco99p01hEqHG cE3Ig2WmS+NoDS4ivr+KSkbjX5hTLndmclCevUSkMJJwbBKnInmhSBNU3EsMW6P7pVwH PN0sSwBjsa/oc+gr0uNs4sZwNKhAgSJkribN/N6AN2rQsu0g2trB8xCtKqb3jLf9IJgn 7iPOozaG3q/Dfn9lkKIYSNLVW7VxdsgIqldGz7jZI7VQH7qyidGKOvRzMnvcSbKo4b7A rSeQ== X-Gm-Message-State: ABuFfoi4DXizDfpA6QPnCl9t6KTbAUMBi3HI86L4QlQ6q+qtC70QYvpU hYUtqpC+lN5J8Q+xFA6fSuc8DqFJjnY= X-Received: by 2002:adf:8523:: with SMTP id 32-v6mr13565294wrh.72.1539580627986; Sun, 14 Oct 2018 22:17:07 -0700 (PDT) Received: from flashbox ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id t82-v6sm7864692wme.30.2018.10.14.22.17.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Oct 2018 22:17:07 -0700 (PDT) Date: Sun, 14 Oct 2018 22:17:05 -0700 From: Nathan Chancellor To: Andy Lutomirski Cc: 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: <20181015051705.GA20687@flashbox> References: <20181015003726.29103-1-nick.desaulniers@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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 Nathan