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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 95C22C77B7C for ; Fri, 28 Apr 2023 11:28:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ljScldR81NGxyCOlWBG+13MKL+50Zh6yjpRNcigvYuQ=; b=qSF4mmsy0sGcoS 3nDd3A2Mj12GjTXE3TTxcRirCgVGvXI0tycQefKoh9Izn/IEVuqbnE5wbWOV+Pim1x7ng5MOE3Cl+ vtJAYS7o/wx6aPeIU5rLfU8cjzLf2ye556PNruZwW4si7sZsUe+n75z9/3FysMh5KMNoy7RRP3sP0 aEMAZ0oEH+3quQnJjjMcm0xnphDNHXuDvJor6UJERssHFgOueUE0YYGhhTD58LhSu/0VVTxSILmgQ 1Ps9envSL0KikwS+GGdymjWNGL8c7m1777oM90Ggkc2GCIeQxtn/MiOn54P9xaZsHU/bzdIxayyxW m9l6YzyScKAiTvsy+P6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1psMGS-009Crz-0u; Fri, 28 Apr 2023 11:27:48 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1psMGO-009CoM-2d for linux-arm-kernel@lists.infradead.org; Fri, 28 Apr 2023 11:27:46 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 72C67C14; Fri, 28 Apr 2023 04:28:22 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.21.9]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 341A83F64C; Fri, 28 Apr 2023 04:27:37 -0700 (PDT) Date: Fri, 28 Apr 2023 12:27:34 +0100 From: Mark Rutland To: Ard Biesheuvel Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Marc Zyngier , Ryan Roberts , Anshuman Khandual , Kees Cook Subject: Re: [PATCH v3 07/60] arm64: ptdump: Discover start of vmemmap region at runtime Message-ID: References: <20230307140522.2311461-1-ardb@kernel.org> <20230307140522.2311461-8-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230307140522.2311461-8-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230428_042745_031047_3A75DF24 X-CRM114-Status: GOOD ( 19.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Mar 07, 2023 at 03:04:29PM +0100, Ard Biesheuvel wrote: > 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 > --- > arch/arm64/mm/ptdump.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/arch/arm64/mm/ptdump.c b/arch/arm64/mm/ptdump.c > index 910b35f02280cbdb..8f37d6d8b5216473 100644 > --- a/arch/arm64/mm/ptdump.c > +++ b/arch/arm64/mm/ptdump.c > @@ -37,6 +37,7 @@ enum address_markers_idx { > MODULES_END_NR, > VMALLOC_START_NR, > VMALLOC_END_NR, > + VMEMMAP_START_NR, > }; > > static struct addr_marker address_markers[] = { > @@ -386,6 +387,10 @@ static int __init ptdump_init(void) > #endif > address_markers[VMALLOC_END_NR].start_address = VMALLOC_END; > ptdump_initialize(); > + if (vabits_actual < VA_BITS) { > + address_markers[VMEMMAP_START_NR].start_address = > + (unsigned long)virt_to_page(_PAGE_OFFSET(vabits_actual)); > + } As Ryan suggested, I think it'd be worth doing this unconditionally, to keep this simple. Mark. > ptdump_debugfs_register(&kernel_ptdump_info, "kernel_page_tables"); > return 0; > } > -- > 2.39.2 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel