Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp272823lqp; Wed, 12 Jun 2024 00:37:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUz9mWN97IZaH/pNJqw4fXkcWlZ017lOgsNPM1nNjmB5InbMeaB3S3g2HExl5/WqrTw0PRKCz4hqSoW+FBRtrneZf4wZLBTY+0wgQBFVw== X-Google-Smtp-Source: AGHT+IGvkD4bFRw9Ef/LUp909qIIthEMTbMAcYOi2sVgvH+WNOq1knfgViH13/uYn2EFIOrnAyjS X-Received: by 2002:a17:903:1cd:b0:1f7:234b:4f28 with SMTP id d9443c01a7336-1f83b60954cmr12004145ad.25.1718177879521; Wed, 12 Jun 2024 00:37:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718177879; cv=pass; d=google.com; s=arc-20160816; b=NX41jKWX29F2+4M+kPhibgDUfJ4eFz+SbIYtWMV9G31VQ1DcHvVuNYDyhxxHPLMqyb JuQWSnsNPfj4GhPSdLFi9cVi/3fZLd1szqYMVAKQSZlmivVpK031oRuKS6HB8MxE15/v D4bzFKTZAhjZ39L/MtgC3NGUVGP3OPT0wjDBfSThsrSUa9jItDC5JR9aZPrcH8AdU7Wr FMYgx+HqTEAiZrCjiVAmAM7hvEAMWOltR84Zq/DvhLMPE6eVgMfKpPo+M97d7XdcY4fw jzBi7zL8D009Sv3SJlSoYMoQXKnL5Te9VJmXSPDByULV5tkUh5eyGNc3p7Iy8oPo9Srt /SyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=JX3oJ82eNeO5bizIMhHP+nlMW1vS5qyRXC4dQHMZXzQ=; fh=HkCzXVDJdQqPVBwClfoeAHuvekwu7yjB7wNqGiQ5CrM=; b=o/2oOHnSUkFRKa9rucaIdE5vf/lGEV1HhrMWTdlNti0Ez+srZPTHytYhQibL1apSwY uiJTmjERz+8yXBNyc9VI8L4+JKQRct+wQkwBjDduBbdEcpPEQO6i//LXdirccjn0n3oh dyIY9INaDR2ruj7H1GHIvFuF8PHMKIGJjVcbLgmT7kgiTFbMqqkvt3Opxd9teeyRTrzR /Fa58rzv5h3h0eLGZprzo21+W5PoQW2mfoWGoEmKkgCDFUnz3o7F07mI3Zi7EytbzlMh xoIB4rvStljXRj8a6byc+jfL+lPVSdYspnOgq6ItFCm4+4+4wGbiCmTYqs2ypMVUChKZ 8tNw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GcpDHefw; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-211078-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211078-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f71baddde4si43613955ad.118.2024.06.12.00.37.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 00:37:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211078-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; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GcpDHefw; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-211078-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211078-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 3CC84B220C3 for ; Wed, 12 Jun 2024 07:31:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 19E7C169ACF; Wed, 12 Jun 2024 07:30:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GcpDHefw" Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B05829413; Wed, 12 Jun 2024 07:30:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718177455; cv=none; b=M3j+ggPXNFOk14nzrwsyLnNtyM5Pv8l7BwRnVKVAW+X9NquSvErNH78vBJzmaWMI+4YJlevdDd2ZyWLBRc6rKY2Wwvl0idw9sugDAv3VY/1Fpo9afahtLIiHxSi7i9pjFpWeio2QDhG70VD19Kp8iVWbzct1FwpMMnj1Slu6PBU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718177455; c=relaxed/simple; bh=agPMNzLdSO0SU0PfpyNTXaVlt30ktrN5sKjcpxAHw0Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TznQNl9gbShhcHMoruh/zYP2ISSeBR507sitPKU2RamtxALkkJmC4w1REyFFODwr9o/A476EYPQMA0MxXznmG5w4YXcdCpEtxUK41G5fhpkRKoSSyr8v4QTN1nwA4B0xKVCmX/WuwseRm8GBOd6A7YkND3nVX7QcwQIyO2jnb5Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GcpDHefw; arc=none smtp.client-ip=209.85.208.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-57864327f6eso1111967a12.1; Wed, 12 Jun 2024 00:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718177451; x=1718782251; darn=vger.kernel.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=JX3oJ82eNeO5bizIMhHP+nlMW1vS5qyRXC4dQHMZXzQ=; b=GcpDHefwV5P9Fdk+n/Bg/5UlnvLqmIArqDbLsVcPKOlodPI8cC9YmFLubkXIfEWPOZ G9Wk+Vcv5ytu1l2mEYFFO5PDygPZQIPrgOatYpx99y4RAxD/m29l+GI6FktiFR3SfDt8 j4xZ79hpImiIEqDJswZjlkpNlYAS39TUOuk86SrqMfbojnWNIe190u1+TFCKYsI2M6QB j2PfLjIrGeLjfnzui+SKnAOnUx+XNlNrMOQe3+dARiWUauVWlwdgjt3mplg54ZIz9nOd bKxLkbKb813FjvwMBQVFuutKPQBODF2gxx1pYEgUPlijt0c8CeU6xTNwpmT9QlwoTpno p41A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718177451; x=1718782251; h=user-agent:in-reply-to:content-disposition:mime-version:references :reply-to:message-id:subject:cc:to:from:date:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JX3oJ82eNeO5bizIMhHP+nlMW1vS5qyRXC4dQHMZXzQ=; b=gWujIN0aJYrjSkyaq9IHett2hNUHTN2t0DaPs8iwZf7RktD+s1WWKnSyOmI0WqXiKE OO8VLaG7t0BvJ+Nc35jAQTK3+3bYN97OE+909Zid0hOqSkQggsWlgP30jQEbQI72DWzg 53MXNyceocdZThgvAxv5j9x6hXRJ2MLRWc2ML78VBrFbWIB7F6op79YyhZQjLboWTyy2 YoU3LUU9eCXgJCEohBUi6JXBxqr3dnHzhGtnymwzVBPKaAafmPUsa3Trj2mz2H740jFX rzZ4toifvPtITwJgPPhRdd7jIVxRp8IrVcVWsDLzU+cIO5RlzfmYerOqE/izwo+fFvOF 2Oow== X-Forwarded-Encrypted: i=1; AJvYcCUE4azTsLj2smnuU1SiTGxFItf9N9aKeBVpz2v3+blubVc9FsK9X5To06tmTFHKQGAVZJys7j/f7wrSHzgrg/vh2fO0eiI82COUgaag9oMYBQaa3PhUmoUs6hGewWRXn7hSXMDW6OhjcM3tKYRbBm4jOfVf X-Gm-Message-State: AOJu0Yyki771diO3VGsu7i1XrMCvYpDVTbPX7Uimf8Gv9csiy7TMA1ay T++I2oOAfhADmxcW0usr2L/ifhmErn+ikX7/YWfcC72Dsyij7jHL2IrG2fGjRYI= X-Received: by 2002:a05:6402:791:b0:578:6360:aa11 with SMTP id 4fb4d7f45d1cf-57c90a228admr3208454a12.5.1718177451021; Wed, 12 Jun 2024 00:30:51 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57c874e3cb6sm4006384a12.27.2024.06.12.00.30.50 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Jun 2024 00:30:50 -0700 (PDT) Date: Wed, 12 Jun 2024 07:30:49 +0000 From: Wei Yang To: Steven Rostedt 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 , 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: Re: [PATCH v2 1/2] mm/memblock: Add "reserve_mem" to reserved named memory at boot up Message-ID: <20240612073049.xof3ciae2x5qjp6a@master> Reply-To: Wei Yang References: <20240606150143.876469296@goodmis.org> <20240606150316.751642266@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=us-ascii Content-Disposition: inline In-Reply-To: <20240606150316.751642266@goodmis.org> User-Agent: NeoMutt/20170113 (1.7.2) On Thu, Jun 06, 2024 at 11:01:44AM -0400, Steven Rostedt wrote: >From: "Steven Rostedt (Google)" > >In order to allow for requesting a memory region that can be used for >things like pstore on multiple machines where the memory layout is not the >same, add a new option to the kernel command line called "reserve_mem". > >The format is: reserve_mem=nn:align:name > >Where it will find nn amount of memory at the given alignment of align. >The name field is to allow another subsystem to retrieve where the memory >was found. For example: > > reserve_mem=12M:4096:oops ramoops.mem_name=oops > >Where ramoops.mem_name will tell ramoops that memory was reserved for it >via the reserve_mem option and it can find it by calling: > > if (reserve_mem_find_by_name("oops", &start, &size)) { > // start holds the start address and size holds the size given > >This is typically used for systems that do not wipe the RAM, and this >command line will try to reserve the same physical memory on soft reboots. >Note, it is not guaranteed to be the same location. For example, if KASLR >places the kernel at the location of where the RAM reservation was from a >previous boot, the new reservation will be at a different location. Any >subsystem using this feature must add a way to verify that the contents of >the physical memory is from a previous boot, as there may be cases where >the memory will not be located at the same location. > >Not all systems may work either. There could be bit flips if the reboot >goes through the BIOS. Using kexec to reboot the machine is likely to >have better results in such cases. > >Link: https://lore.kernel.org/all/ZjJVnZUX3NZiGW6q@kernel.org/ > >Suggested-by: Mike Rapoport >Signed-off-by: Steven Rostedt (Google) >--- > .../admin-guide/kernel-parameters.txt | 20 ++++ > include/linux/mm.h | 2 + > mm/memblock.c | 97 +++++++++++++++++++ > 3 files changed, 119 insertions(+) > >diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt >index b600df82669d..4b2f7fb8de66 100644 >--- a/Documentation/admin-guide/kernel-parameters.txt >+++ b/Documentation/admin-guide/kernel-parameters.txt >@@ -5710,6 +5710,26 @@ > them. If is less than 0x10000, the region > is assumed to be I/O ports; otherwise it is memory. > >+ reserve_mem= [RAM] >+ Format: nn[KNG]::