Received: by 10.223.148.5 with SMTP id 5csp7700403wrq; Thu, 18 Jan 2018 08:30:39 -0800 (PST) X-Google-Smtp-Source: ACJfBougxii65Tz+ANAN6hO8c/Tc3Z0KWsLmtaAxdK3wwQfimeR2/ITKFU9Cm3kgBvGObfxblLaK X-Received: by 10.98.130.5 with SMTP id w5mr30551878pfd.117.1516293039104; Thu, 18 Jan 2018 08:30:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516293039; cv=none; d=google.com; s=arc-20160816; b=RP6x7za86wgGe3O8CnXDz6TbkhqOBhr1uegFMqzOHbkN5SNKa4SVFaI7f03A9J3ch+ iA3Q9hkQricmAMmsk+bppSZf4GwSmvxr6oyjjM//+jCckEAvdgNpq7Wihu7SzIRfZRl/ 6neyH4ZLsFiL0wYxLiA6ezKw1dJcAmOJhlk4H+PAF4QShLZVcazV4gdPaOcvoDQhIgcK qoNbGY/ze3VK8f7B8e8VxFHMWq+zjBtxdBMQjGp/glW1iMpciR4XecsM6USZ8LzPLUa/ 9vi8BR3uvMjSv55tKU5UO1pSSdlsG7YNxXQawSi2QTM/2qD2JLN9YjNCOMGYlzMqQ6Iu CTgA== 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=2Kz5lWPDN2pF8ZcWPSxHD+4F7Cv47rSWNXubgnmY/H4=; b=kweMR2GoTEiNDAYx5nz3IojSu54ecK+jovUeBRA+E0z13t4JXW9ss2SXt9kINfPB44 Y1eSwIa5NmZp8K5tURLCWXP5MnlvHjagKJh15CJ1Sz9209Se7V3Mmu04YGw5IR6eltR5 b9VjvRHXEiThfb6k0wZSFBgcRNAFLMy5KvHU9z6vkbrXF3/ah51XBWf2vZZZ+52vCNtz qQY8a/GBNnIP2DfNt5MoVKjYwYA3Wkh8oPP7a0D3UGdpGutvjZkuBh8gbxQKLKnSpKER lPrs+9NbxpWo3KrDKYgTqcPdp0/wbQUm87554FlUgwygGqokG7Vc4N//slYeE+oEPMf5 W1mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=FRfYIMW0; 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 j1si6514287pgn.209.2018.01.18.08.30.24; Thu, 18 Jan 2018 08:30:39 -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=bombadil.20170209 header.b=FRfYIMW0; 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 S1755443AbeARQJy (ORCPT + 99 others); Thu, 18 Jan 2018 11:09:54 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:58183 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755287AbeARQJw (ORCPT ); Thu, 18 Jan 2018 11:09:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=2Kz5lWPDN2pF8ZcWPSxHD+4F7Cv47rSWNXubgnmY/H4=; b=FRfYIMW0qEDDpTEryUmAKeP+G T5BiTUK1YFIi2KWF6GexLbzz05j/I1IRyfjzIUyn6KtyQWPbjZPL+Ax4ccZmINSakYBcW/NrafOKN a5QEilkq9cp3nzhnysDPNL4AJnq1DsauR+OVUZ+Vf2JfuiiQCaHKpJph3ZNyUcqw564X9Xf5Gj/65 0z0EXLZRVbEUGiY/xhCeoswdvYI8T74+qmjr6qML4VtFBfWRQkYRDy/ClVzVxCOjY3mI7RXGQZdMa gO8ErWQKNeoxalD+/slLxHWRz9uCmzkfJs64pFAtyjyEI89lH7qWxaCTyRHyOy7x58t/K/HnlK4/A nRre6PL1g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1ecCOH-0002yP-Ne; Thu, 18 Jan 2018 15:46:10 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D7B112029F9F6; Thu, 18 Jan 2018 16:46:07 +0100 (CET) Date: Thu, 18 Jan 2018 16:46:07 +0100 From: Peter Zijlstra To: Thomas Gleixner Cc: LKML , x86@kernel.org, Borislav Petkov , David Woodhouse Subject: Re: [PATCH] x86/mce: Make machine check speculation protected Message-ID: <20180118154607.GN2228@hirez.programming.kicks-ass.net> References: 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 Thu, Jan 18, 2018 at 04:28:26PM +0100, Thomas Gleixner wrote: > The machine check idtentry uses an indirect branch directly from the low > level code. This evades the speculation protection. > > Replace it by a direct call into C code and issue the indirect call there > so the compiler can apply the proper speculation protection. > > Signed-off-by: Thomas Gleixner > --- > arch/x86/entry/entry_64.S | 2 +- > arch/x86/include/asm/traps.h | 1 + > arch/x86/kernel/cpu/mcheck/mce.c | 5 +++++ > 3 files changed, 7 insertions(+), 1 deletion(-) > > --- a/arch/x86/entry/entry_64.S > +++ b/arch/x86/entry/entry_64.S > @@ -1264,7 +1264,7 @@ idtentry async_page_fault do_async_page_ > #endif > > #ifdef CONFIG_X86_MCE > -idtentry machine_check has_error_code=0 paranoid=1 do_sym=*machine_check_vector(%rip) > +idtentry machine_check do_mce has_error_code=0 paranoid=1 Nice, Thanks!