Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752184AbeAER2z (ORCPT + 1 other); Fri, 5 Jan 2018 12:28:55 -0500 Received: from mail-io0-f176.google.com ([209.85.223.176]:38381 "EHLO mail-io0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751961AbeAER2y (ORCPT ); Fri, 5 Jan 2018 12:28:54 -0500 X-Google-Smtp-Source: ACJfBoujaM+f2oAKKT1e3wWzMhCFm5vHlrj5DVuUph4zm5kp37X6ho2i5uS7u+82bJtj+xpFsnNuOSq+NwLUMwup550= MIME-Version: 1.0 In-Reply-To: <1515172353.29312.161.camel@amazon.co.uk> References: <1515058213.12987.89.camel@amazon.co.uk> <20180104143710.8961-1-dwmw@amazon.co.uk> <1515160619.29312.126.camel@amazon.co.uk> <1515170506.29312.149.camel@amazon.co.uk> <20180105164505.xpw5pefxsyu3z56e@pd.tnic> <1515172353.29312.161.camel@amazon.co.uk> From: Linus Torvalds Date: Fri, 5 Jan 2018 09:28:52 -0800 X-Google-Sender-Auth: 2chIxCrDZax58J0Nrun8TArKRgU Message-ID: Subject: Re: [PATCH v3 01/13] x86/retpoline: Add initial retpoline support To: "Woodhouse, David" Cc: "bp@suse.de" , "linux-kernel@vger.kernel.org" , "peterz@infradead.org" , "tim.c.chen@linux.intel.com" , "tglx@linutronix.de" , "ak@linux.intel.com" , "riel@redhat.com" , "keescook@google.com" , "gnomes@lxorguk.ukuu.org.uk" , "pjt@google.com" , "dave.hansen@intel.com" , "luto@amacapital.net" , "jikos@kernel.org" , "gregkh@linux-foundation.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Fri, Jan 5, 2018 at 9:12 AM, Woodhouse, David wrote: > > I typed 'jmp __x86.indirect_thunk' and it actually jumped to an address > which I believe is (__x86.indirect_thunk + &altinstr - &oldinstr). > Which made me sad, and took a while to debug. Yes, I would suggest against expecting altinstructions to have relocation information. They are generated in a different place, so.. That said, I honestly like the inline version (the one that is in the google paper first) of the retpoline more than the out-of-line one. And that one shouldn't have any relocagtion issues, because all the offsets are relative. We want to use that one for the entry stub anyway, can't we just standardize on that one for all our assembly? If the *compiler* uses the out-of-line version, that's a separate thing. But for our asm cases, let's just make it all be the inline case, ok? It also should simplify the whole target generation. None of this silly "__x86.indirect_thunk.\reg" crap with different targets for different register choices. Hmm? Linus