Received: by 10.213.65.68 with SMTP id h4csp461760imn; Sat, 17 Mar 2018 10:24:00 -0700 (PDT) X-Google-Smtp-Source: AG47ELu/N0Ksz+6XaOEKmdNIUNFrueoXUaz9Fc++uDZIM+tCzOWIcuuejfVQ1DqpeI/SB8tRJg0m X-Received: by 2002:a17:902:4381:: with SMTP id j1-v6mr6478971pld.297.1521307440201; Sat, 17 Mar 2018 10:24:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521307440; cv=none; d=google.com; s=arc-20160816; b=02cwkCtbfnGRospB2Lh/llmucIEwqhS5o5ALCViBqfJq+G8EeJGyuI8vg1y9Ptl6Iy 0f/LNnk3hB1L4nJpI5fpob6cvCpSe6U7LqB4lpjTwozZGYjFLaOcLwmeOerH1cxVPx2n ybSim0bS8J7OI831MBkuGtk0s9m/daIQ+l2BhBaEgvWEMHv1URH0LRsaQYu/WSHg8QJd 6m8QXRqmWPbXBT0MpCjHXKdC+2Bzx5WVvWCySkIRdaFmP1G/JAvHJOIzx/i6G6qOekqV 5eU6bcdU2GqF86Mtym2E6cQWOR55H5MLTF/Xh9MSR9oPVh4fQYJ9afvSKYgPhdDVMUif mMmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=+G8NZ3lafr1fwF5PH6MCk0tGVYeJeAvdpVZw/vYkTJM=; b=IpIG37ux+rb5N9an9kI0faz0u+3xwx5ie1QOgMOoisxGkatafs/ubjUIoRykay+Hib AltTVZZeenslZtDHVXTmK9yBU6oNKD7KP5eU2cMUcgbUivrlZmIb4Ks0zFflz0PWbaZf UYukffvAPtCtz9YwoSHHiYuupnsq0WDfWIOy+VC46BIUoZyeNnY8ZCO1+jUK4okcJbUX TUUYqXmlqURR4iZIQa/OO/NIzw6FU/nLrQ5bkviMMhFGBFgRTRMgsbvue0HVUYigG7mB TLwGVgE9dXr29yfMFEi4j7DD/OHoosm3aKQuL9BZ6FH/yOOpXoXNZw/VBdhL9VevXpQR 755Q== 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 q82si1068351pfk.70.2018.03.17.10.23.46; Sat, 17 Mar 2018 10:24:00 -0700 (PDT) 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 S1753865AbeCQRW0 (ORCPT + 99 others); Sat, 17 Mar 2018 13:22:26 -0400 Received: from isilmar-4.linta.de ([136.243.71.142]:35190 "EHLO isilmar-4.linta.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753315AbeCQRVM (ORCPT ); Sat, 17 Mar 2018 13:21:12 -0400 Received: from light.dominikbrodowski.net (isilmar.linta [10.0.0.1]) by isilmar-4.linta.de (Postfix) with ESMTPS id ADBE020091A; Sat, 17 Mar 2018 17:21:10 +0000 (UTC) Received: by light.dominikbrodowski.net (Postfix, from userid 1000) id 9DEDD20D1F; Sat, 17 Mar 2018 18:13:51 +0100 (CET) Date: Sat, 17 Mar 2018 18:13:51 +0100 From: Dominik Brodowski To: Arnd Bergmann Cc: Linux Kernel Mailing List , Linus Torvalds , Al Viro , Andy Lutomirski , Ingo Molnar , Andrew Morton Subject: Re: [PATCH v2 00/36] remove in-kernel syscall invocations (part 1) Message-ID: <20180317171351.GE3351@light.dominikbrodowski.net> References: <20180315190529.20943-1-linux@dominikbrodowski.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 15, 2018 at 10:02:04PM +0100, Arnd Bergmann wrote: > On Thu, Mar 15, 2018 at 8:04 PM, Dominik Brodowski > wrote: > > Here is a re-spin of the first set of patches which reduce the number of > > syscall invocations from within the kernel; the RFC may be found at > > > > The rationale for this change is described in patch 1 as follows: > > > > The syscall entry points to the kernel defined by SYSCALL_DEFINEx() > > and COMPAT_SYSCALL_DEFINEx() should only be called from userspace > > through kernel entry points, but not from the kernel itself. This > > will allow cleanups and optimizations to the entry paths *and* to > > the parts of the kernel code which currently need to pretend to be > > userspace in order to make use of syscalls. > > > > The whole series can be found at > > > > https://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux.git syscalls-next > > > > and will be submitted for merging for the v4.17-rc1 cycle, probably together > > with another batch of related patches I hope to send out tomorrow as a RFC. > > Nice work! > > I've already commented on a few patches that now have a kernel-internal > helper function that takes a __user pointer. I think those are all only used > in the early boot code (initramfs etc) that runs before we set_fs() to the > user address space, but it also causes warnings with sparse. If we > can change all of them to take kernel pointers, that would let us avoid > the sparse warnings and start running with a normal user address space > view. Unfortunately, some of the syscall seem to be harder to change to > that than others, so not sure if it's worth the effort. Thanks for your review -- on this issue, please see my other messages. > Another open question are the declarations in include/linux/syscalls.h. > These serve as a help for type-checking today, making sure that > each syscall we refer to from either the syscall table or called > by some kernel function uses the same prototype that matches > the syscall definition, which raises the question of whether we want > to keep the header around at all. Well, we do not want to call syscalls from other kernel functions, so that issue will go away by means of these patchsets anyway. With regard to type-checking the syscall table, we might want to keep the definitions around and/or generate prototypes from SYSCALL_DEFINEx() directly. Thanks, Dominik