Received: by 10.223.176.46 with SMTP id f43csp1016567wra; Fri, 26 Jan 2018 10:24:29 -0800 (PST) X-Google-Smtp-Source: AH8x226io3h5pt5rRmhETTDaBraaWkCN4cZkvm/2vmHR1PmqHA47D54AgRkjkVcs2byOSPSd7tCF X-Received: by 10.101.96.67 with SMTP id b3mr16480383pgv.23.1516991069598; Fri, 26 Jan 2018 10:24:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516991069; cv=none; d=google.com; s=arc-20160816; b=DUJy29AqA0/08pxQBtofTa4+MFlAhDnl96skBZ6/7rppRbzpMICo8krba3/mlFldD+ eyXJrx6JIU5jnWw3u5/e55bQHeDY2iIaSljYaD2a2p25EZKlT6hbYyca9Awx78toCOh/ GvSum9J3E9aqj3urtoPlgVEQhn+mjsqMFYinN5ydgc0FON5Cnf6uup7NRzFv7a7DgfEZ 1H16kPFSpY09oRFvR/Mm+JcL4Zdg76SmHwtJx/ktxTHpTg9YxvPjHDbWDC0NhlsPTAty g/R46pODi82FyIJ9OBy5jDUh4k0VoKiNzwDBI579iiVgyU7PVooUUPsMfB4w37KMiBbt bzNA== 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=fFYqgUT1ZqQ5iJD32AhqSWmVxY0Pnj17nv4dUZn20OY=; b=PVmhAS8wIba0TNfCKxxMq3/ITTVcXjWVZDZPyYu3tYz6++8cC37tXU30PdBQrnZrOD LLEGByHlmIF8IcNbQY3zAUtNQD8SkYHHL21nNrgvNJGQRLKxNL3xjGUzp36Sf8BdgJ2t LAxxz6VMoBmhrWTwXDs072pj+ApqYg4S8VpvV9b8fVt8d8AVwpfxMbdMikjGG3qudP5/ XFJqYN808J6GY64u+b47GrwJITlnem0DoKvPpso0DaboUVg2OCnKW+Fc1N3rIYIc7lma bk4Im8t5JaU5bmPWQ0bNdR5AI4RftY/zSBMnr1gGIV6lybirNm992P6tUnfrILKmHZXI EKag== 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 74si6662822pfl.59.2018.01.26.10.24.14; Fri, 26 Jan 2018 10:24:29 -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 S1751516AbeAZSXq (ORCPT + 99 others); Fri, 26 Jan 2018 13:23:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:57946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751281AbeAZSXp (ORCPT ); Fri, 26 Jan 2018 13:23:45 -0500 Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) (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 D5BA9225A6 for ; Fri, 26 Jan 2018 18:23:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5BA9225A6 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-io0-f182.google.com with SMTP id c17so1353806iod.1 for ; Fri, 26 Jan 2018 10:23:44 -0800 (PST) X-Gm-Message-State: AKwxytenrY44zuJr8kW5ijWx9jU0AomBYFGsCbmQ5T+9O10hmi6rPsQu 0WUzhjTbzoSOfazoFz9rJxi6uIt8l0QyM0PumZiKhQ== X-Received: by 10.107.167.136 with SMTP id q130mr3508175ioe.173.1516991024141; Fri, 26 Jan 2018 10:23:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.137.84 with HTTP; Fri, 26 Jan 2018 10:23:23 -0800 (PST) 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 10:23:23 -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: Al Viro , Andy Lutomirski , 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:13 AM, Linus Torvalds wrote: > On Fri, Jan 26, 2018 at 10:07 AM, Al Viro wrote: >> >> Umm... What about other architectures? Or do you want SYSCALL_DEFINE... >> to be per-arch? I wonder how much would that "go through pt_regs" hurt >> on something like sparc... > > No, but I just talked to Will Deacon about register clearing on entry, > and so I suspect that arm64 might want something similar too. > > So I think some opt-in for letting architectures add their own > function would be good. Because it wouldn't be all architectures, but > it probably _would_ be more than just x86. > > You need to add architecture-specific "load argX from ptregs" macros anyway. I mocked that up, and it's straightforward. I ended up with something like: #define __ARCH_SYSCALL_ARGS(n, ...) (regs->di, ...) (obviously modified so it actually compiles.) 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(...). So I could split the macros into: DEFINE_SYSCALL2(foo, ....) and DEFINE_EXTERN_SYSCALL2(foo, ...) or I could just fix up all the code that expects calling sys_foo() across files to work. My mockup patch doesn't actually work because of compat crap, but that's manageable. --Andy