From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 424643E9C32; Wed, 8 Jul 2026 07:53:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783497189; cv=none; b=XAO7S/VzY74ZfgWyGiUecEG2FE5SvELNW2nCSBpvgoLZf0QJIFpihaGHg48UMlOxzJDJIGr6ZQCro1FnxzFPhUlxo8Ud1Xes0vjfpTvcGWafxZ+s+kPBE6EH2bkmIrWckvjeF/gLA+G/JuKlmqtfj89EGrxAMnyfkGLLzM1deDg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783497189; c=relaxed/simple; bh=yjnhgMqlOKyC034wTGb4EUcTXAvQiWaWYjtwkXwBg00=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=t4Sq6uGeJft/kHmseQntOUpw9oXZor80T8tFcBIYRSolOyFLgz9yFBWplAuBjzgvE8AgU5GqGeA6tRIu1ufTJs7Ikjw2VI7gVDtc2glKLPTWy/aak5yxJQKa2TiQIzVz2UPHLCF0jR76UVWwoocnvKSRZqvEFhnvj1PN6UfhMQc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H9YaHWQr; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="H9YaHWQr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DFF11F00A3D; Wed, 8 Jul 2026 07:52:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783497177; bh=7K4NCcrN3IVlK9BJtN3q7S9JVAIiJu4qBDxqNODXPvM=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=H9YaHWQrK1YujDYyV6crTr6KbOYfjzzQIBWVR7KE/419stnNd4ED/M5LA5tCOsCDB 36pgz7R6/0Zf0am5FTTAZXpKWlctvMKmZ7IhwGjLLqXMEVSXpZhmILwnH4MEgyImci xzlIxy3qsNMJBRt4Oq1ZJrXCytH2i2dTNpcM4K5lcVbdc0zu9bAvOnVZCCZG+e2SLU 9DOmhcPONM14BRhrGKxlKlMgTPA2Xm+rELQNHcsW+T2I5NJtH02mPB/JjN9IUBlicR lL7B298F3VYVAPUZiBiv1DGsnNqp2PefONaDjlqtIKu6Fyr1mMHbRtPn8CKsuiTBVI FvJ1smPFQdcEg== Date: Wed, 8 Jul 2026 08:52:36 +0100 From: Lorenzo Stoakes To: Mukesh Ojha Cc: Jonathan Corbet , Shuah Khan , Eugen Hristev , Arnd Bergmann , Dennis Zhou , Tejun Heo , Christoph Lameter , Andrew Morton , Thomas Gleixner , Peter Zijlstra , Anna-Maria Behnsen , Frederic Weisbecker , John Stultz , Stephen Boyd , Kees Cook , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , David Hildenbrand , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , Chris Li , Kairui Song , Kemeng Shi , Nhat Pham , Baoquan He , Barry Song , Youngjun Park , Petr Mladek , John Ogness , Sergey Senozhatsky , Bjorn Andersson , Mathieu Poirier , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Saravana Kannan , workflows@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v3 14/26] mm/init-mm: Annotate static information into meminspect Message-ID: References: <20260708-meminspect-v3-v3-0-7aa5a0a74d5c@oss.qualcomm.com> <20260708-meminspect-v3-v3-14-7aa5a0a74d5c@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260708-meminspect-v3-v3-14-7aa5a0a74d5c@oss.qualcomm.com> NAK. You're exporting internal mm stuff to drivers, in no world are you going to do that, sorry. On Wed, Jul 08, 2026 at 11:01:53AM +0530, Mukesh Ojha wrote: > From: Eugen Hristev > > Annotate vital static information into inspection table: > - init_mm > - swapper_pg_dir > - _sinittext > - _einittext > - _end > - _text > - _stext > - _etext > > Information on these variables is stored into dedicated meminspect > section. > > Signed-off-by: Eugen Hristev > Signed-off-by: Mukesh Ojha > --- > mm/init-mm.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/mm/init-mm.c b/mm/init-mm.c > index 3e792aad7626..cf53058410b1 100644 > --- a/mm/init-mm.c > +++ b/mm/init-mm.c > @@ -7,6 +7,8 @@ > #include > #include > #include > +#include Hate the idea of a very specific inspection mechanism hooking into core mm initialisation in general. If you thing needs to do this, your thing is broken IMO. > +#include Err sections? So now this file is now a dumping ground for meminspect ELF section declarations? > > #include > #include > @@ -19,6 +21,13 @@ > > const struct vm_operations_struct vma_dummy_vm_ops; > > +MEMINSPECT_AREA_ENTRY(_sinittext, sizeof(void *)); > +MEMINSPECT_AREA_ENTRY(_einittext, sizeof(void *)); > +MEMINSPECT_AREA_ENTRY(_end, sizeof(void *)); > +MEMINSPECT_AREA_ENTRY(_text, sizeof(void *)); > +MEMINSPECT_AREA_ENTRY(_stext, sizeof(void *)); > +MEMINSPECT_AREA_ENTRY(_etext, sizeof(void *)); Is this just a weird way of getting ELF symbols? > + > /* > * For dynamically allocated mm_structs, there is a dynamically sized cpumask > * at the end of the structure, the size of which depends on the maximum CPU > @@ -50,6 +59,9 @@ struct mm_struct init_mm = { > INIT_MM_CONTEXT(init_mm) > }; > > +MEMINSPECT_SIMPLE_ENTRY(init_mm); > +MEMINSPECT_AREA_ENTRY(swapper_pg_dir, sizeof(void *)); Absolutely, positively not, this is totally insane and COMPLETELY violates separation between drivers and mm. We already let drivers access FAR too much. Exporting core mm internals would be like giving up on any semblence of separation of concerns. > + > void setup_initial_init_mm(void *start_code, void *end_code, > void *end_data, void *brk) > { > > -- > 2.53.0 > Thanks, Lorenzo