Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp76354lqq; Wed, 12 Jun 2024 17:35:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUFMVq2yxl2dzypq+TGk3s9VEMnRfi9VfcAbuAPiFCCuTdMW4ICHeGOyqDF3341odxmX5CV+nmuR0sO87N+DVPE5wozMGOjeTCBI29fgQ== X-Google-Smtp-Source: AGHT+IGIIWPjGUUyapuNKMHwffI1LTD6AlhP1NO12HBKFiSuWdW7UOHjiYp6dMAGyxvNwstcmT6p X-Received: by 2002:a17:902:ee54:b0:1f7:1ba5:85ff with SMTP id d9443c01a7336-1f83b7ddd4dmr27802665ad.57.1718238901649; Wed, 12 Jun 2024 17:35:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718238901; cv=pass; d=google.com; s=arc-20160816; b=fJlck59gBArbcqRaHpwM0yYjd4ONmGR7BEfbx1wBeHC0soROJIP1ISFIBlMaAaWJ7E 0N1CH3CSGipRFwlEDfH6idKXQksEq/zBn6iZpUlHPH3LslPcOimSSQ7ahUy7EUhnx2L+ y7rm+/rGifGXJSTjb/vKvQianPmBl2GCGoRuw9FFHfTlqGnCWDiDBpF4qU+K4LmEZrBc 1g4J5g7g1Jy47LZESrHdhWrxBpaHBHZT0ejMde67ofs30iiNtjf8LPuCPZqFn67pj9Ln Kvt0f7DPRUH/ysXBMIT1gM2iBy8I8FrQ2qGRUshxliAXSSE7fHkmveu1PrjWPv+l6eqM t1Ag== 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=IF7gnmwzCbL09N/BnrgDnto0pWPyks122xl7Egbstng=; fh=QORXSiDV/x9VWq4RcqWjO5bZNJ5t7To8OgD4cz5pN8M=; b=zX1+GoRBbGwQAYggoytctsjQblja5XFEFXahfq0f8/58AuBXsmROUnWgChekJysESC t6B7lyySeb24X4q9r78erOyqgVYJO4IRewufz7yscY7XR+ega0DZ76J2KRRtyByzQYgX qdjiEGW//LK/Oo1WeB/g7l6HiD+N2pQqKFsA/4taJP/XLcycPKbzkv+EWpc9sGFnDxbG 1XvT6Kic/4tg2Jxv+Wkyzs5ZtDpLYZ1GDz4XMeEVGEREiHXoYGGs35puVOVRQzr8h+D+ zir0zhyxujSld3sfD43Lc46EhmH7iKx3eAC61X0sTLvub/9CWccl2NBFxCDCYcvUOd/c V+Og==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-212405-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212405-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 d9443c01a7336-1f855e3c8d8si1628695ad.35.2024.06.12.17.35.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 17:35:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212405-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-212405-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212405-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 0DF04283AAA for ; Thu, 13 Jun 2024 00:35:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 939A68BFA; Thu, 13 Jun 2024 00:34:53 +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 153A0811; Thu, 13 Jun 2024 00:34:52 +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=1718238893; cv=none; b=dqqsFwt22fTkIV/kIVMQZBNCrtMUY3vSsEMvHHzZO71hGUb9X1BO8znpJ2/dPCF2XrfYL01PmywysnYduRqGycQ66hDsnqBALb4jNGL6FQr04i4ISOZojQuJE3v0C4LmVG+sNM6sqQlXvRA+8UsIlsUBqc8Bf+c3uveHL5NcH10= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718238893; c=relaxed/simple; bh=RCywxSRqgN9zs+tmyibAJXz51CnsmORFuB06u95Pauw=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=uJg6vPYzj0wpspl+UxnSGXuYuX/VcScB90bwixTIjXmNzXvQCfcED9hYTsaKN99w+mTCqEcFUbqPD4dOvhdq6cZrKJ3e4avWKXhW/fiQOTg96AiDb3+uVvj45TFrMh0c70sLoa9f6VKEiNjfOXzArefzaufFrrNLN2p0+HMTckU= 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 99BC8C4AF1C; Thu, 13 Jun 2024 00:34:52 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sHYQn-00000001eNW-0G6T; Wed, 12 Jun 2024 20:35:09 -0400 Message-ID: <20240613003508.918902349@goodmis.org> User-Agent: quilt/0.68 Date: Wed, 12 Jun 2024 20:34:37 -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 , Ard Biesheuvel , Mike Rapoport Subject: [PATCH v5 2/2] pstore/ramoops: Add ramoops.mem_name= command line option References: <20240613003435.401549779@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. Tested-by: Guilherme G. Piccoli Signed-off-by: Steven Rostedt (Google) --- fs/pstore/ram.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index b1a455f42e93..4311fcbc84f2 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -50,6 +50,10 @@ 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"); + static ulong mem_size; module_param(mem_size, ulong, 0400); MODULE_PARM_DESC(mem_size, @@ -914,6 +918,16 @@ static void __init ramoops_register_dummy(void) { struct ramoops_platform_data pdata; + if (mem_name) { + phys_addr_t start; + phys_addr_t 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