From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x227HN3hR2L79eoSTeCcx5oIC8OOOTRExqgOK45cGK36e7CtKJbjrxa2vB2+8piS0w5awbJxT ARC-Seal: i=1; a=rsa-sha256; t=1516993395; cv=none; d=google.com; s=arc-20160816; b=heo2COoWhTIICIyxuXV6IQ4Hgq/y3zrXKb8kmQ3SuR9qS/v0tp9Gi3poRIvkMJqph3 NjOKv24GXsGBk0GhH+NUK+v2AhBEYMY8oKRAtao1vdHjABUQUFAqwuS3RGyT6d0e0Udy hWy0qvHArR8o5sv/wnNmp4k2zIT8Zo8Diloed2q8ooywUlqT1C8NhOMk23lKdVOVpqHb xqH3BGQjw2xJnwr4D1/UvMX17u3CvjmgaVPqHjcRCazbbOBdftLdSoTnqiqJ3wPIz9T4 +Agsye1wfRXEMJ9kTK199UH8BOaNkx+uvKTMo5GTN/b/bK8fbDjvFV/MbrsCCKh2Czvq q43w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:dmarc-filter:arc-authentication-results; bh=oyUSj/oR23Jndo95du6Gv4R8tPukMuCkjRYWvBJirEQ=; b=ZdyP7OUDGZJYjPvvTA78F1GbRvlvFQ7tBv84rVFDTs/IAbxn4e4XK1iQl5V7kriw94 n4E2JrUgXtIVJZ3JbaMoomO5WIbL++CsxtxBRk1d2Cx5QayPJvqQj8XdkOz7lW+nhz6l LhHWG6FkSQL+L2LHqB0HbczyUR9kUqJ0hXT4LnDjWxA4R1G9e6DXX78onFBydxQ9R+F/ CUlvJ3yVY9/19UcbVEWtg6dTxLG2hPqTvuESm0KNsj8Cb/2Sp1+RedKJYNNBfzwC7SEg twAbJwKGtXs+AmmITduYCPk0IaTgUgzSEjDGVkXjr258csRW6JiFO2BoNNblSZmDn71V Xjmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of luto@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=luto@kernel.org Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of luto@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=luto@kernel.org DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A65721834 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 MIME-Version: 1.0 In-Reply-To: References: <1516976647.5438.6.camel@linux.intel.com> <20180126180722.GA13338@ZenIV.linux.org.uk> From: Andy Lutomirski Date: Fri, 26 Jan 2018 11:02:54 -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 , 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" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590316784671066673?= X-GMAIL-MSGID: =?utf-8?q?1590682866479906149?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On Fri, Jan 26, 2018 at 10:54 AM, Linus Torvalds wrote: > 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. > I could do that, but Josh Triplett will yell at me. Anyway, I'll fiddle with it. This isn't exactly high priority.