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 24EA8D637D5 for ; Thu, 14 Nov 2024 01:40:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8F8B76B009C; Wed, 13 Nov 2024 20:40:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A7B36B009E; Wed, 13 Nov 2024 20:40:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 796DD6B009F; Wed, 13 Nov 2024 20:40:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 5BB676B009C for ; Wed, 13 Nov 2024 20:40:12 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id F18D6140EE0 for ; Thu, 14 Nov 2024 01:40:11 +0000 (UTC) X-FDA: 82782994182.04.53CC9C0 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf19.hostedemail.com (Postfix) with ESMTP id 8F5F61A0006 for ; Thu, 14 Nov 2024 01:39:15 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf19.hostedemail.com: domain of "SRS0=0hMG=SJ=linux-m68k.org=gerg@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=0hMG=SJ=linux-m68k.org=gerg@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731548347; a=rsa-sha256; cv=none; b=rIs4HosqkYbEzPiAfb8sr+bhHOb3pe+Kz+M50QLVJ8/I5tAQ7iICwY2RfeVnWurJzzkF/f DPTwsANzZSB5ilU2ZEXZMS6/PaXVuFz6JnFhHK1OPk1J+4uH41zYH8jx0Kga5SUDrLBAux RqBp1vjwdwCwaMZ12neuv4RwZkNHU/o= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf19.hostedemail.com: domain of "SRS0=0hMG=SJ=linux-m68k.org=gerg@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=0hMG=SJ=linux-m68k.org=gerg@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731548347; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Sq9rNn9T//MSGQ4y0/1yL9tlfahIpW02mAaEWps24Nc=; b=YZca80vIl2J6Cywl7A82Zx2vgEzsPbDZo8adpTJwkAdR2U4wUKfswqLGAa/EQAnsUPS/CW qyyNlPmwTN2G2jB83H2FfruSt8QvYMuKQnhkNngBiF+zKvnZ49LevXoE+Fqil70abrbsEC N2sCgy4YqhbQ0ndN8h2zdKTMXfJF/j0= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id EF3335C5BD9; Thu, 14 Nov 2024 01:39:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03B73C4CEC3; Thu, 14 Nov 2024 01:40:05 +0000 (UTC) Message-ID: <7290bc34-d398-4ea1-8e52-193f1021e114@linux-m68k.org> Date: Thu, 14 Nov 2024 11:40:03 +1000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v2 02/13] x86/um: nommu: elf loader for fdpic To: Hajime Tazaki , geert@linux-m68k.org Cc: johannes@sipsolutions.net, linux-um@lists.infradead.org, ricarkol@google.com, Liam.Howlett@oracle.com, ebiederm@xmission.com, kees@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, dalias@libc.org References: <8bbfe73f7f1ef9f1a4674d963d1c4e8181f33341.camel@sipsolutions.net> Content-Language: en-US From: Greg Ungerer In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Queue-Id: 8F5F61A0006 X-Rspamd-Server: rspam11 X-Stat-Signature: 9sufmsd3o5is8az66gbb6r7p7ndanntt X-HE-Tag: 1731548355-948124 X-HE-Meta: U2FsdGVkX19F9H9n/Ul4j4tbSXG3J9Jjb7RHIq6ZbE1N60S+zyKKjgdDN5dS3OXXqvrk/H1DeYDggaFGZFP77ErlUMUe+xQFGwnqEn3X/FLRb7vvXIIiRQ2hKIoqkOY77MAa3LwFuT823T4Rx6NS2i7k51mfv1icqZQRNTbLmr5VHLPr87ZIGojJ7tDqWX1tapl+TDgbCmsolN1bS++feBbZLWRcdnUaJy1jJWfzMRrl2PFm5lAdttvAB0pSvZ5Ocln1ZrLjaQTJpUoPqVhGPkYLsS7JPDQ/V6vT0GU1jEDuKX8kET7ggZy5O5ejcS7sAaanTZWYltSieN+pHB91+MrzO62sKUTT1LjshuL/C78NPq5xmQSZ4hUeAgcBZUVyFRZB7WMEepYfFxqi6bfzpknBz6OLYZM26HSFb6qdgkUaWztiu9Zr8Nau/RWMjM8da5kYz/zMu4dyETscpLMcT+WhRBE/4JdTMGKamGYcSsuhIe2p7+wBcNOWxDlqLdV6Y/PQX4ErGwZvWHSc6jTqTMhcxQMMRgaG4aVGBlf318Cli+ba6MpPCj7lRnZNVDzmNVLALQjJPJgllmQpbWi5c1DeGHq2TS68gSrLHXaxsna+QwI6JmorVdfPk/1FCNvq69wIOtKRf85SDb+ZAE3CEBtfdWyRMvAQFbScyFp8YezZ3quQ3ocjdmdF4lxBR585Eo9P1Vyphm302znVbs3VlDrXG9d8xqsovKP+JY0I0t3nbMBxGqNV2Hb5qzvJ5FXLSAhDM1HtYNoOoQCYj9qsdBLQO2TSudoZEb4b242MHEYXrq8C1iE9dURKZeEe2xQ2sVvFWLQHxAWPVslDCypScIrUgo/rnlQefOnz4TnNs6kPQ7DGamjo6TBk4qhTtJTyLRjgDMJCOJXdwbKuG9uJA5uDshlUL4HwfOvBBCyJogKY17S3PoM2bK63iUOE8DJMeRsfpGpE7xRpx9806a0 CT12fJSB dF6eYcRqtsgJzkb6vk7ezxTApoFOPcAlUPyadhY5PJe2MQVSNDJgYNHEwPuE1z/ab13XCu/vew0bLRpCYqE7D8fzugy2qt/WBRXU5skBUAKbjC9O7Eep6Y37rThqY610/KE3junfTzSos3WJf/k8c2aMPFfBhHZgr3RZAJvM53utz8r7g7YQE1ktPmvZBB1zfvf+/2g9zSU/EjNDV+3vNUyvFeZoJYSo+SBpu5YtBLEmbZCXo5YzPiZKuEq5iLcObbu81iTYtD4JvCYbbnTnFcgLepdaJOgfMzO0jBdC58zvZRTAPcmXWBdU+rDmxm7mvRxW+J+R8tP92GsPvu/3vICNVwuPUBH1UdTnb4JJfsxNbmk73X9VULqMmjZ3HeUOj/caRx7ZVtK5Yrg8WsRH4Srql9iTvQ42KAWUTY88JBRKBG0kpRuzwzsMmjJNe5irov96j 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: Hi Hajime, On 14/11/24 09:32, Hajime Tazaki wrote: > On Wed, 13 Nov 2024 22:55:02 +0900, > Geert Uytterhoeven wrote: >> On Wed, Nov 13, 2024 at 2:17 PM Hajime Tazaki wrote: >>> On Wed, 13 Nov 2024 19:27:08 +0900, >>> Geert Uytterhoeven wrote: >>>> On Wed, Nov 13, 2024 at 9:37 AM Johannes Berg wrote: >>>>> On Wed, 2024-11-13 at 09:36 +0100, Johannes Berg wrote: >>>>>> On Wed, 2024-11-13 at 09:19 +0100, Geert Uytterhoeven wrote: >>>>>>> >>>>>>>>>> - depends on ARM || ((M68K || RISCV || SUPERH || XTENSA) && !MMU) >>>>>>>>>> + depends on ARM || ((M68K || RISCV || SUPERH || UML || XTENSA) && !MMU) >>>>>>>>> >>>>>>>>> s/UML/X86/? >>>>>>>> >>>>>>>> I guess the fdpic loader can be used to X86, but this patchset only >>>>>>>> adds UML to be able to select it. I intended to add UML into nommu >>>>>>>> family. >>>>>>> >>>>>>> While currently x86-nommu is supported for UML only, this is really >>>>>>> x86-specific. I still hope UML will get support for other architectures >>>>>>> one day, at which point a dependency on UML here will become wrong... >>>>>>> >>>>>> >>>>>> X86 isn't set for UML, X64_32 and X64_64 are though. >>>>>> >>>>>> Given that the no-MMU UM support even is 64-bit only, that probably >>>>>> should then really be (UML && X86_64). >>>>>> >>>>>> But it already has !MMU, so can't be selected otherwise, and it seems >>>>>> that non-X86 UML >>>>> >>>>> ... would require far more changes in all kinds of places, so not sure >>>>> I'd be too concerned about it here. >>>> >>>> OK, up to you... >>> >>> Indeed, this particular patch [02/13] intends to support the fdpic >>> loader under the condition 1) x86_64 ELF binaries (w/ PIE), 2) on UML, >>> 3) and with) !MMU configured. Given that situation, the strict check >>> should be like: >>> >>> depends on ARM || ((M68K || RISCV || SUPERH || (UML && X86_64) || XTENSA) && !MMU) >>> >>> (as Johannes mentioned). >>> >>> on the other hand, the fdpic loader works (afaik) on MMU environment so, >>> >>> depends on ARM || (UML && X86_64) || ((M68K || RISCV || SUPERH || XTENSA) && !MMU) >>> >>> should also works, but this might be too broad for this patchset (and >>> not sure if this makes a new use case). >> >> AFAIK that depends on the architecture's MMU context structure, cfr. >> the comment in commit 782f4c5c44e7d99d ("m68knommu: allow elf_fdpic >> loader to be selected"), which restricts it to nommu on m68k. If it >> does work on X86_64, you can drop the dependency on UML, and we're >> (almost) back to my initial comment ;-) > > I checked and it doesn't work as-is with (UML_X86_64 && MMU). > restricting nommu with UML might be a good to for this patch. > > even if it works, I would like to focus on UML && !MMU for this patch > series since I wish to make the (initial) patchset as small as > possible. If we would like to make it broadly available on x86, that > would be a different patch. Makes sense. I was only interested in the ability to run ELF based static/PIE binaries when I did 782f4c5c44e7d99d ("m68knommu: allow elf_fdpic loader to be selected"). I did the same thing for RISC-V in commit 9549fb354ef1 ("riscv: support the elf-fdpic binfmt loader"), limiting it to !MMU configurations only. There is no need for binfmt_fdpic in MMU configurations if all you want to do is run ELF PIE binaries. The normal binfmt_elf loader can load and run those already. Regards Greg >>> anyway, thank you for the comment. >>> # I really wanted to have comments from nommu folks. >> >> I've added some in CC... > > Thanks, > > -- Hajime