Received: by 10.223.176.46 with SMTP id f43csp2650575wra; Thu, 25 Jan 2018 13:03:36 -0800 (PST) X-Google-Smtp-Source: AH8x226fAtapsFhy8G5YjIr03MEfsW1ApnDyxS3oQbjxkNdZLNNHd9oH+w4zpmOr8K8yFQ2K8kff X-Received: by 10.101.101.71 with SMTP id a7mr14081503pgw.192.1516914216213; Thu, 25 Jan 2018 13:03:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516914216; cv=none; d=google.com; s=arc-20160816; b=thfCRZ6IOa/CXzREPm75B7ZsAR6OKyVSFh94I6+lHOkTG9nSL/j7D8vAPfIRbRBRia cs4v0J9/bSaR/TFI13LklMA4boVpV9jNZUT6B8OctAErW+Ca0Kgo+z8y3vp0xJbBCARS 4tBcb1yG8bTNAOtwwjXGgORI+oJhotOdn74dVPwHfbYoW2QyYLV4+w6yZEgj/2ySoBBu 7piW/Dm0g3CLhc3jYHFyx0FUrd+hqSRn+02hhUWraD7cy3kugzkGhk64TOagpzztKX3c lUyxKbD40+EJd0iJIvC8CCv4hb9v7lwFysUv2FNH1aD0bh8+yu5XDGxK4ZVXOYOWD6r1 wseQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=uwDnxIWk3Ju3kA44to8G1Yi57H9xOutRnnD/FWtmnB8=; b=oWYJhxa8T8jnn3UxOsD8h1/M5tsYWoHl1u6HAh9702AShV2AI6EUXBcawMhLHR+Clv /rxMB+Qy5IfhgYhgBgdiIlbFPYWMqJwiPZReZNrCbSyfwDF34sc/LOvQX6p5o7kpgS/a U0tRX/V3s0R1eWkuJcM8bk+7leTSNpd8udX3Twmlv3WPG1Qm8Wt3gloxmZNiN7RE4e1t x9+8iaI47XoNGQcRlpkP9+EdyoyntDhRTTeJ4skIu9507LYFjuUjIpx8SpzSJJFMgbdF UaXSwJpRPiDeCJ3Mpbl7SeKS062QNDGcH+r6RtWeUc6zt7dPT0jUbmmPF+X2joLCiUw6 VcUw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e71si2018898pgc.295.2018.01.25.13.03.15; Thu, 25 Jan 2018 13:03:36 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751338AbeAYVCr (ORCPT + 99 others); Thu, 25 Jan 2018 16:02:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:48702 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751174AbeAYVCq (ORCPT ); Thu, 25 Jan 2018 16:02:46 -0500 Received: from mail-ot0-f181.google.com (mail-ot0-f181.google.com [74.125.82.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 44B1021781 for ; Thu, 25 Jan 2018 21:02:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44B1021781 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org Received: by mail-ot0-f181.google.com with SMTP id d7so8069976oti.0 for ; Thu, 25 Jan 2018 13:02:46 -0800 (PST) X-Gm-Message-State: AKwxytf6zuZWmKkHRyZ3kRzJaRSQybxZKOrtRDMC/PTJrE7zheWGeHre Sg17pnmYQeK/4LgIPX6UDV9Zt4cMMvQpv3hUHNzx6g== X-Received: by 10.157.20.137 with SMTP id d9mr13506716ote.46.1516914165498; Thu, 25 Jan 2018 13:02:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.66.36 with HTTP; Thu, 25 Jan 2018 13:02:25 -0800 (PST) In-Reply-To: References: <503224b776b9513885453756e44bab235221124e.1516644136.git.luto@kernel.org> From: Andy Lutomirski Date: Thu, 25 Jan 2018 13:02:25 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86/retpoline/entry: Disable the entire SYSCALL64 fast path with retpolines on To: Linus Torvalds Cc: Andy Lutomirski , "the arch/x86 maintainers" , LKML , Greg Kroah-Hartman , Alan Cox , Jann Horn , Samuel Neves , Dan Williams , Kernel Hardening , Borislav Petkov Content-Type: text/plain; charset="UTF-8" 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 10:48 AM, Linus Torvalds wrote: > On Mon, Jan 22, 2018 at 10:55 AM, Linus Torvalds > wrote: >> >> Honestly, I'd rather get rid of the fast-path entirely. Compared to >> all the PTI mess, it's not even noticeable. > > So I looked at how that would be. > > Patch attached. Not really "tested", but I'm running the kernel with > this patch now, and 'strace' etc works, and honestly, it seems very > obvious. > > Also, code generation for 'do_syscall_64()' does not look horrible. In > fact, it doesn't look all that much worse than the fast-path ever did. > > So the biggest impact of this is the extra register saves > (SAVE_EXTRA_REGS) from setting up the full ptregs. And honestly, I > hate how that stupid macro still uses "movq reg,off(%rsp)" instead of > "pushq %reg". > > Considering the diffstat: > > 2 files changed, 2 insertions(+), 121 deletions(-) > > and how those 100+ lines are nasty assembly code, I do think we should > just do it. Feel free to Acked-by: Andy Lutomirski that patch. Or I can grab it and send it to -tip. Re: the trampoline not showing up: if I find some time, I'll try to wire it up correctly in kallsyms. --Andy