From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5E39C4345F for ; Wed, 1 May 2024 16:08:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5E4986B0087; Wed, 1 May 2024 12:08:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 594A66B0088; Wed, 1 May 2024 12:08:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45C706B0089; Wed, 1 May 2024 12:08:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 280636B0087 for ; Wed, 1 May 2024 12:08:44 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id CDC87140C49 for ; Wed, 1 May 2024 16:08:43 +0000 (UTC) X-FDA: 82070310126.01.8309B60 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf30.hostedemail.com (Postfix) with ESMTP id 6AA7680023 for ; Wed, 1 May 2024 16:08:41 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of "SRS0=26R8=ME=goodmis.org=rostedt@kernel.org" designates 145.40.73.55 as permitted sender) smtp.mailfrom="SRS0=26R8=ME=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714579722; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U3pWhR5zTem2akPqvQOTbgCojv7W1yCLYBhQCyeJ3yo=; b=4PNV2vf+ZuqXQ+Yt6EvBU/W0kESbOtJ6QRbuzRifQ4kF4HOgtGpCFv2KVewbIymkcgKYxZ g0IjXKScbVjwP0zPr5yBqqMWI6jks/B/GQWs6WtFEQcMK1h6BdXeujSkwQmo2Qla7jvf2e O1+J318JnvBTKAYHdwKWZKXizJsNSYk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714579722; a=rsa-sha256; cv=none; b=h1wYvOAYCaPWkH0simSkbpos42FplUTvZLlYuiSWrj4aGpg2gm+68QFhCd++kjTk0BAohH j+BK0cPeBVcVriDLmhfnFEU4UIGF9pG1639mg9aNPMSJGojgRLsUL5weVOW/26W9UlBD8Q 3NwWMMcIioOG+Ani4sx2J52w/DyCVw8= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of "SRS0=26R8=ME=goodmis.org=rostedt@kernel.org" designates 145.40.73.55 as permitted sender) smtp.mailfrom="SRS0=26R8=ME=goodmis.org=rostedt@kernel.org"; dmarc=none Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id E1FB6CE1353; Wed, 1 May 2024 16:08:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43EE9C072AA; Wed, 1 May 2024 16:08:21 +0000 (UTC) Date: Wed, 1 May 2024 12:09:04 -0400 From: Steven Rostedt To: Mike Rapoport Cc: "Guilherme G. Piccoli" , "Luck, Tony" , Kees Cook , Joel Fernandes , "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 , "linux-hardening@vger.kernel.org" , Guenter Roeck , Ross Zwisler , "wklin@google.com" , Vineeth Remanan Pillai , Suleiman Souhlal , Linus Torvalds , Catalin Marinas , Will Deacon Subject: Re: [POC][RFC][PATCH 0/2] pstore/mm/x86: Add wildcard memmap to map pstore consistently Message-ID: <20240501120904.61c7617c@gandalf.local.home> In-Reply-To: References: <20240409210254.660888920@goodmis.org> <20240409172358.34ea19f0@gandalf.local.home> <202404091519.B7B2221@keescook> <3391c693-cf54-526b-79a8-d565e7140947@igalia.com> <20240411154007.5bdf8d95@gandalf.local.home> <20240412132243.053ad096@gandalf.local.home> <20240501105455.42b78a0b@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspam-User: X-Stat-Signature: 47wo8n35n4fac6cmzc5sh74m6kuyzcf1 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 6AA7680023 X-HE-Tag: 1714579721-326080 X-HE-Meta: U2FsdGVkX18pL9X9R3SWG8WJ4IAgcZDVel6myUhw7SV2iCaMLg1jH9KuRZub0Lfabc3sQPjQxtOCbkLyRhxYzfvFDaquA90chFVSq43MW5e0u7LTS66tUK4buB65+fZmgRyXHUX2u/1Lr2K1rlYHlG4p4K7qD4Z1bXK7us6+Gi3zOJNGSu7+XtghapmEKWgo34+DGeO28W1FI2n0zkRXJ378MvHoq4jAC/MWqZEsYVLD4J4q1AMlMgil+PnMRFCCenvQIsR1pwgcke8+w1fv+g8Exnqn1ON9Gh9DDFxRLPLX1huQ6RrzSn1+QVyP4MP5XNL7MCWGXPZlQzZ3iO+2PfabBrv3zMGsHtFCBkjvkYwGV3HcpMHkldoVDlK7JUx2pWu4u5YH1gYxyH2i7EHbmB+j8Scf6qRmsp7zRlrUfI+0jKNqLkFF696+SLiOX1ZDQUdwuY1t/UcXH7YtOlFY95DxXkRPP+ToFJdCUS7zDXuB+ifSTq2QM32Up3VpcFPYdfrgZ+OguZNoU37Qk9G7cwuqdmXOzWKLlRLuH77LS+fWCvM1yD2g0Rd0E8VaGRvvJ1lFyG+uMSnWDDJj9C0yEVTYSa6F6DYEBRXugbSLzzCnE4vo6+lRmc5unzCFsZYOI50OtTnI1sXom90jUnE0mCjhlWOWhO5pLJmLq9MYaazGa7vhuokKYW+YIM6MsF7lG0Qrs4+wBG0DHg81puEccuOtLmTfCqEB7oSFaT3w5I4JqBqU46f92u942OFk6hkzKdvuP2+qFYDJadtE1A8FOwS6gen3GDei9JFnhG6j2ahiCZhRWFtsT6Y8Bw6VTv4txVMBf6gQFhYAs3Mths+mrrBwsGJRiAPvIQmjhUU00eNENVIRB0398DYKwH6BcgBZR0hfGcFCqj/5M8JCaF35ibWEpU5HLeN6hdKVsBKhDjAjzzkniMaczfy7fIEtwuJZq5qYJ6OHJdHe9nYiyM6 9ogFXfjf wrSolYW6gq8s2jgi+I7Crd/gu7rNf0+gDr2HBxO/d+Qbz92KrZS6809mmA2qai5JBOVQPyX40ONtDTIQ7Y/XSxe9VqxFDLsjjeNIBJgDJ0NGbAFiJ13MCnCTySuZGxIbExiDcS98M2GiF9GJri0ZfM/JfLOWDWyafF6SdvPR110IHqyGzC5goAnurVz5pFB5y8Fy/l4krYKZzfB/vFEHE0RtHneZFN0gvmaP+HaAL55lqBaDfgQPs7q7sBD/S2np+vKviQiyaYNZJM6WyV9bX46CGbbOzEIB+E650fJrQYvfASerzfaN01HDj6JF9Eobu1EFHkLYXWFdXSQBfZOOPtJOotTDRu4Qf3LNK X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, 1 May 2024 18:30:40 +0300 Mike Rapoport wrote: > > > /* > > > * Parse early_reserve_mem=nn:align:name > > > */ > > > static int __init early_reserve_mem(char *p) > > > { > > > phys_addr_t start, size, align; > > > char *oldp; > > > int err; > > > > > > if (!p) > > > return -EINVAL; > > > > > > oldp = p; > > > size = memparse(p, &p); > > > if (p == oldp) > > > return -EINVAL; > > > > > > if (*p != ':') > > > return -EINVAL; > > > > > > align = memparse(p+1, &p); > > > if (*p != ':') > > > return -EINVAL; > > > > > > start = memblock_phys_alloc(size, align); > > > > So this will allocate the same physical location for every boot, if booting > > the same kernel and having the same physical memory layout? > > Up to kaslr that might use that location for the kernel image. > But it's the same as allocating from e820 after kaslr. > > And, TBH, I don't have good ideas how to ensure the same physical location > with randomization of the physical address of the kernel image. I'll try it out. Looking at arch/x86/boot/compressed/kaslr.c, if I read the code correctly, it creates up to a 100 slots to store the kernel. The method I used was to make sure that the allocation was always done at the top address of memory, which I think would in most cases never be assigned by KASLR. This looks to just grab the next available physical address, which KASLR can most definitely mess with. I would still like to get the highest address possible. -- Steve