Received: by 10.223.176.46 with SMTP id f43csp2532641wra; Thu, 25 Jan 2018 11:17:37 -0800 (PST) X-Google-Smtp-Source: AH8x225R08GSup/tAmSRsftz6VCrtYJesjbeogUoZ/iopYonXUTCP3dM1PLdQgbujlYTe5+ZttLN X-Received: by 2002:a17:902:507:: with SMTP id 7-v6mr10609328plf.0.1516907857479; Thu, 25 Jan 2018 11:17:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516907857; cv=none; d=google.com; s=arc-20160816; b=c8hpJO//N9E7XPv3DZqjTQsJFg4DlBnlgweKD+8ZN9mw7M7cnnwfz/A0K3ZPyAPw1i hTbNxHhl5YtOsLkmWp/AIQBho/sh+Yb4C9F5Ly8qy2FkaPUvyC1rHop3b01szicV44PY GttNXE/PxDXLYL2uUKXtCYvY6MXGgXJoBvml0l+iVVxIu52HDYqn/eI1G4W9k4HUgFXH 2e+31cmBBtQmyZzk5HlyvuVxPFxsZrpD2u0SUMx5OuJXDdlEdpYMOLXo2m8kdDMhiAtB 3bNaNFuA1pTsYGaa70Xn4/Ae+PQgOp0JG7EdJ0Tx9N8u8P8CQkIpzy93DrLQI43o+xOn 0VOw== 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:dkim-signature :arc-authentication-results; bh=IVu0f5slNYfWEjifRsIkzUovki8KqMiJBzjAnn2kSiU=; b=eEVIwQncP39AY/VNgyxwxop5XJvgbsrlpORedFlZJAaBoeeCQSjdJ/78zItyE6G+VL PKgcPGGXJX41XzZW3RWwHrpbctpTZAJ/B3ITqXNfvdd5SUcnAOoDN4nRC1t3lfOEtz0H cS9CCS9s2v90VQQjDwGzN+Av0G5hKOnE0+7S4FQmUQw5TjS9cZKeNrghPqwBW2D/jZO4 nDbihTBPZr1FAlh0gkek2V5qMIzpm7x4hMEBsQc7axdDTKdfXseqoZsyE1igpGqlfRr7 3BKVFg6is6pDMkwcuRnjIMOUW6EkjEAv8I2Kb82+rTrxVsFh52bHBU3B+RVpZAhg7bQ2 nO7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=prk1g+hY; 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 o13si1877680pgp.740.2018.01.25.11.17.23; Thu, 25 Jan 2018 11:17:37 -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=@gmail.com header.s=20161025 header.b=prk1g+hY; 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 S1751258AbeAYTQ3 (ORCPT + 99 others); Thu, 25 Jan 2018 14:16:29 -0500 Received: from mail-it0-f53.google.com ([209.85.214.53]:38353 "EHLO mail-it0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751108AbeAYTQ2 (ORCPT ); Thu, 25 Jan 2018 14:16:28 -0500 Received: by mail-it0-f53.google.com with SMTP id w14so11099743itc.3 for ; Thu, 25 Jan 2018 11:16:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=IVu0f5slNYfWEjifRsIkzUovki8KqMiJBzjAnn2kSiU=; b=prk1g+hYg8Efqf2B4Kn45H9QxGs5ecwZYIywQCu+4WtmeYLMH76pelGSig8Du5ZJWr AGQxpIwhKtcJ3aJZDPbWOMHYOtNPr0GKf9p/J/f4obsdE7LJQJt+jaCJd2MfjLDj4IFz uAMtSQVIv7kTsOzPBZkrEBBnh5Ni6u08HeSz7T5fTOQ/ZTls3EvuOy+qMJLDkP7vCSZ6 LO4i++8ILGyDkY989Y8k/R1F99g2yS6A+P+7r8Y36FJfvRUGPLsgrbwxBMOyCNrD/MrH 4L7tzCaUkcIsy38F3mpUJMnpP2J2N6V4ncLd1zEVTNx0O5VMlHd7s1fc5vur9ry0QRll 9NUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=IVu0f5slNYfWEjifRsIkzUovki8KqMiJBzjAnn2kSiU=; b=RCKQvXmgaUKK87SAH/jfS+4HSYws45Y4sQH345SRcw3XRNgq5i27o7huY7nVgZsPYf 2j6Q2kyC2kIpgjZCoyfNRIS05Eo4KtSYaYhUj3hjKZ/Eqlkg3VvdY+4ZBJG+XsbgwgQJ uNMgE3shCfSdu/YUBa6iDcZKo8CcJLaResGaIYX73+Db6j5RiuGUaG6Ecmi98p2oTVU3 P+w6OFM/nC4oprRGc3aPUZuLHhqOPmdHNsS9JbMUzrqcDNCA+gOllPdEkC7+WJmbwXv9 9Srb/nz0tEnz9QABQdhDyiBNu8jruhalMk9naJdlBRkeE7STVgfTIXm9PQe/q2U/8nVZ 9p3w== X-Gm-Message-State: AKwxytd9XRTQijJKGcvf/DZ9sMBkghKPY+qhKTu8rRHA71QNcu9dd3ky 2wzFYAhanATC0ota1nGYuXlbUdFX63FlBMR773MfCkRS X-Received: by 10.36.175.88 with SMTP id l24mr14449041iti.139.1516907787860; Thu, 25 Jan 2018 11:16:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.59.196 with HTTP; Thu, 25 Jan 2018 11:16:27 -0800 (PST) In-Reply-To: References: <503224b776b9513885453756e44bab235221124e.1516644136.git.luto@kernel.org> From: Linus Torvalds Date: Thu, 25 Jan 2018 11:16:27 -0800 X-Google-Sender-Auth: 08HYj150fbdX64vO3JENk6MGQy8 Message-ID: Subject: Re: [PATCH] x86/retpoline/entry: Disable the entire SYSCALL64 fast path with retpolines on To: Andy Lutomirski Cc: "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: > > So the biggest impact of this is the extra register saves Actually, the other noticeable part is the reloading of the argument registers from ptregs. Together with just the extra level of 'call/ret' and the stack setup, I'm guessing we're talking maybe 20 cycles or so. So there's the extra register saves, and simply the fact that the fastpath had a flatter calling structure. It still feels worth it. And if we do decide that we want to do the register clearing on kernel entry for some paranoid mode, we'd pretty much have to do this anyway. Linus