Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp296370lqs; Thu, 13 Jun 2024 10:12:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVXQGeECVXiMoXSnc8EOGEqW+3c+6tamzaNYn4M3UYQLRf6Fpt64Oag3uIz5Ven6/DjEcrMDiSZ+Hb3hg7DS8Qj3esQvB/2/T5B6+r/9g== X-Google-Smtp-Source: AGHT+IHALoM+hFk16ZmnSby1iMZXHMslfEAxAkEr7nMciIBUiUYSi1ChC+TXgpQQ9nE4p/A8GzvR X-Received: by 2002:a17:906:c24c:b0:a6f:5c34:34e3 with SMTP id a640c23a62f3a-a6f60dc8a06mr27221066b.62.1718298744056; Thu, 13 Jun 2024 10:12:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718298744; cv=pass; d=google.com; s=arc-20160816; b=qG7AG9LsO8rNpaPG3nauy1CM3siDZ6Q+7/jeWX9qp2ih6ObHcSnYe+Yg3egW4soB5r 6ZusTsrlXhyrLmbwb/GUxKO9Hk9K+I7YDcIQNmQTyZ1ymnUnoXL3m9jtoMCgVEG9v+z8 aj5GICHnstou/0vWQWYvsUgkNvTtRw+bEb47w23YjvNMTUOy1l0jc6lf4LaTMBdE8eDH ybqATF+hEdfntsVa2WVdcoF9oUsJ7Xd4bJtBy+EslT+Wz3P0wUsstSV0hJS5TJ7cqHCo lQH0MAxRE4FV7lEgLMyoEbJSg9Uq8g66svBPdK8yojnYOdv7f5A5sGWsFAa6oje+mlxQ Cc/g== 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=g/sCQZR3xlwBEIc2oUVKHFIYesbrYQRIOWYHWTZO4L8=; fh=R1rlTfcnortpTcHi+++AtKpQTLJffL83buuR7szIqoA=; b=Klr4a1rPbtsuZJlz5k93rZEdiJuDEc+Sl4TEWOs1BGX6z6ex20sRbeyn6X6xedsqZB v4iBTVsQ0hjHfy1huVkFsLEGzad1Bbb3sJ524frnET4fy1vXeaj1JHsWGncM/M7zmes9 U6KqHGrRyAejHdItaqaQKt3s/KgTGSmN8b1W5AcQbCBzp6daILTWA7MV/cVYZ0nnm86o mRh/kZA4GVTN3QlHIYxyI8VhYQb5sleWxEb2YoLkAxwvJr6stkxbCD8aZH8q3Zj4v8dz e3h6bfPClw4zsLOaOyHcBIl781WZJETY+eCQ1BCfVnQ+rpjCDR59cki+DRRez+z6Td11 WC7w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-213719-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213719-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 a640c23a62f3a-a6f58c23818si79388366b.288.2024.06.13.10.12.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 10:12:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213719-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-213719-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213719-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 C1B5E1F24E98 for ; Thu, 13 Jun 2024 17:12:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DB551149E06; Thu, 13 Jun 2024 17:12: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 618C5149C57; Thu, 13 Jun 2024 17:12:16 +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=1718298736; cv=none; b=j/A8YIRSxTqHbnmlDUMItpap3Qp843FluXf4yyqZRJ/mfYXDxsTQ1aX25U+IffeCoxQ56+Q8rmkqyW5AfDO2vDpP79DEMBWesLfKTn+8EoXamR21oXOI/r6AHB0xuXR8L0+9niQggIN7+KdSc4pZVnAF8ga82OLZNNkxytHXWaY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718298736; c=relaxed/simple; bh=KGtnCWDjLtvwaHEWBWIoE/+mE2S0vSVzAVfnzRK/d/Y=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=H9GMxy7Zf/gbeNNcHnifvFQgoS0WsD4t8zSfjd/OL4EvbkbWmnaGAapmx/Kqa09I/xYBgcQdqwgUDl7zJnFLXf/sNeGGXbrW9pv4Ci01bX5yGHFTwLb8xvDMTSHgiZV6TQz2kYvpciqAhqJ7J7qyTocRVGNCibD87EEyl36gDFE= 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 A6E4EC3277B; Thu, 13 Jun 2024 17:12:13 +0000 (UTC) Date: Thu, 13 Jun 2024 13:12:12 -0400 From: Steven Rostedt To: Alexander Graf Cc: , , Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton , Vincent Donnefort , Joel Fernandes , "Daniel Bristot de Oliveira" , Ingo Molnar , Peter Zijlstra , , Thomas Gleixner , Vineeth Pillai , Youssef Esmat , Beau Belgrave , "Baoquan He" , Borislav Petkov , "Paul E. McKenney" , David Howells , Mike Rapoport Subject: Re: [PATCH v6 0/2] mm/memblock: Add "reserve_mem" to reserved named memory at boot up Message-ID: <20240613131212.7d1a7ffa@rorschach.local.home> In-Reply-To: References: <20240613155506.811013916@goodmis.org> X-Mailer: Claws Mail 3.17.8 (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 Thu, 13 Jun 2024 18:54:12 +0200 Alexander Graf wrote: > > Do you have a "real" pstore on these systems that you could store > non-volatile variables in, such as persistent UEFI variables? If so, you > could create an actually persistent mapping for your trace pstore even > across kernel version updates as a general mechanism to create reserved > memblocks at fixed offsets. After implementing all this, I don't think I can use pstore for my purpose. pstore is a generic interface for persistent storage, and requires an interface to access it. From what I understand, it's not the place to just ask for an area of RAM. For this, I have a single patch that allows the tracing instance to use an area reserved by reserve_mem. reserve_mem=12M:4096:trace trace_instance=boot_mapped@trace I've already tested this on qemu and a couple of chromebooks. It works well. > > > > Requirement: > > > > Need a way to reserve memory that will be at a consistent location for > > every boot, if the kernel and system are the same. Does not need to work > > if rebooting to a different kernel, or if the system can change the > > memory layout between boots. > > > > The reserved memory can not be an hard coded address, as the same kernel / > > command line needs to run on several different machines. The picked memory > > reservation just needs to be the same for a given machine, but may be > > > With KASLR is enabled, doesn't this approach break too often to be > reliable enough for the data you want to extract? > > Picking up the idea above, with a persistent variable we could even make > KASLR avoid that reserved pstore region in its search for a viable KASLR > offset. I think I was hit by it once in all my testing. For our use case, the few times it fails to map is not going to affect what we need this for at all. -- Steve