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 B0098CE8E73 for ; Thu, 24 Oct 2024 13:18:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1250E6B0092; Thu, 24 Oct 2024 09:18:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D4E76B0096; Thu, 24 Oct 2024 09:18:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F06D46B0098; Thu, 24 Oct 2024 09:18:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id D394B6B0092 for ; Thu, 24 Oct 2024 09:18:53 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 5BFEF161300 for ; Thu, 24 Oct 2024 13:18:32 +0000 (UTC) X-FDA: 82708550568.18.A6844B4 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf13.hostedemail.com (Postfix) with ESMTP id BA55020025 for ; Thu, 24 Oct 2024 13:18:32 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=QS90Y9zu; spf=pass (imf13.hostedemail.com: domain of will@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=will@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729775854; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=h0aXMVOrwPr9Sl/iuXyHgVBd5RGlvAqyrC0d7nUJHRc=; b=bp34A5GAXWJ93FPXj0C8j0uh95mJGlwZCPm+YVR08itPKo3KXZGAAlNlA1fR8NMGad7RVX NNSN2177STfXRbFLBq7dMPp4oD9WR00XNDIeznnKGVJFNH+y+TaT1mCKcVT6VDQSweYQDl Nq/Usz0YDKYDTcPe0YsZ6WwIKp9UooQ= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=QS90Y9zu; spf=pass (imf13.hostedemail.com: domain of will@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=will@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729775854; a=rsa-sha256; cv=none; b=AyZcapkaySou7Mi/fUWX+ROKVTYU1J+Yxd0+QdYcZeBP0x/Fun5V66bfKIoRfIf8bqCkxU 7wBygbDTR1DClewbsBneR7zUkKI1nnZQRJCE1QA/0VD1gIOkHnnldzJpGjs31Eti0S17xZ rJmOYvzW6z4bx0JlxQlt37CIhzdZJc4= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id CC4B9A4540A; Thu, 24 Oct 2024 13:18:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E21B2C4CECC; Thu, 24 Oct 2024 13:18:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729775930; bh=tyI7JDkp0t33YbBcSFvFoSSEBcFZuHm9pqI3LNWIbmk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QS90Y9zusgjWlncMcUS0Hbjl3NF3iem9EQ//727OBCCjvQDez0N0wvZ+uJbyDSkNE znswK6t/2WOAE99SVSXVgqhTjF9LvcsMadEB6PuS3kpZ4R+jQiuKrP4PqyfasG/Hsa 9jjQZ6etYJ8fVt2RbYzBYWoBjK5ygLm34iBXHg9IR8zSEXtnXGFcxRn2kz7T6/0NLR ohxVEAd70vCT8nKCZERaWIwPhOLdBSsuk97wfmisdMoPaOoStt/20iEaQPkW7V8T8Q DvryfvWHJlDt2tXSqhLZkD6QlowlJeUkjmvEXRkx96RP7cNq45aB1UQOPKSqbmKxHP UhJCMKzyq9wtA== Date: Thu, 24 Oct 2024 14:18:45 +0100 From: Will Deacon To: John Hubbard Cc: Andrew Morton , Thomas Gleixner , David Hildenbrand , Alistair Popple , Jordan Niethe , linux-arm-kernel@lists.infradead.org, x86@kernel.org, linux-mm@kvack.org, LKML Subject: Re: [PATCH] kaslr: rename physmem_end and PHYSMEM_END to direct_map_physmem_end Message-ID: <20241024131844.GI30704@willie-the-truck> References: <20241009025024.89813-1-jhubbard@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241009025024.89813-1-jhubbard@nvidia.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: BA55020025 X-Stat-Signature: bs5an6fk8iu6dyggaf5mro4chheetwjb X-HE-Tag: 1729775912-601567 X-HE-Meta: U2FsdGVkX1952J4Wy+2zaZmBUiHAF9fZoz73dUWCXGhF1yLougKiAe3hJDnfDDLgVv3RiO2f6CSvvky10g+Ud9ES0PZ9ijTYa5Qnvf8gni2d0+nlP9bVqfFmvN7Kdg5J6bA7RT8ZHgxZXYzP/ofF2ZrDsmSRS4fisYAm+c8cbc/7bj2qbZRlIoP+w4L5Wuh9THPv6evSZBcHZ0mtDFaSVF88Z3wCi29RU0zGKcLvJdRjF6n6wyiRCNns4iEXPUkXG46Eya4KrA7AgSlNsi1yEaAGaPiw0PaoTrwZWwAtagQdAZTwJEWlgY/WbU5dwekrr9uhirdmwN9ferjYfv0LvhnZcJqw5EnSda3Ufyrwj+Oc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ender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Oct 08, 2024 at 07:50:24PM -0700, John Hubbard wrote: > For clarity. It's increasingly hard to reason about the code, when KASLR > is moving around the boundaries. In this case where KASLR is randomizing > the location of the kernel image within physical memory, the maximum > number of address bits for physical memory has not changed. > > What has changed is the ending address of memory that is allowed to be > directly mapped by the kernel. > > Let's name the variable, and the associated macro accordingly. > > Also, enhance the comment above the direct_map_physmem_end definition, > to further clarify how this all works. > > Cc: Thomas Gleixner > Cc: Alistair Popple > Cc: Jordan Niethe > Cc: David Hildenbrand > Signed-off-by: John Hubbard > --- > > David Hildenbrand, I recall you had an unanswered question in this > vicinity [1] when tglx's recent kaslr fix was being reviewed. Maybe this > will help with that. > > > [1] https://lore.kernel.org/linux-mm/ee205448-5fdd-495e-9d7c-c8a2b59f9c9e@roeck-us.net/T/#mdf442f077c9023590e144dbed2b04a109793484d > > thanks, > John Hubbard > > > arch/arm64/include/asm/memory.h | 2 +- > arch/x86/include/asm/page_64.h | 2 +- > arch/x86/include/asm/pgtable_64_types.h | 2 +- > arch/x86/mm/init_64.c | 2 +- > arch/x86/mm/kaslr.c | 14 +++++++++----- > include/linux/mm.h | 6 +++--- > kernel/resource.c | 4 ++-- > mm/memory_hotplug.c | 2 +- > mm/sparse.c | 2 +- > 9 files changed, 20 insertions(+), 16 deletions(-) For arm64: Acked-by: Will Deacon Will