Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1964858rwr; Fri, 28 Apr 2023 04:29:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6NnzCaQ8NCZuP0RxJtylmnXrG3x/lZWXZ0sBk+1b2SRJqHvOlFH9i0FSkBsE9daaf0ziRt X-Received: by 2002:a05:6a20:2c8a:b0:f3:81c1:feba with SMTP id g10-20020a056a202c8a00b000f381c1febamr4522849pzj.4.1682681351959; Fri, 28 Apr 2023 04:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682681351; cv=none; d=google.com; s=arc-20160816; b=fkVt4m4MOQW7GVTtW4nDuofZ6qXwpEjmgdcrl13BoUlJPyNGeB430rJOYNB43qszgB qUyH8TOdsvjpH09WYBGCudstLdlLQxhKsniSEMGvWrxg3lDuOzwOgsVMRCZmbdvTrvwb OtMVTcpO3eH6IHEcSxojp+3laAaPhYR6KvBvQoKyxYOIB01hkZe71vBVH6fuiWGv1rI1 VOMCtZH3Qldg8iV5L10NuwrIiO6JN1PN0L0iXDMF9hBodjTR0lsxyRlMimOiDgG83xLr 7ODkJqd+CCKqPBTihBkuFRvOyFTrnSf/n177Ir2Yg5cc4XcCEsydxXUC9eTl8+nf3vuS 4W+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=g7EVF5Snh1B5SYt2wzUS6V0XtnYvOF4jZK4MMVXESH8=; b=bkRwuQVSxnuBosiaGdDIYKx1QknA54R7uScWzturl9QwA7B5RPEa4vtU1xZ4avrWrT 5nnXXyBxSBkf/7sg9B1Wb3IgwTu7Lr85/DX9T4+OfygD8UeVKWaUkdmRG6SBk9Fp6vup iaeX7ZX8PqoN+tsNEh2jX95zWvJu76td6/C5YRu2gBD9wLHY5hh+a6tkBhWIj1KSUmsI N8DyxsQNJ+rhl3ApiC0Xo8sWZBheI3YjWhFljKEdAHCjwMOefFCsMTZTvRRu9vHai54X indQ3U6AcUplGa+4WHHDK1ggHR5iVqOOetPzx9Y2mQWAnDgvXDdJF04wcKENxLQgonSL BkPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m184-20020a6326c1000000b004ff6f91fa75si21405527pgm.445.2023.04.28.04.28.59; Fri, 28 Apr 2023 04:29:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233263AbjD1L1k (ORCPT + 99 others); Fri, 28 Apr 2023 07:27:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbjD1L1j (ORCPT ); Fri, 28 Apr 2023 07:27:39 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9B0CD26BA for ; Fri, 28 Apr 2023 04:27:38 -0700 (PDT) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230307140522.2311461-8-ardb@kernel.org> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > >