Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp818371ybg; Sun, 26 Jul 2020 23:40:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxewD+GkQ9LgaYVkesc5eMCe9hW3IUtL/3ilCQn+zs1uLig7fGPeiKrbI3kd0QjtXLxu32Q X-Received: by 2002:aa7:dbd9:: with SMTP id v25mr18508614edt.137.1595832031223; Sun, 26 Jul 2020 23:40:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595832031; cv=none; d=google.com; s=arc-20160816; b=F0FSp1TfbjWEpVyQtxFSNNoOarwzwTFicE4eU8Y6xZyoZGnd3FlXAo5o587jmWOMFR gf3rl3wk4z0yPT8TjEHZN6G4pWaVhNhS6st10T/cXir3Oq20KoWsbEtm0tVp9mtwadsq xW7R5T4RUbgEpjMMRpYz8K7iBESdDELdod9Ct0NIGpIITd3NOvax0q7FllVFASGUpazL vk12xmVFiquLO1IMpol8U8SMZqpCTGbmS5rwR3/mrm9ycKID5b0hnhzsE04HpraU8rgf d7jAnsM6008GM3XwC2qRuT4gTDc/R016Bxn5dqKMCzlvt/h/iTC/Q9IuN/FmHM9wOtyZ 5kEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:dkim-signature:dkim-filter; bh=I5rayFwHB5hpO2pd77qGV3T3XXYfu8K9Jc+SmT/EPIQ=; b=FMJ9Hm/iCFdXhxhvsgDjdgX5nOmWb5Y29OPFlsjTTbSPVMOCPmr/gVAqUz9yFoo2f1 5S71j/X34q2afkvbmRi9WkdT8nf7h/R+upIh0yp4rJwNa2YsukrHBNhWzRqa0+crcSrj U+fHBI19DeZzF52jSGzdtldVj7YyJgYuDWCtX+Gs9sZ5qj5Y43gLnyTXceK0X+WEr79J 8Muc94u2Gk8tCDjlaQ3DTU0t8G8em6rKmHWojuL84P7PbCrgrIh1Rs9wndlHXt4gIC8P f0EycO+4BYM0fdjv/A0FefWWoSovQYo07skTayraru5uXGBNGX1B4I5ZLVrm8V2D8ewu eoGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@zytor.com header.s=2020072401 header.b=UjnACkwc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j13si1992899ejv.205.2020.07.26.23.40.09; Sun, 26 Jul 2020 23:40:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@zytor.com header.s=2020072401 header.b=UjnACkwc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726841AbgG0Ggc (ORCPT + 99 others); Mon, 27 Jul 2020 02:36:32 -0400 Received: from terminus.zytor.com ([198.137.202.136]:51257 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726324AbgG0Ggc (ORCPT ); Mon, 27 Jul 2020 02:36:32 -0400 Received: from [IPv6:2601:646:8600:3281:d01e:b6c6:1a24:9007] ([IPv6:2601:646:8600:3281:d01e:b6c6:1a24:9007]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id 06R6aNZu1906661 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Sun, 26 Jul 2020 23:36:24 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 06R6aNZu1906661 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2020072401; t=1595831784; bh=I5rayFwHB5hpO2pd77qGV3T3XXYfu8K9Jc+SmT/EPIQ=; h=Date:In-Reply-To:References:Subject:To:CC:From:From; b=UjnACkwcccXs91WAdCOFzul//3ZBPZHg+ORXQUNqNqt70d2jbkV2ZULD1eFJ45QPV y3kfjnS/XWfZf6sgdlQeO7RuVZjlEeue/szrIrGeMdoxiqV2i4EVEdphwPlh6XChQW 2fF5J4UtCfg/Fb4izkGGWTE5GEEllv+/9unlp6j4UDpFFSfid0eXPmvnQZpvX/fHSU hst3tj7LsYGsODkYCK2S2yEG7YES9kX3Y7di1PsVM4rGKvSJXWD3kykQYz+gczorFm wJzkgBSH7hOYr8LwdXZRmqM9hFlmA0Jpxlfou/lokD+Q0PvxiJWNbke4gxf01I1t4s +jKDCNUBkck8A== Date: Sun, 26 Jul 2020 23:36:15 -0700 User-Agent: K-9 Mail for Android In-Reply-To: <20200727062425.GA2005@lst.de> References: <20200714190427.4332-1-hch@lst.de> <20200714190427.4332-19-hch@lst.de> <20200727030534.GD795125@ZenIV.linux.org.uk> <20200727062425.GA2005@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH 18/23] init: open code setting up stdin/stdout/stderr To: Christoph Hellwig CC: Al Viro , linux-kernel@vger.kernel.org, Song Liu , Linus Torvalds , linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org From: hpa@zytor.com Message-ID: <366377E2-6F19-45E1-9285-CFA5E660C6B5@zytor.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On July 26, 2020 11:24:25 PM PDT, Christoph Hellwig wrote: >On Sun, Jul 26, 2020 at 11:20:41PM -0700, hpa@zytor=2Ecom wrote: >> On July 26, 2020 8:05:34 PM PDT, Al Viro >wrote: >> >On Tue, Jul 14, 2020 at 09:04:22PM +0200, Christoph Hellwig wrote: >> >> Don't rely on the implicit set_fs(KERNEL_DS) for ksys_open to >work, >> >but >> >> instead open a struct file for /dev/console and then install it as >FD >> >> 0/1/2 manually=2E >> > >> >I really hate that one=2E Every time we exposed the internal details >to >> >the fucking early init code, we paid for that afterwards=2E And this >> >goes over the top wrt the level of details being exposed=2E >> > >> >_IF_ you want to keep that thing, move it to fs/file=2Ec, with dire >> >comment >> >re that being very special shite for init and likely cause of >> >subsequent >> >trouble whenever anything gets changed, a gnat farts somewhere, etc=2E >> > >> > Do not leave that kind of crap sitting around init/*=2Ec; KERNEL_DS >> >may be a source of occasional PITA, but here you are trading it for >a >> >lot >> >worse one in the future=2E >>=20 >> Okay=2E=2E=2E here is a perhaps idiotic idea=2E=2E=2E even if we don't = want to >run stuff in actual user space, could we map initramfs into user space >memory before running init (execing init will tear down those mappings >anyway) so that we don't need KERNEL_DS at least? > >Err, why? The changes have been pretty simple, and I'd rather not come >up with new crazy ways just to make things complicated=2E Why? To avoid this neverending avalanche of special interfaces and layerin= g violations=2E Neatly deals with non-contiguous contents and initramfs in = device memory, etc=2E etc=2E etc=2E --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E