Received: by 10.223.176.46 with SMTP id f43csp2419907wra; Thu, 25 Jan 2018 09:33:07 -0800 (PST) X-Google-Smtp-Source: AH8x226DfZhRdxzQ2n/xx7/wwCkr6S/9KIYkg70gpmfLVK3zc8bEnHQHPQtYXoHyjVy7zOfNj7KZ X-Received: by 2002:a17:902:6683:: with SMTP id e3-v6mr11769432plk.22.1516901587198; Thu, 25 Jan 2018 09:33:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516901587; cv=none; d=google.com; s=arc-20160816; b=fZPwDWm7W4rDBNQ/IvjBULKwxJ1iHKAfj5aFD9iISS7gov9oCBzrGvTz3l9c4MQRAv tKBRn01QWWzk9fRyU1Srd1L94eBqpsR8tw2B+mGAKqvU0OYeQ8CEQUH2J5cor77tKFwB nk8jo4L4bkhHU/Wy/52b4aLP6EFUQNrs59tGF4Sx//YEIQuq9r/06mZYRWJDo13ngVsj AkAZfsKAJqJ+BxY6wet8t89vkHYWGi/nAJxzpJMyt3YF3SqYL/+ty04A0Hq/9A0g32OO dELVqPzdhB50WEgWzUo/eFrqUApHIJ1ewr77s7ZmLNIPgHEaqeHrbd/ivrdTZuCKiSwn FWbQ== 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 :arc-authentication-results; bh=XmZ1J8V0mmn6au2IaoU79FWnSP5OCD9WZuKLJzJTtL0=; b=Dw8HFZDwZXOUe9yBPyCbgw1KvicAKMGB5I7OKK/0u+Sa/nzVWFZ4H+7L8Nc21539nI lvrpl9xFNaCblbDYFtNBrSclaJuYTa+tbjsvfKd4vqSlptInz9Jf0XNVMENfE4qSjFZ2 MOkNqoymUegQAte0bdOIIUPdve7UQ1m1/i3W0lBoWgPQ+T3/Yzw4X4PjJejO9C3f27B9 KkPY6kiYlH+OT3j7PH4uJpLPm13WdsvIXzFUQhzFzX8gT8scEzLRyuqvrlD968z08Z9o rXHAKLvNDwEYVqMNAYwNjmi22HmntdmRPhBlNSyCVaxTvxp5d0ue2EorRh9DUS4PYXf2 gLjQ== 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 x8-v6si2279559plo.616.2018.01.25.09.32.53; Thu, 25 Jan 2018 09:33:07 -0800 (PST) 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 S1751340AbeAYRcc (ORCPT + 99 others); Thu, 25 Jan 2018 12:32:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48442 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751106AbeAYRca (ORCPT ); Thu, 25 Jan 2018 12:32:30 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7ED8BA3292; Thu, 25 Jan 2018 17:32:30 +0000 (UTC) Received: from treble (ovpn-124-179.rdu2.redhat.com [10.10.124.179]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7203060629; Thu, 25 Jan 2018 17:32:25 +0000 (UTC) Date: Thu, 25 Jan 2018 11:32:24 -0600 From: Josh Poimboeuf To: David Woodhouse Cc: Borislav Petkov , tim.c.chen@linux.intel.com, pjt@google.com, jikos@kernel.org, gregkh@linux-foundation.org, dave.hansen@intel.com, mingo@kernel.org, riel@redhat.com, luto@amacapital.net, torvalds@linux-foundation.org, ak@linux.intel.com, keescook@google.com, peterz@infradead.org, tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org Subject: Re: [tip:x86/pti] x86/retpoline: Fill return stack buffer on vmexit Message-ID: <20180125173224.ynvqjriah73cfk7q@treble> References: <1515755487-8524-1-git-send-email-dwmw@amazon.co.uk> <20180125120743.ey32gvl5mjam4r2s@pd.tnic> <1516882849.30244.94.camel@infradead.org> <20180125124554.vdx7rrnfrxrzl2ng@pd.tnic> <20180125151024.bidjr26r667vs7h5@treble> <20180125155110.mw655b7fwgm7qqc7@pd.tnic> <1516896198.30244.133.camel@infradead.org> <20180125165646.ytc4upthpaqtwi45@treble> <1516899639.30244.145.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1516899639.30244.145.camel@infradead.org> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 25 Jan 2018 17:32:30 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 25, 2018 at 05:00:39PM +0000, David Woodhouse wrote: > On Thu, 2018-01-25 at 10:56 -0600, Josh Poimboeuf wrote: > > On Thu, Jan 25, 2018 at 04:03:18PM +0000, David Woodhouse wrote: > > > On Thu, 2018-01-25 at 16:51 +0100, Borislav Petkov wrote: > > > >  > > > > > And the seg fault is objtool's way of telling you you need a > > > > > ANNOTATE_NOSPEC_ALTERNATIVE above the alternative ;-) > > > >  > > > > Except that it blew up when I did this which doesn't have ALTERNATIVE > > > > (it's the diff I saved :-)) > > >  > > > Yeah, ANNOTATE_NOSPEC_ALTERNATIVE just tells objtool "don't look at the > > > alternative; you're not going to like it". > > >  > > > If you start putting a __fill_rsb() function out of line somewhere and > > > only *calling* it from alternatives, then objtool is going to shit > > > itself when it sees that function, regardless. > > > > Right, if you *really* want it always inline, the short term solution is > > to just patch it in with X86_FEATURE_ALWAYS. > > And the whole problem here is that patching it in with alternatives is > painful on kernels < 4.1 because back then, we didn't cope with > oldinstr and altinstr being different lengths. We just manually added the nops for the in-line path, that should be good enough. -- Josh