All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@google.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Ard Biesheuvel <ardb@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	 Will Deacon <will@kernel.org>, Marc Zyngier <maz@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>
Subject: [PATCH v7 4/7] arm64: ptdump: Discover start of vmemmap region at runtime
Date: Wed, 13 Dec 2023 09:40:29 +0100	[thread overview]
Message-ID: <20231213084024.2367360-13-ardb@google.com> (raw)
In-Reply-To: <20231213084024.2367360-9-ardb@google.com>

From: Ard Biesheuvel <ardb@kernel.org>

We will soon reclaim the part of the vmemmap region that covers VA space
that is not addressable by the hardware. To avoid confusion, ensure that
the 'vmemmap start' marker points at the start of the region that is
actually being used for the struct page array, rather than the start of
the region we set aside for it at build time.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 arch/arm64/mm/ptdump.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/mm/ptdump.c b/arch/arm64/mm/ptdump.c
index 66ccb8d6997e..5f0849528ccf 100644
--- a/arch/arm64/mm/ptdump.c
+++ b/arch/arm64/mm/ptdump.c
@@ -346,6 +346,8 @@ void ptdump_check_wx(void)
 
 static int __init ptdump_init(void)
 {
+	u64 page_offset = _PAGE_OFFSET(vabits_actual);
+	u64 vmemmap_start = (u64)virt_to_page((void *)page_offset);
 	struct addr_marker m[] = {
 		{ PAGE_OFFSET,		"Linear Mapping start" },
 		{ PAGE_END,		"Linear Mapping end" },
@@ -357,7 +359,7 @@ static int __init ptdump_init(void)
 		{ MODULES_END,		"Modules end" },
 		{ VMALLOC_START,	"vmalloc() area" },
 		{ VMALLOC_END,		"vmalloc() end" },
-		{ VMEMMAP_START,	"vmemmap start" },
+		{ vmemmap_start,	"vmemmap start" },
 		{ VMEMMAP_END,		"vmemmap end" },
 		{ PCI_IO_START,		"PCI I/O start" },
 		{ PCI_IO_END,		"PCI I/O end" },
-- 
2.43.0.472.g3155946c3a-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2023-12-13  8:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13  8:40 [PATCH v7 0/7] arm64: Reorganize kernel VA space Ard Biesheuvel
2023-12-13  8:40 ` [PATCH v7 1/7] arm64: mm: Move PCI I/O emulation region above the vmemmap region Ard Biesheuvel
2023-12-13  8:40 ` [PATCH v7 2/7] arm64: mm: Move fixmap region above " Ard Biesheuvel
2023-12-13  8:40 ` [PATCH v7 3/7] arm64: ptdump: Allow all region boundaries to be defined at boot time Ard Biesheuvel
2023-12-13  8:40 ` Ard Biesheuvel [this message]
2023-12-13  8:40 ` [PATCH v7 5/7] arm64: vmemmap: Avoid base2 order of struct page size to dimension region Ard Biesheuvel
2023-12-13 13:49   ` Mark Rutland
2023-12-13 14:09     ` Ard Biesheuvel
2023-12-13 14:39       ` Mark Rutland
2024-02-09 17:33         ` Catalin Marinas
2023-12-13  8:40 ` [PATCH v7 6/7] arm64: mm: Reclaim unused vmemmap region for vmalloc use Ard Biesheuvel
2023-12-13  8:40 ` [PATCH v7 7/7] arm64: kaslr: Adjust randomization range dynamically Ard Biesheuvel
2024-02-09 17:33 ` [PATCH v7 0/7] arm64: Reorganize kernel VA space Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231213084024.2367360-13-ardb@google.com \
    --to=ardb@google.com \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.