From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9B16C8564F; Tue, 9 Apr 2024 23:11:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712704303; cv=none; b=ngKPQKkT178F2IJ/YZsQ8piHMMEDIpFqUQESE/eN7p3F9p7iy6E4N4cuM5ZsXKDeg20J2oMFkMSlR8TdNcWhQ1u/BuS9PmxZsoUdRyQmwYq5IJFv83QZLfDldnNNpcxLmwx9ms0e6MxjtXGLpwgSpF4FzNzkLQzkHCFo27a0QsU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712704303; c=relaxed/simple; bh=zqMvd3goUtBo22/1JXz1tlIsS734Ma7sGBUHXK3xrqE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AdwpLoW8hTl3BfIYdsDTge0LCuDKIp3O9DFfATKTflI3ufLJacUs4p6PUTp0wjVh8v0dVFfxAWtW8RVG4dcpZ98rC40Xm1UvIHzjB1KYx/wMKOb67WfRlaj+r8vICniaArYwqE0K3UqnUBQuEwfVByN7y+RK4yAhVA/pzSZIq5Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F495C433C7; Tue, 9 Apr 2024 23:11:40 +0000 (UTC) Date: Tue, 9 Apr 2024 19:14:15 -0400 From: Steven Rostedt To: Kees Cook Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , "Liam R. Howlett" , Vlastimil Babka , Lorenzo Stoakes , linux-mm@kvack.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , Tony Luck , "Guilherme G. Piccoli" , linux-hardening@vger.kernel.org, Guenter Roeck , Ross Zwisler , wklin@google.com, Vineeth Remanan Pillai , Joel Fernandes , Suleiman Souhlal , Linus Torvalds , Catalin Marinas , Will Deacon Subject: Re: [POC][RFC][PATCH 2/2] pstore/ramoops: Add ramoops.mem_name= command line option Message-ID: <20240409191415.5a7b445f@gandalf.local.home> In-Reply-To: <202404091514.B97720B8@keescook> References: <20240409210254.660888920@goodmis.org> <20240409211351.234897475@goodmis.org> <202404091514.B97720B8@keescook> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 9 Apr 2024 15:18:45 -0700 Kees Cook wrote: > > @@ -914,6 +919,19 @@ static void __init ramoops_register_dummy(void) > > { > > struct ramoops_platform_data pdata; > > > > +#ifndef MODULE > > + /* Only allowed when builtin */ > > Why only when builtin? Well, because the memory table that maps the found physical memory to a lable is marked as __initdata, and will not be available after boot. If you wanted it for a module, you would need some builtin code to find it. > > > + if (mem_name) { > > + u64 start; > > + u64 size; > > + > > + if (memmap_named(mem_name, &start, &size)) { > > + mem_address = start; > > + mem_size = size; > > + } > > + } > > +#endif > > Otherwise this looks good, though I'd prefer some comments about what's > happening here. > > (And in retrospect, separately, I probably need to rename "dummy" to > "commandline" or something, since it's gathering valid settings here...) Yeah, that was a bit confusing. I kept thinking "is this function stable?". -- Steve