From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4851AE7717F for ; Fri, 13 Dec 2024 20:02:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A809E6B0082; Fri, 13 Dec 2024 15:02:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A301A6B0083; Fri, 13 Dec 2024 15:02:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F7D06B0088; Fri, 13 Dec 2024 15:02:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 710786B0082 for ; Fri, 13 Dec 2024 15:02:43 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 2948242F04 for ; Fri, 13 Dec 2024 20:02:43 +0000 (UTC) X-FDA: 82891008060.11.B28C5C2 Received: from out02.mta.xmission.com (out02.mta.xmission.com [166.70.13.232]) by imf07.hostedemail.com (Postfix) with ESMTP id 7218B40003 for ; Fri, 13 Dec 2024 20:02:08 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; spf=pass (imf07.hostedemail.com: domain of ebiederm@xmission.com designates 166.70.13.232 as permitted sender) smtp.mailfrom=ebiederm@xmission.com; dmarc=pass (policy=none) header.from=xmission.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734120133; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eDVY25onPaZtCJX+iVfKNsi9Z56goiXb90v/iUb9VGc=; b=TejnbyiGgb5bImgL7Y5UndvZlaZiblyrWUZq9SxvROK4jXa7r7Ge67ymdrBDICzmkI8v+S XCrQsIuFf8HvzPyJeJLxzklOKmzKX2QYjnAiUkG2oYS8X/1/Bt1NIip4GAhqRDmcC6hPfk cGVSM2abAu2IO2gEaE6zZ/95exXI1j8= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; spf=pass (imf07.hostedemail.com: domain of ebiederm@xmission.com designates 166.70.13.232 as permitted sender) smtp.mailfrom=ebiederm@xmission.com; dmarc=pass (policy=none) header.from=xmission.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734120133; a=rsa-sha256; cv=none; b=xyxKfER+0gKFscHz3SCyMCpmfVYl9gcddgunONCALvmo08yP4sjc6UZkE9iUnQ/Qkw3dWZ CsQKVF3LlDAvC7yYLzNIHKdNt+N3IEt61nMj1sXLKQis0lWOj7JxIoIqvn3+837HyOZtB8 l3oPNrlxU5IHFdQXoltIzXPko+YbnR4= Received: from in02.mta.xmission.com ([166.70.13.52]:56908) by out02.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1tMBrx-001B4G-AP; Fri, 13 Dec 2024 13:02:37 -0700 Received: from ip72-198-198-28.om.om.cox.net ([72.198.198.28]:35748 helo=email.froward.int.ebiederm.org.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1tMBrw-002tmk-00; Fri, 13 Dec 2024 13:02:36 -0700 From: "Eric W. Biederman" To: Hajime Tazaki Cc: linux-um@lists.infradead.org, ricarkol@google.com, Liam.Howlett@oracle.com, kees@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org References: <87r06d0ymg.fsf@email.froward.int.ebiederm.org> Date: Fri, 13 Dec 2024 14:01:58 -0600 In-Reply-To: (Hajime Tazaki's message of "Fri, 13 Dec 2024 16:19:46 +0900") Message-ID: <87bjxf1he1.fsf@email.froward.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1tMBrw-002tmk-00;;;mid=<87bjxf1he1.fsf@email.froward.int.ebiederm.org>;;;hst=in02.mta.xmission.com;;;ip=72.198.198.28;;;frm=ebiederm@xmission.com;;;spf=pass X-XM-AID: U2FsdGVkX19sW1PHOHAP9tXVu8GxcVgFKkZKUriqvqM= Subject: Re: [PATCH v5 02/13] x86/um: nommu: elf loader for fdpic X-SA-Exim-Connect-IP: 166.70.13.52 X-SA-Exim-Rcpt-To: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, jack@suse.cz, brauner@kernel.org, viro@zeniv.linux.org.uk, kees@kernel.org, Liam.Howlett@oracle.com, ricarkol@google.com, linux-um@lists.infradead.org, thehajime@gmail.com X-SA-Exim-Mail-From: ebiederm@xmission.com X-SA-Exim-Scanned: No (on out02.mta.xmission.com); SAEximRunCond expanded to false X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 7218B40003 X-Rspam-User: X-Stat-Signature: 4r1qebtcbmsyhiz4drf7t7fu55ksgsph X-HE-Tag: 1734120128-105229 X-HE-Meta: U2FsdGVkX19xwaqyQrkigAsTYXuvs3o4TSbqacuvKGbM7El+GjUPOYeEFSl7vpwkw4zJyZcUP8t67pDRRhEVV3oO0JbKkJTXj/opbffh/pk1RhB5FHVbU6uZn/GvmWUOVCXWMVXZdfiFOtKkZP1Rs2C590qg8wCfdM6oJjDvYR1tuq0qh9NrPAsLqhD/nksSvtZl9dZ+0GGPzRuVOr/hA5eRk17TfYkoaZ5UTuPtx0nznGFtH0h3Xt9SXoIBx6QfFx9amGq97q8WeP0vp342I+8oeGpBAQaru3Nt5+sg+fQcYeMLnR8zT2nMal3AdX4rrdq7Sdj/kJBSQ348ZmBaJCzctUulmBDkvcnyz/HiLW+o8w5Ck2+a3M1UxP4Pc9G4GAMDnY3osDBb1XU0EzvRRyZcuq4AB7YqkoLmGAHNM6CBPfLiMQqKcaPPJTF72Zjtowsj0k3EiQTFzYrw2BviQXNpkPVAER03PY72WtTRmBUyRRgjrvtq/2RJArU6yaja03lBUhxAkB/oDVMPCujm2R9nLO34hBoHm8lJ7SyNAey1mkoGGovSJN3qqQ4m9BOvDDasmv+DlbmMtcrnv+ZN61uuvqd2kciMPGvbCy5WkujtSGNSB0YCjA/fG5yJDgZ3gC/mVeN0cgNyik0FI/RsCCbi+JEDbDiTEsEPIQLO992UDF3sSE35UkULXsVnmK0c6rTa5Ia07X3xRqfKNGm5fZiEeEZs/H+gXou2nxq2V5QKA3E2E/OAiCzUbY5JcLygqRHhv2O+xA+vO72U/0LS+Rjal14mV1CW9VOnaQkiLS8rNoOVBoHN3bhJGlV5zEET7Ka8gk7Zsx9C02bGT8Z5X8qYB/cX8GgE9YC6drL7lKCaf+TPm6EUsHWnh+M7s9ylAGfpmifREFqBmjEXh12yGJNKAMF/e+qPdPaRSyckERjtmS9NCpon7wTr4XkOdLDG8pnxIBHzC2bb6cvPx7Z qCiywaZZ UDSU4rway3U3KjslzGTMU7Ei9sZ5rE+Q9mDXu+Ux2/yPOqfk= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hajime Tazaki writes: > Hello Eric, > > thanks for the feedback. > > On Thu, 12 Dec 2024 23:22:47 +0900, > Eric W. Biederman wrote: >> >> Hajime Tazaki writes: >> >> > As UML supports CONFIG_MMU=n case, it has to use an alternate ELF >> > loader, FDPIC ELF loader. In this commit, we added necessary >> > definitions in the arch, as UML has not been used so far. It also >> > updates Kconfig file to use BINFMT_ELF_FDPIC under !MMU environment. >> >> Why does the no mmu case need an alternative elf loader? > > I was simply following the way how other nommu architectures (riscv, > etc) did. > >> Last time I looked the regular binfmt_elf works just fine >> without an mmu. I looked again and at a quick skim the >> regular elf loader still looks like it will work without >> an MMU. > > I'm wondering how you looked at it and how you see that it works > without MMU. I got as far as seeing that vm_mmap should work. As all of the bits for mmap to work, are present in both mmu and nommu. >> You would need ET_DYN binaries just so they will load and run >> in a position independent way. But even that seems a common >> configuration even with a MMU these days. > > Yes, our perquisite for this nommu port is to use PIE binaries so, > ET_DYN assumption works fine for the moment. > >> There are some funny things in elf_fdpic where it departs >> from the ELF standard and is no fun to support unless it >> is necessary. So I am not excited to see more architectures >> supporting ELF_FDPIC. > > I understand. > > I also wish to use the regular binfmt_elf, but it doesn't allow me to > compile with !CONFIG_MMU right now. Then I may simply be confused. Where does the compile fail? Is it somewhere in Kconfig? I could be completely confused. It has happened before. I just react a little strongly to the assertion that elf_fdpic is the only path when I don't see why that should be. Especially for an architecture like user-mode-linux where I would expect it to run the existing binaries for a port. > I've played a little bit with touching binfmt_elf.c, but not finished > yet with a trivial attempt. > > sorry, i'm not familiar with this part but wish to fix it for > nommu+ET_EYN if possible with a right background information. Eric