Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4064337imm; Mon, 15 Oct 2018 08:33:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV60z32Q3wsoQBQpi1POLcgi+XsqvuDY6DY56CgMJhYylpSmyDy7PE+BXexDKpwP/j9kKtg2B X-Received: by 2002:a63:30c8:: with SMTP id w191-v6mr16219847pgw.447.1539617592366; Mon, 15 Oct 2018 08:33:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539617592; cv=none; d=google.com; s=arc-20160816; b=wxeGZ8vOd8KSJP94jQw0I7BYZ4fDJxNy9Vjl0/k0OCg65ZlTVgUY2d7MBdKUWxclXF siJfZoTRSveH8I3ypIRalNGsaytfQEcA66lDBh6gCG2EgkKaP6bUgy/Hj10j7LiLFSPj Swrc+8GIGzjFV4wRtkDhz3xc2apqhgZ7KuZpfpeiJ/dspWO5bcRkY/hrCnkjNMg40ja5 U+uRu6cu57TaaA4q5yqCSnZ4oO5ZYxoDjNRxUnp5SHfZpWXDXN5yoiUS869+nBeZkvy/ Z5yVxwFx4tnukvQ1VlsefzyRyyyJdMefwQJi1muNO07mSByVdgsXIBxtdxkJBtKdddfd GG6Q== 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; bh=w1xmQ2iyXqrsSXntbi0UlNmL/Y8p+IkDqHnpjmhoN6k=; b=wL/ZyMCfI+77N+YlT4XFyuD97DjWUaapOl0fBtMZriurWRB+WhRsRWVatBSA140Kzs /mdXMTEWVR7JeIK98955VyN5n47ZaN6SjxZZCZIBr7Pg67P9jrUvE2G6PaIF7QE+NhF7 fF/mVJKyTcP8fWF4K+uFIoADhn1naBlMrCeO4d3oLMTFtD7Vyw4xbDxReIieEww6Mpum w2UbP5rSmkndEB7hNYjk33hqB0ob91FKp8z5aPcoxNLYgwp5MU47Ko0py2bS3s9fcIps 8FixYU8Qxf57WfAQatwWwnDOXAAcBmeV1NszW2HwDvfMS/WeUXAF0AGRPpGNgo0SkhW+ JAbA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e129-v6si11213273pgc.318.2018.10.15.08.32.57; Mon, 15 Oct 2018 08:33:12 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726953AbeJOXRd (ORCPT + 99 others); Mon, 15 Oct 2018 19:17:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17938 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726422AbeJOXRc (ORCPT ); Mon, 15 Oct 2018 19:17:32 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8F4DC3002723; Mon, 15 Oct 2018 15:31:48 +0000 (UTC) Received: from treble (ovpn-125-6.rdu2.redhat.com [10.10.125.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 99B9027C59; Mon, 15 Oct 2018 15:31:46 +0000 (UTC) Date: Mon, 15 Oct 2018 10:31:44 -0500 From: Josh Poimboeuf To: Nathan Chancellor Cc: Andy Lutomirski , Andy Lutomirski , nick.desaulniers@gmail.com, 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: <20181015153144.buuow3yof2njjzjm@treble> References: <20181015003726.29103-1-nick.desaulniers@gmail.com> <20181015051705.GA20687@flashbox> <2CCAF5D3-1B11-43BF-93E4-72C2603A184F@amacapital.net> <20181015152221.GA16375@flashbox> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181015152221.GA16375@flashbox> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 15 Oct 2018 15:31:48 +0000 (UTC) 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 08:22:21AM -0700, Nathan Chancellor wrote: > > >>> @@ -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 $ eu-readelf -S /tmp/fault.o |grep reachable [12] .discard.reachable PROGBITS 0000000000000000 00002bc0 00000014 0 0 0 1 [13] .rela.discard.reachable RELA 0000000000000000 00002bd8 00000078 24 I 32 12 8 That confirms that you need a clang version of the unreachable() macro. -- Josh