From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x225PwAzmAs4ypJvi2Ir11pZW35ZYDvzWU9whkXIXcc6bnVtx8MgyOmrqQu8BHrl12idx9Cp4 ARC-Seal: i=1; a=rsa-sha256; t=1517173608; cv=none; d=google.com; s=arc-20160816; b=po78QZDrJxG+raKNZeycYAZHA6DM1jZMKUhxuYUBCF8AC+mXeU8aQntXYTMs7eb7gq V0NUaCxDCBg00ygArtm1b8ct322a/BtbRlWn6Yyf3eI5F/T4ZUnNDY20+Ez8Z/2Fi3YZ jrbTgzM2zaLzn9IvMAnPFiYyC/TslCEAA88V3s2r6BNB9vJinWvpHHM4sesBzBKWOEF2 dYUx+v64QCX9SKoP9D2HqKBnwytuk3Yl6bNhUxzl6IneHYsVpxE6u3Ov6NFf9XaX89hS ZFfKhNwkrJZ9vYq7c+9IIULp/ExX5eiPHGYWk8mJH1xYS3XE3k78n+VDr1JHcgWIR9ch YtMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=7a+bdDSm7FjeqIxz6toA6DG1FojeN+qFdpkLEZbPcG8=; b=BJQ7vEOiqhBDxzbjyDCeAn52/CYNO6lo3d1ZAM4wI+iCEmB4xQbmxI2PO3OKj+OyRM MgU49xymSw0Kth/1vM30teG/tOJVLxS09zoqsaL5ejZKwRbAk+illag5ZDYvSS5N0VXv 7z8EqgkCUKnod9W1Sb5FX6nb97CQ8noYBgT82b9zPv6cqBgxEg2bXozK3B9+kWIvg9/E eBmkUmoTTkJ5noYW5jl/bhQliz0qiu9htfdAFzEICDfkWhNpCrEXi1ctEmD48BIwIbbD 38S3TD4mZpleyyQ87nMp/6icK+jxS0F3ErVWfaDItA00NVLiQOGUdKqANgV4DYFVnqyi c7og== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of jpoimboe@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=jpoimboe@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of jpoimboe@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=jpoimboe@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Date: Sun, 28 Jan 2018 15:06:42 -0600 From: Josh Poimboeuf To: Guenter Roeck Cc: David Woodhouse , Andi Kleen , Paul Turner , LKML , Linus Torvalds , Greg Kroah-Hartman , Tim Chen , Dave Hansen , tglx@linutronix.de, Kees Cook , Rik van Riel , Peter Zijlstra , Andy Lutomirski , Jiri Kosina , gnomes@lxorguk.ukuu.org.uk, x86@kernel.org, thomas.lendacky@amd.com Subject: Re: [v8,02/12] objtool: Allow alternatives to be ignored Message-ID: <20180128210642.xob2win53h2gztak@treble> References: <1515707194-20531-3-git-send-email-dwmw@amazon.co.uk> <20180118190931.GA27143@roeck-us.net> <20180118193315.zrrya7qo6kf7pmzp@treble> <20180118194112.GA28449@roeck-us.net> <1516649644.9521.61.camel@infradead.org> <20180122202522.GA29081@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180122202522.GA29081@roeck-us.net> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1589334210253041473?= X-GMAIL-MSGID: =?utf-8?q?1590871834287012265?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On Mon, Jan 22, 2018 at 12:25:22PM -0800, Guenter Roeck wrote: > Hi David, > > On Mon, Jan 22, 2018 at 07:34:04PM +0000, David Woodhouse wrote: > > On Thu, 2018-01-18 at 11:41 -0800, Guenter Roeck wrote: > > > > > > > Not sure, does your gcc have retpolines?  Give me your .o file and I can > > > > diagnose it. > > > >  > > > Yes, it does, only it is the gcc from the Google toolchain which may > > > generate different code than the upstream version. > > > > > > I attached an affected object file. Please let me know if there is anything else > > > I can do to help. > > Disassembly of section .text.__x86.indirect_thunk: > > > > 0000000000000000 <__x86.indirect_thunk>: > >    0: e8 04 00 00 00        callq  9 <__x86.indirect_thunk+0x9> > >    5: f3 90                 pause   > >    7: eb fc                 jmp    5 <__x86.indirect_thunk+0x5> > >    9: 48 8d 64 24 08        lea    0x8(%rsp),%rsp > >    e: c3                    retq    > > > > That has the old-style CET-incompatible retpoline in a COMDAT section > > in the .o file. What compiler options are being used for that? The > > kernel should only use retpoline if GCC supports both of > > -mindirect-branch=thunk-extern and -mindirect-branch-register, and this > > compiler is doing *neither* of those.  > > It uses "-mindirect-branch=thunk -mindirect-branch-loop=pause > -fno-jump-tables", though I don't know if that even exists in > upstream gcc (it is the gcc use for Chrome OS builds). I'll pass > your feedback to our compiler team. > > Either case, I think it is less than optimal that objtool crashes > with _any_ object code. I've got a pending fix for this, so that objtool doesn't seg fault, and instead prints out a warning: quirks.o: warning: objtool: efi_delete_dummy_variable()+0x99: unsupported intra-function call quirks.o: warning: objtool: If this is a retpoline, please patch it in with alternatives and annotate it with ANNOTATE_NOSPEC_ALTERNATIVE. The code is here, along with a few more fixes: https://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git/log/?h=TODO-objtool-seg-fault Will post it soon. -- Josh