Received: by 2002:ab2:687:0:b0:1f4:6588:b3a7 with SMTP id s7csp100634lqe; Tue, 9 Apr 2024 16:18:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW1O2Uvioj/mkQChQDyRTe96fku56ZqMe4ssr4J6DHCFp+mRxLFojKir5dSn1pb/7ogLVjZpMXeJRGir6WF46mJk9SqeErFFtgxqeHcnQ== X-Google-Smtp-Source: AGHT+IFV/95A3Jl7vehwbAo1EOVaNeoJ/kNOV/scUifeaq2wFZmvDI+nD1XHJU8uZ/KN77PVs+hy X-Received: by 2002:a2e:a782:0:b0:2d8:cd7f:3cc8 with SMTP id c2-20020a2ea782000000b002d8cd7f3cc8mr239458ljf.20.1712704736090; Tue, 09 Apr 2024 16:18:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712704736; cv=pass; d=google.com; s=arc-20160816; b=yrqZACCGw/XwdRMG9iA8z/+SWiBbr/7z/WwbymgddVYkz0TFMV0EzudhBYyPqtKT47 oG7/QMsP9P7KwRx0nEqiKfxOpx2yqKZ58XCIyTlYr54WJodlY1+9iUqL+QSwXs5Z2B08 mMHedu6HrkMCPgtUOLZh2CsBiCMSDEJ61vIxyxGgaWVs9ZUX5xeI9/eN2xt1IEYkaKgf P2a01a6gOAlPpEloS5FcZ6Iq912a6kPTVU9Y6ldK0oReWRfgF1SIPKm4K9i5hIZl4gp8 e05Us32ad1Aah8RRX3NPuqUJWtUOoGYODpyhv8p28GYEyQDJs2x6XwmnWHqwgkiM4VSr NYrQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=scPXn7OPZcBAQ5tsfarcdTYG1jfj6rduFM26kAQ55+s=; fh=sqjMRHlm97LKfcjs7kVZBKvrPwI+KX5ISxqLEe/vPlk=; b=pvzMweMDZ55sZWsNilFYACXCvi0hNqn2keimkaq6JOHTzOmcnUEYRiDWg56nKl6kUG TAp0YHRb9wCm44s38bO72z8T3gQzA3jnjKZSznhJrWyQGOS1XuBx2Ke9wB+ctWcUimD9 v09ALHaHbGKvkDwkFeDLXXG7A9NCecqrRegUztkwaNKoe+cF9omBkIhdX42GN+5aCKR8 Wnz8y8Kf82iNgX+PeCuC2UUK4sekn2CDB7iXhL8j0szSwxT3PohJLkL7hRcEka2KlioA r2xfjRJs43DUCu0p5/YO40C9zTheeFm5NujyEdFln30VR4wf3e+l5JNcrWhD/JqZtjkB LQHQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-137688-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137688-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id r29-20020a50d69d000000b0056e85bb3cb7si372369edi.457.2024.04.09.16.18.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 16:18:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137688-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-137688-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137688-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1A6CF1F2459F for ; Tue, 9 Apr 2024 23:11:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 22E5D158DB0; Tue, 9 Apr 2024 23:11:44 +0000 (UTC) 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-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