Received: by 10.223.176.46 with SMTP id f43csp1045177wra; Fri, 26 Jan 2018 10:55:41 -0800 (PST) X-Google-Smtp-Source: AH8x225wxmDTj+ys6Kr1B+7gqRC7QCRokt9EQjaw6phmf645T4p6tQDWVacFFvU8ezzdB5WC4N3X X-Received: by 2002:a17:902:9a84:: with SMTP id w4-v6mr2217575plp.136.1516992941623; Fri, 26 Jan 2018 10:55:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516992941; cv=none; d=google.com; s=arc-20160816; b=uld58SM/4gSToXZRhhdPlMO7hrOLJ91WqQeEBBf0z7qTAfG4xlkXDHffy3oYIb/Tyf sHTg68GWQESsNGB0RDScY5INdhobVQZlHFiVRhZXbD5RH6NS46ZFHTnSjQrjZ2Ukwq78 /CjFnV/HE4n7GZCy1KQo1czzVzF24xwPNhSRi7bKuArDiE/cyDV8ifLMDW3rWlrP7JgQ g0osxvq5eJXlLa9QO2LgdoIZKEd8EG990QpTVK63V79p9V0rF5h5oAR6aZCKjVaAAgZV TmdZsqv3YD3YG1ttkiIf2PjpssivwP+vIuxY70HbGpu1nAAAw+K4Z3W+W5mMvaIFStVN 0p1Q== 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=HrSRXZrdrGH8Va2FM5Qi9Lc0Rkc5z9WSBgXBRAKFb0c=; b=VvLiZF3B5Ks7kx2X5AxrbeSiBferlaVKIRYSVStt7cBpcJgFGVio0cXm06SgnDng0M zpo4bvJasz5ygV+sK1TGCl8COOzS19jYxuyedlWwdaY/SdpWhzkl6L3AP2bQgZLzS6pZ oXhAtIJ8LZyfkHANklxDYi+JysEVCWz8VcB8xCKAV8G8GEoMyZF/qotArLqbM/l/JpMV SVndVUq2ZB2FW7DrFxIUzqWFBR80pxpFXCiEMx2Rfn+5iVu45VKsA/3Uq4o64S4o/+TK yyoS/9jFIXHBvAHWbNMMfTprIZTlOhbm46p4Iwp/GOMl6xL1iW/5UX2clNk2EF8avtub FBfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=tJspY+N9; 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 93-v6si4098522plc.515.2018.01.26.10.55.27; Fri, 26 Jan 2018 10:55:41 -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=tJspY+N9; 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 S1752585AbeAZSyY (ORCPT + 99 others); Fri, 26 Jan 2018 13:54:24 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:39401 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752529AbeAZSyW (ORCPT ); Fri, 26 Jan 2018 13:54:22 -0500 Received: by mail-io0-f195.google.com with SMTP id b198so1430512iof.6 for ; Fri, 26 Jan 2018 10:54:22 -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=HrSRXZrdrGH8Va2FM5Qi9Lc0Rkc5z9WSBgXBRAKFb0c=; b=tJspY+N9imJJR+blIKsi4A3XBIYTZRo1McSdJD47JNGv8apHJok/9YuB0TK2X0XzDv q1V99yqSYIGc9fwUBttJdwRAW2DERVB42bA3vH1mPy3C8nuz+XJN239wMPW6fUXmHatl puHCLewJCgMJo25TxzDcGTdlOul21y5Fcy5T2JYGlK+NsblYDM4oSqp8hhgGOHqp7dR7 Wefi/ZQ7I/3WqID3HTabBnRlX62JfetSuLf7cDR8K7plsyfgy8dx4bLYvZpEfYsw3bY1 1NMaWjYqRXl9GNa2B0PRTkydKqCIsPJrKB7tzKhrfE+e6Z9+T+W0Rm/PmC2mBIb6Yx7r xgJA== 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=HrSRXZrdrGH8Va2FM5Qi9Lc0Rkc5z9WSBgXBRAKFb0c=; b=NkbAd+Lz9ifY/XldlEC5mtTQOukE2L6LzUJX0CI4LohUkd+6ugUplSw+V4YFPsngLl 8SQOSTvQvxClkUd/Py5TQay6AgCFff9ec37guEyK+U0DtfgcOHqMdqGdQOO2JJmIe15/ 05qmN8sh05drqrLghk3N8XDM4mfWzFW7UaDcI1tzLRfyVoHRmlLocyQOqM+JylKdNZYQ 93/LjhwK/hHaQDnhB0btat6UxflZ2pJJnHa2RrkOao5e9f9pmE5EQom4CR4iP2JWRPck 0qeutdOEq1AcUJcvWUhB8IIg/5W/AcKkvN7VJpSJig0vELkkA1dCIQbDq/1FYlGeBTK+ rAWw== X-Gm-Message-State: AKwxyteV5drpb1FpI0wij2njpniV3aoyFnFI1ui2zqDPDEeh0gHCxC4z wIciReTqKaXPLRY788fJd2CMWw1laanREb3LONE= X-Received: by 10.107.183.78 with SMTP id h75mr17338975iof.201.1516992861801; Fri, 26 Jan 2018 10:54:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.59.196 with HTTP; Fri, 26 Jan 2018 10:54:21 -0800 (PST) In-Reply-To: References: <1516976647.5438.6.camel@linux.intel.com> <20180126180722.GA13338@ZenIV.linux.org.uk> From: Linus Torvalds Date: Fri, 26 Jan 2018 10:54:21 -0800 X-Google-Sender-Auth: RnMK5cW1PUS3muSVEpdqAHc4h1s Message-ID: Subject: Re: [PATCH] x86/retpoline/entry: Disable the entire SYSCALL64 fast path with retpolines on To: Andy Lutomirski Cc: Al Viro , Alan Cox , David Laight , "the arch/x86 maintainers" , LKML , Greg Kroah-Hartman , 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 Fri, Jan 26, 2018 at 10:23 AM, Andy Lutomirski wrote: > > The issue is that doing it this way gives us, effectively: > > long sys_foo(int a, int b) > { > body here; > } > > long SyS_foo(const struct pt_regs *regs) > { > return sys_foo(regs->di, regs->si); > } > > whereas what we want is *static* long sys_foo(...). How about just marking 'sys_foo()' as being always_inline (but still not static)? Because the case that _matters_ is that SyS_foo(), thing when this is enabled. Sure, you'll get two copies of the code (one in SyS_foo(), the other being the callable-from C 'sys_foo()' that is exported and almost never used). But that seems a fairly small price to pay. We could leave it for later to try to get rid of the unused copies entirely. Linus