From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 C2D1C19E992; Sat, 13 Dec 2025 06:57:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765609042; cv=none; b=TaIX2YSN9nsNUc/XREgZNaEVFx/XeAiUbzfta1zMJK8ALvQW7ArEthighigLlw1o49ZekqEdFHXetDzXwDBbPrK7kGGK6lmQPxHhxEYbhkSX4PgtyTTRncxyk5s9ddJO6KeH8j69AgWtjoDMWknGhR+RJ30+fqg9LzL7ZJVtF1I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765609042; c=relaxed/simple; bh=Qj0khJmUFOHX1x+G6h6dTnfGsEgUD6DX7A42tG3lZz4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=B8Y+KWaqTFHFflelpJrYzPLvWMB41v4rTflviIqeWbRAC6s35+tTbLUJZC20hsxwgeUNUGJS8FPg5V9Y0oIM19WSMKt1ecdUwp5A9KWwjDRAclk4uLFX2XC2JQ8rl/wFun1gtjC8w3DHInvHTcHvIH2zmB5BwRtXn1hWyNxfRj4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=2Wp77FJW; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="2Wp77FJW" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=UxVyimGao7p0sqobtYKOAtYcaEFn3ktSbdCzD3T7UOM=; b=2Wp77FJW1QESi4u/Ikpi/5sH98 2n09GBbxkBnzNeqR7/bLDordnvS0VbZ3ISU+6B/iF2FyALRRwyWaFgYrLrm68hMGQ2TKr1AP03xBx 9Hj4cmilLnMyteyZVGWxdsdye3IzECUwZu/a632Vwt8dF5pSQQXA6Vn3bfCgeoTEFOd+la+5ycefT XbQ4c0xVUBZFsNadBc+Mhun8jPAM8YcsnRiMciyE48aFXqkhLimuJLnXbledwuEV8VQe7Kvt83dHb 0NbFfYdlDF761J3TDFvi0J0e9S5TE6CgjsgfUs1TyQ6oCF4YjYcfpOL9wbOhOxqnSDYqSmSLGj2Ii eejUXsVg==; Received: from [50.53.43.113] (helo=[192.168.254.34]) by bombadil.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vUJYx-00000001TgZ-1cAT; Sat, 13 Dec 2025 06:57:07 +0000 Message-ID: <5903a8e1-71c6-4546-ac50-35effa078dda@infradead.org> Date: Fri, 12 Dec 2025 22:57:02 -0800 Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 00/26] Introduce meminspect To: Eugen Hristev , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, tglx@linutronix.de, andersson@kernel.org, pmladek@suse.com, corbet@lwn.net, david@redhat.com, mhocko@suse.com Cc: tudor.ambarus@linaro.org, mukesh.ojha@oss.qualcomm.com, linux-arm-kernel@lists.infradead.org, linux-hardening@vger.kernel.org, jonechou@google.com, rostedt@goodmis.org, linux-doc@vger.kernel.org, devicetree@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-arch@vger.kernel.org, tony.luck@intel.com, kees@kernel.org, Trilok Soni , Kaushal Kumar , Shiraz Hashim , Peter Griffin , stephen.s.brennan@oracle.com, Will McVicker , "stefan.schmidt@linaro.org" References: <20251119154427.1033475-1-eugen.hristev@linaro.org> Content-Language: en-US From: Randy Dunlap In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, On 12/12/25 10:48 PM, Eugen Hristev wrote: > > > On 11/19/25 17:44, Eugen Hristev wrote: >> meminspect is a mechanism which allows the kernel to mark specific memory >> areas for memory dumping or specific inspection, statistics, usage. >> Once regions are marked, meminspect keeps an internal list with the regions >> in a dedicated table. > > [...] > > >> I will present this version at Plumbers conference in Tokyo on December 13th: >> https://lpc.events/event/19/contributions/2080/ >> I am eager to discuss it there face to face. > > Summary of the discussions at LPC talk on Dec 13th: > > One main idea on the static variables annotation was to do some linker > magic, to create a list of variables in the tree, that would be parsed > by some script, the addresses and sizes would be then stored into the > dedicated section at the script level, without having any C code change. > Pros: no C code change, Cons: it would be hidden/masked from the code, > easy to miss out, which might lead to people's variables being annotated > without them knowing > > Another idea was to have variables directly stored in a dedicated > section which would be added to the table. > e.g. static int __attribute(section (...)) nr_irqs; > Pros: no more meminspect section Cons: have to keep all interesting > variables in a separate section, which might not be okay for everyone. > > On dynamic memory, the memblock flag marking did not receive any obvious > NAKs. > > On dynamic memory that is bigger in size than one page, as the table > entries are registered by virtual address, this would be non-contiguous > in physical memory. How is this solved? > -> At the moment it's left for the consumer drivers to handle this > situation. If the region is a VA and the size > PAGE_SIZE, then the > driver needs to handle the way it handles it. Maybe the driver that > parses the entry needs to convert it into multiple contiguous entries, > or just have virtual address is enough. The inspection table does not > enforce or limit the entries to contiguous entries only. > > On the traverse/notifier system, the implementation did not receive any > obvious NAKs > > General comments: > > Trilok Soni from Qualcomm mentioned they will be using this into their > software deliveries in production. > > Someone suggested to have some mechanism to block specific data from > being added to the inspection table as being sensitive non-inspectable > data. > [Eugen]: Still have to figure out how that could be done. Stuff is not > being added to the table by default. > > Another comment was about what use case there is in mind, is this for > servers, or for confidential computing, because each different use case > might have different requirements, like ignoring some regions is an > option in one case, but bloating the table in another case might not be > fine. > [Eugen]: The meminspect scenario should cover all cases and not be too > specific. If it is generic enough and customizable enough to care for > everyone's needs then I consider it being a success. It should not > specialize in neither of these two different cases, but rather be > tailored by each use case to provide the mandatory requirements for that > case. > > Another comment mentioned that this usecase does not apply to many > people due to firmware or specific hardware needed. > [Eugen]: one interesting proposed usecase is to have a pstore > driver/implementation that would traverse the inspection table at panic > handler time, then gather data from there to store in the pstore > (ramoops, mtdoops or whatever backend) and have it available to the > userspace after reboot. This would be a nice use case that does not > require firmware nor specific hardware, just pstore backend support. > > Ending note was whether this implementation is going in a good direction > and what would be the way to having it moving upstream. > > Thanks everyone who attended and came up with ideas and comments. > There are a few comments which I may have missed, so please feel free to > reply to this email to start a discussion thread on the topic you are > interested in. > > Eugen > Maybe you or someone else has already mentioned this. If so, sorry I missed it. How does this compare or contrast to VMCOREINFO? thanks. -- ~Randy