Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1278020lqj; Mon, 3 Jun 2024 16:36:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVocstkYNhkQHUnimX4Zet6EaKZXskZ5vonBq1qoHiVWTHoVEDSRiYpKvkXcMP7iGc9O5UPnhXUYUAeYHiDpxLwYCAePjp4ZDTQSEWZUA== X-Google-Smtp-Source: AGHT+IFu1VDRj3aFKb43FYTlvhyqmi5kBqgYj6l59RKY5eVnLkD2UG4Tlnss98nM/uSHNGsTCShm X-Received: by 2002:a05:6a00:1383:b0:6f8:b57f:5791 with SMTP id d2e1a72fcca58-70247891066mr12392394b3a.26.1717457781111; Mon, 03 Jun 2024 16:36:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717457781; cv=pass; d=google.com; s=arc-20160816; b=gsWU9fI0rWxczTpQ3+BJsGRevvxmy+eWTJzmM9yMc8kL/pauENIoOfOJwQhFo9hge3 LnjAHwgPPDpc7FIHT38CkuP216XnbTYIoPJSqK6UUj5Sl1nR2L/9GsFHABez44GxZALy buEVrdxzpW7r3oIJS5R13VR8V21HdIXneuGtnlL1duH+JyLT7DEv/BdCNT/Nv7VrjIUN 0bJopnAu4P9WQd6Y2r3ToeyJdDlwkNcPGOKzbddV7o+Wxb2b4VYkR3FVfBMrq1bXnetE P47VBYo1diMtk9QK6xxfhILYD3OaumS7i9jB0WbbqSrJ4yzHXakbVlwZsqGERdh+C5hz Gfdg== 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=fxYNEtFY57+BQyPLPV1MGH4b/IDbzLgDWasHCXE8Ccc=; fh=6IcUNdfhJQlDYnigfCUYv7tnucWksWPmW4YOa0+VFLM=; b=VKISWSrb8mM3xXKpwIwjVNqW014QwuwNb3RASB+X1X/1cP8wv45THqx31RkKWBGfKh vX/nz3Ng/A//5tIw5gx831ejaymhq/v2JNaCZ4aiS49GbgjTc3gFnsp5UBAr4FiSfNrg g5WUFW2CSbj1Vy4it3xbMjboM0dUpfIs5WfB8fwFnX6/bYc4Q4YRkFjS4qLqDLi+YCJw st2xyBg1AH+ZCoClW4ek8/UiQk2aw8IGM+6DmIGZdCQ6SyvCkiIblSM8sm2CMCXfwN2/ dpE5kTaOvCluhA9BBVPmadZ6rdCC6fTYcIhnAelPvQAUKqYcq1rIkzaln8OcDlXPdHgu M8xQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-199841-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199841-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c355157bd8si1197317a12.230.2024.06.03.16.36.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 16:36:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199841-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-199841-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199841-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 4A180B22F19 for ; Mon, 3 Jun 2024 23:35:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F65113D276; Mon, 3 Jun 2024 23:35:21 +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 C0AE713CFA1; Mon, 3 Jun 2024 23:35:20 +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=1717457720; cv=none; b=UwBG4829H7LhV2wabVkD9nhaud2VXq8CO3TZ9HfQSlpKLRYwpen4EdEZgzm4Qsq5GK7AHaQftYjcokkQDUw+KaYXVO7pb3HhaJaIyFIxNQX4xoclVtqRmPBV4VhvxFuKOqOKS7SkQLl9bX89xsxe4bpJOjGLhwDIkCxNVVgPne8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717457720; c=relaxed/simple; bh=E4KMQm1Ogt1CyuBV5VilL6zJcZs1kYG26oi9sWfoFBA=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=uBP6JqTmy8rluHnvSNjXNv4eCLRVHorRZ739U1a4+d3gu6W+3jq2PezPrE1pakR55khkS4r/VIHGQb4W41+37K7reCLsmDYlP8fG4hYDBI9eG1LTr3j/AzidqzlhgG/LbGqfmmQ+X1Q2wbifbbCP+SJCKl/CNXazdr8LjkwFrX4= 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 681D3C4AF0F; Mon, 3 Jun 2024 23:35:20 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sEHE7-00000009cvy-3A89; Mon, 03 Jun 2024 19:36:31 -0400 Message-ID: <20240603233631.619438489@goodmis.org> User-Agent: quilt/0.68 Date: Mon, 03 Jun 2024 19:33:32 -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: [PATCH 2/2] pstore/ramoops: Add ramoops.mem_name= command line option References: <20240603233330.801075898@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 reserve_mem=nn:align:name for ramoops. Adding a kernel command line parameter: reserve_mem=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 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index b1a455f42e93..bae8486045eb 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,16 @@ static void __init ramoops_register_dummy(void) { struct ramoops_platform_data pdata; + if (mem_name) { + unsigned long start; + unsigned long size; + + if (reserve_mem_find_by_name(mem_name, &start, &size)) { + mem_address = start; + mem_size = size; + } + } + /* * 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