Received: by 10.223.185.116 with SMTP id b49csp3393928wrg; Tue, 13 Feb 2018 01:43:56 -0800 (PST) X-Google-Smtp-Source: AH8x226/gB0PUrKEgtmYt680nM5ZlO1VXjz6RMsAqL9Xt/9mjPTZ1sMW6+TYpuU36CTxXJ75Fml4 X-Received: by 2002:a17:902:bd94:: with SMTP id q20-v6mr565764pls.247.1518515036309; Tue, 13 Feb 2018 01:43:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518515036; cv=none; d=google.com; s=arc-20160816; b=l6nqaId3Umhv8bHSBcxk2y/OFU7f8yfitHLJXE4/f1KUL3BBNUnVdf9e4PWANTWUxX f6d04QL763mR0yOoVYMfUNMXcEEnv/uxNhX26XkyAei5bIVhLl8I1ofQgXaHEVOFeHZ4 Mh7gpUZPpFHXRO9lPIdNOMiCWiXzDTCedt2S7mHIYPWzLfK2EM6RQbBhSZqc24FYE375 008ZclqLFPnkJlaGlXn85jeuz5QIFsdx2e4rfiKplt98wKC/cRqXmDPQFbN9D4hNWfGK rFnaoEXIMHqMqdE4wrABSjWgW6PYqs6M7KJ+czDz/287Dx0kVWvzvP9ncDHbIHLWxzyp h/Ug== 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:arc-authentication-results; bh=HAk7Syye/VxG3AJGBuDqaUUMo3+TAibTd/6EfVAprxo=; b=mcgtOKURW9F3K/8gAv5wJKi2t/LQ6Vmi69W393D4e2UhSVdgsSdNV9TTOHZwv+LBXg j9WkGfdLUL732ScQ2cwev+/1f7EW+Y9GOKu1gC39w0YdpXKLtSc+pfBTBIH7s4kfCGsq ukYOdom1Y4OXbAY8bZwpjTKaillP21crafzkCSsfsvpGx2uVjCXMrFPxp6mm8K1U1MEz RYpLOnlvtwvuDaZirvyosRU86a1KYuTH9gIxwOOTxE5dLfY6+mbhu7ZNRsI7RDIED3u1 UbdZ9cBiOJDdG1FhHRyowXDORx3nv5PvgFTVroV+oaMT3b2iZTRC3vIJ/OuX8zFOVEkr X5DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=cUsG/kry; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si3190743pgq.601.2018.02.13.01.43.41; Tue, 13 Feb 2018 01:43:56 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=cUsG/kry; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934775AbeBMJmD (ORCPT + 99 others); Tue, 13 Feb 2018 04:42:03 -0500 Received: from merlin.infradead.org ([205.233.59.134]:56216 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933936AbeBMJl6 (ORCPT ); Tue, 13 Feb 2018 04:41:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HAk7Syye/VxG3AJGBuDqaUUMo3+TAibTd/6EfVAprxo=; b=cUsG/kryVF5vH26+Mfy8Hazrc aXzkyj43y+ixRIey9uIbyR2UmemMDUVuTXsKxdwYf2cdQz2WUUrH1Thcp4xl1McLQ9+TGfWT9S1Ag 6fNAIlgnLP/nqHduQSwlUXfbevxsyHvkNp/h8Ym6/qJKgJafIK0rAchuAaeoE4fgfCox71Kd8NyUh 2qRfuhhrK08y8s24Y2Fv68WOiCvVKJ0UJC2OSQ06QXumLJitlhicg3s+KHL9bV/Tjxn2qYP5hBESC tM1hvNhWMev15rfpbWpXf2vbgMuTyMbocTKQgWPWpySj525Q8UT1f2VVgzdlU30go2/DwsJ/bIDba SKJsKFQiQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1elX5i-0007mq-BW; Tue, 13 Feb 2018 09:41:34 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 28A592027914D; Tue, 13 Feb 2018 10:41:32 +0100 (CET) Date: Tue, 13 Feb 2018 10:41:32 +0100 From: Peter Zijlstra To: torvalds@linux-foundation.org, dave.hansen@linux.intel.com, bp@alien8.de, tglx@linutronix.de, arjan@linux.intel.com, mingo@kernel.org, linux-kernel@vger.kernel.org, dwmw2@infradead.org, hpa@zytor.com, gregkh@linuxfoundation.org, dan.j.williams@intel.com, dwmw@amazon.co.uk, luto@kernel.org, jpoimboe@redhat.com Cc: linux-tip-commits@vger.kernel.org, Joe Konno Subject: Re: [tip:x86/pti] Revert "x86/speculation: Simplify indirect_branch_prediction_barrier()" Message-ID: <20180213094132.GF25201@hirez.programming.kicks-ass.net> References: <1518305967-31356-3-git-send-email-dwmw@amazon.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 13, 2018 at 12:58:21AM -0800, tip-bot for David Woodhouse wrote: > --- a/arch/x86/include/asm/nospec-branch.h > +++ b/arch/x86/include/asm/nospec-branch.h > @@ -164,10 +164,15 @@ static inline void vmexit_fill_RSB(void) > > static inline void indirect_branch_prediction_barrier(void) > { > + asm volatile(ALTERNATIVE("", > + "movl %[msr], %%ecx\n\t" > + "movl %[val], %%eax\n\t" > + "movl $0, %%edx\n\t" > + "wrmsr", > + X86_FEATURE_USE_IBPB) > + : : [msr] "i" (MSR_IA32_PRED_CMD), > + [val] "i" (PRED_CMD_IBPB) > + : "eax", "ecx", "edx", "memory"); > } Joe Konno pointed out that we now need the below line too, because we're using MSR_IA32_PRED_CMD in this header. With the existing code that's not a problem per-se, but my objtool retpoline annotation things did do stumble over this. Do we want to fold it into the objtool annotation patch or have it separate? --- arch/x86/include/asm/nospec-branch.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index 300cc159b4a0..76b058533e47 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -6,6 +6,7 @@ #include #include #include +#include #ifdef __ASSEMBLY__