Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754585AbeAJBjJ (ORCPT + 1 other); Tue, 9 Jan 2018 20:39:09 -0500 Received: from mail-pl0-f43.google.com ([209.85.160.43]:36497 "EHLO mail-pl0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752476AbeAJBjH (ORCPT ); Tue, 9 Jan 2018 20:39:07 -0500 X-Google-Smtp-Source: ACJfBotm4PJ5R5FuaJwMy9ve5kcwN3ARFi8QSbRQOnuHJy3YeM/09bNidPZQ+FN7bvJdMxrTjo//TQ== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: x86/clearregs: Register sanitizing at kernel entry for speculation hygiene From: Andy Lutomirski X-Mailer: iPhone Mail (15C153) In-Reply-To: <20180110013433.mmw7j3uy7xod5e25@two.firstfloor.org> Date: Tue, 9 Jan 2018 17:39:04 -0800 Cc: tglx@linutronix.de, x86@kernel.org, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, dwmw@amazon.co.uk, pjt@google.com, luto@kernel.org, peterz@infradead.org, thomas.lendacky@amd.com, tim.c.chen@linux.intel.com, gregkh@linux-foundation.org, dave.hansen@intel.com, jikos@kernel.org Content-Transfer-Encoding: 8BIT Message-Id: References: <20180110010328.22163-1-andi@firstfloor.org> <50B38CB9-546E-4419-9162-D6A2AC2D80C3@amacapital.net> <20180110013433.mmw7j3uy7xod5e25@two.firstfloor.org> To: Andi Kleen Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Jan 9, 2018, at 5:34 PM, Andi Kleen wrote: >> I don't like this at all. Once upon a time, Linux syscalls were supposed to be fast. Then we learned about the Meltdown screwup, so we mostly fixed it for real upstream and the distroa seriously half-arsed their own fixes [1]. This came with a big performance cost, but it can be turned off on non-busted hardware. So be it. > > That's true, but modern CPUs are also a lot faster/wider than the K8 > the fast path was originally designed for. A modern CPU can go through > these instructions really fast with a very high IPC because they don't have > dependencies or stalls. > > So it shouldn't hurt very much. > > Also in fact when the fast path was originally written the ABI still had a > different caller/callee split which made it more better. Later on > it already lost some of its benefits and was less of a win. > >> But now we're proposing to throw out the whole fast path because it might make it a bit harder to do the most obvious attack. Not very hard, mind you, but a little bit harder. And there's no off switch for less-leaky hardware. No thanks. > > Well the off switch is a fast CPU. When I rewrote the fast path, I did it on SNB. Not much has changed. This patch should come with benchmarks (with PTI off). And Intel needs to come up with real fixes for this stuff.