Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp6719706rwj; Wed, 21 Dec 2022 20:40:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXsHKS1IAFxeAeZizKhwFidw7wgbtwViQ2pIJaJESfcVWZNqUaiqdixQX3un1ykcSs0aapuD X-Received: by 2002:a05:6402:4150:b0:47e:1b4a:5491 with SMTP id x16-20020a056402415000b0047e1b4a5491mr3662674eda.20.1671684040256; Wed, 21 Dec 2022 20:40:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671684040; cv=none; d=google.com; s=arc-20160816; b=cRMytXebvBEII9TpBO1x9XqWhd0GGFsXB7c95BUoleqVSXVUU2JgypFdqeP7sEoX1j JUlfY3Or4eEpnhzB646gd1aYrvPdtBQ5vmikfScATWQHjlIbY8MK+smH+cHiiTw10UTI jGA+ELohtFbrNPbWI117K+nj9ZZHOgfGmnOX0m4GCO14GL2DRsua7Hm7R5N+ENnXa7PZ pENBKU8asOoyzFFIGv8MiDVgReYJ3I6EFCXNYzkbiBFKW0tYJlBycANyvJUgsUf/Kchy 7EaDc3HYSTNh1xKTZtr/pjAZU19PlapRYMBalOv81G2MS6DINqjpD2F48mMXJq9faac6 M/7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=XgR+YsBAw7iviKiFhEMXKyN+0KSbLgBHVjJlkT/s0DM=; b=ICIASC6EEHKGw6dgqJfJ9BQVS/38s7GNB47Suo850zK8SwACj4O2ZrCWrVGS/pdVTR b8H2AwcC8piAKzBfhOjWaQo2oXKGuMUNaVLiKMctxD/AhwKCcWx3P3s9ggIOfQTaLfdi gmrgV2b5s763aQ0GiNJ3yZ+5vg8HAD+xp9nPSojQk42OiyaAEBhn1cpoEitConex7aHU /F5fElTlLS3skuLzM/CYLx91d3XkTNc3PAFCBSTi9s50AMLPfznwaezgKUDINJ0VRKBV WsEVxZwnTAQFW4qmrCbKFQ5mbQLgIz3oMKsY0FYLLZe4JrgSfB5kPo2HiE1JnxrPH9vU meJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb9-20020a0564020d0900b0046b9c536fa7si16540274edb.286.2022.12.21.20.40.22; Wed, 21 Dec 2022 20:40:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234932AbiLVEfQ (ORCPT + 68 others); Wed, 21 Dec 2022 23:35:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbiLVEfM (ORCPT ); Wed, 21 Dec 2022 23:35:12 -0500 Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2CF5714D04; Wed, 21 Dec 2022 20:35:10 -0800 (PST) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 2BM4Yq2T029352; Thu, 22 Dec 2022 05:34:52 +0100 Date: Thu, 22 Dec 2022 05:34:52 +0100 From: Willy Tarreau To: Ammar Faizi Cc: Shuah Khan , "Paul E. McKenney" , Gilang Fachrezy , VNLX Kernel Department , Alviro Iskandar Setiawan , Kanna Scarlet , Muhammad Rizki , GNU/Weeb Mailing List , Linux Kernel Mailing List , Linux Kselftest Mailing List Subject: Re: [RFC PATCH v1 0/8] nolibc signal handling support Message-ID: <20221222043452.GB29086@1wt.eu> References: <20221222035134.3467659-1-ammar.faizi@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221222035134.3467659-1-ammar.faizi@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ammar, On Thu, Dec 22, 2022 at 10:51:26AM +0700, Ammar Faizi wrote: > From: Ammar Faizi > > Hi, > > This series adds signal handling support to the nolibc subsystem. (...) Thank you! I'll have a look at this this week-end. I noticed one thing that we'll need to discuss further: > 3) Extra nolibc updates. > > Apart from the signal handling support. This series also contains > nolibc updates, they are: > > - getpagesize() support. This one relies on /proc/self/auxv, but we'll quickly run into a chicken-and-egg situation given that nolibc is used by init programs that mount /proc. Instead I think that we should modify the _start code to retrieve the auxv at startup and store it somewhere. This "somewhere" is not yet defined, but I'm thinking that it could deserve reserving some room in the stack to store some nolibc-defined information (possibly even a copy of a pointer to environ and/or errno) and figure a reliable and simple way to access this. Note that one way could also be to know that it's after the NULL that follows envp, and to start from environ. In fact there are plenty of ways and we just need to decide what's the least ugly. But once we have access to the auxv from the process, then we could implement a getauxval() function to retrieve the information you need for getpagesize(). More on this later. Thanks! Willy