Received: by 2002:ab2:687:0:b0:1f4:6588:b3a7 with SMTP id s7csp50713lqe; Tue, 9 Apr 2024 14:11:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVyCgmeSaAieNsXmmdkff9HtTBNlOAA04B69JpVXVhI81+hYbJDlkwZDoLuKjtDRafttVD6PtVH4o9Vh/13sT60SQlvgOllL9UtyOlEtQ== X-Google-Smtp-Source: AGHT+IFSy5Cnu54Hqnv3gu/Dml6rz0dIZoS2WC6QeEAGdNFZ6cDVZ4eVzZTFActKHrWLyInCiril X-Received: by 2002:a05:6a20:4391:b0:1a7:5bba:98bd with SMTP id i17-20020a056a20439100b001a75bba98bdmr1185871pzl.36.1712697085913; Tue, 09 Apr 2024 14:11:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712697085; cv=pass; d=google.com; s=arc-20160816; b=CK0PyH6U/iJ6SNmk+Xz6nsJlR77iahTAlBh72Ddrf9VM1YPFlV9eRJ5dRu4Vw6VS/9 cdDOceke2vlwWsgFDZQOmdJ4lmXaPCU8BLf/gm3XdCTOYGxpOLWK4mn0NKyuNCoYu3Th KoG0ne2rpuO+ADpbfURuiuT60WASicojpvxTTuQe/vdVwbG6wfKmK8rNqcY69iAebJLs mARgu5ojxqgrxaI0XHzDxlMJKvX6PdwGjVv1oF37oOUkIfxW+ciKLJVFkaL2ePJsCocw U0YC0y5m8uHfJQIHn1gVYljURhBt4JJu3ZuCSUxMB2p5l3kTHqQfCF5LN5wYTICtWOe8 ARbw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id; bh=sLcpGc76wNT4fHaDjTFl8tf9Gen4NZ7+dEBshn2Gw9E=; fh=6IcUNdfhJQlDYnigfCUYv7tnucWksWPmW4YOa0+VFLM=; b=ZdDBdvA2BdkaF5cKCiIvIo4ZlFfJv71y3KfKKW6Fk8aLZPSIyZQvYNMG1vIIEFBbgK pjBI/QKteHpo+TlSIVxIPQFkKZrcFH+9NHKbm5T58XRXvpP8VdizVLSmgZQUU5f/2JpV ActfcKmHXL4GqheP6Y/eVFCFvHGYacH8wSXamlP9iVdSZjaNajmGhHtT3hAHW0rvrYIX tTfCcVOKVHD9SNAkdB7LBJ54MR/loCP8EgRvQCDFWI1h7SAs4uocfHjuztQ2wnDgcTkv Ldx3vFI9Uzjf3uJ4PmgBmvo1XD/3LUWUABkgL977vT6jAuoie4nIskmi2Gr3Ay8jt371 c7wA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-137630-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137630-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e32-20020a631e20000000b005dc7e74bd95si9035398pge.564.2024.04.09.14.11.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 14:11:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137630-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-137630-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137630-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8F71E28454A for ; Tue, 9 Apr 2024 21:11:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66EBB158A0B; Tue, 9 Apr 2024 21:11:16 +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 D8D982905; Tue, 9 Apr 2024 21:11:15 +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=1712697075; cv=none; b=CLii9lW3Z3MTOFyLAE96hkSgzG2lLA0GW08xdMHN3LBOYGkJJdCnI93N7sFartalOzomy87K2fj+1Q05EFEIf60hOQpOxGDnrVnzvurV5c3gBsKlaMuKyIsH7cp8hnRRt7to6kGzO+0fPszx5/rPPA/1gt69DeO4Rx5BnSPOShI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712697075; c=relaxed/simple; bh=ElVDNmYvP/wbcQKWFCeHfImQrTWe9WSMoe1E90/HAHY=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=rOqHv2AXLYXo1rmjNx5BMSAUPxTUBtn/9uIR9lgLUHj8IJ/k/zV0v/cob4CnL3uob4yVpCKOhe6xsa3Yp86w3EP7A7hGN2TX+ngPqQhnPb+TlNFVgKnNfzeS7yrAYSjjfCuXH3qCkbZ+l1ow++zdqhdpFktLViQGFFopA9Yg2KY= 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 BB506C43399; Tue, 9 Apr 2024 21:11:15 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1ruImt-00000000d2d-1ZXv; Tue, 09 Apr 2024 17:13:51 -0400 Message-ID: <20240409211351.234897475@goodmis.org> User-Agent: quilt/0.67 Date: Tue, 09 Apr 2024 17:02:56 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: 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 , Kees Cook , 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: [POC][RFC][PATCH 2/2] pstore/ramoops: Add ramoops.mem_name= command line option References: <20240409210254.660888920@goodmis.org> 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=UTF-8 From: "Steven Rostedt (Google)" Add a method to find a region specified by memmap=nn*align:name for ramoops. Adding a kernel command line parameter: memmap=12M*4096:oops ramoops.mem_name=oops Will use the size and location defined by the memmap parameter where it finds the memory and labels it "oops". The "oops" in the ramoops option is used to search for it. This allows for arbitrary RAM to be used for ramoops if it is known that the memory is not cleared on kernel crashes or soft reboots. Signed-off-by: Steven Rostedt (Google) --- fs/pstore/ram.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index b1a455f42e93..c200388399fb 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -50,6 +50,11 @@ module_param_hw(mem_address, ullong, other, 0400); MODULE_PARM_DESC(mem_address, "start of reserved RAM used to store oops/panic logs"); +static char *mem_name; +module_param_named(mem_name, mem_name, charp, 0400); +MODULE_PARM_DESC(mem_name, + "name of kernel param that holds addr (builtin only)"); + static ulong mem_size; module_param(mem_size, ulong, 0400); MODULE_PARM_DESC(mem_size, @@ -914,6 +919,19 @@ static void __init ramoops_register_dummy(void) { struct ramoops_platform_data pdata; +#ifndef MODULE + /* Only allowed when builtin */ + if (mem_name) { + u64 start; + u64 size; + + if (memmap_named(mem_name, &start, &size)) { + mem_address = start; + mem_size = size; + } + } +#endif + /* * Prepare a dummy platform data structure to carry the module * parameters. If mem_size isn't set, then there are no module -- 2.43.0