Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp763045ybl; Fri, 6 Dec 2019 05:56:40 -0800 (PST) X-Google-Smtp-Source: APXvYqyXBoY0p9Brnvjx6WRvqHSmHrFGd6tODOZBH2sgc8ZvyVTCELUEyE6rh9kPAye0aw5kp093 X-Received: by 2002:a05:6808:b13:: with SMTP id s19mr11732718oij.119.1575640600617; Fri, 06 Dec 2019 05:56:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575640600; cv=none; d=google.com; s=arc-20160816; b=GOp+Tp/YorlqnqdFK/SaO7YNKW+6DxYIybRxrNmbSNF42aWK8JJvIA5Rr+HalOzZqD UUd1CQeIRRrPyAHR8lE3Zd0veOmk49uFXcVfnrEQPJ9/tQAGQADvM/qHNX+Qln0FLY8A d/BhHzCuGlwoXIpjek3ZMlgdHOdNHblCNNQ9WbTP/gmMilVnLR02X99Jn3wpWLWS3yOn 2wbPxx7kA7iEtOkYTODvXrzONjC9nTaTKmBoO4EiHmthLFrzmVVYgF9J+OHnbQoLzpxs 6jPOekApvxYDePAdWy1cWYo4WjzcPyvvjLR8ktV104/wg3/iHS3571hon0HKAzh45PVv HdIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1/CKx2c/kX3UOr+q30r/PwyJwLvJW0X89N0u/ZyHeDs=; b=XUNwGFWN0SQktSO2W00Pgt9fu2Qg0Rc6TOWx4QSt2w2KRbyT7nna58bT4wEWLMnHFp mHyGP5tDzw5oMhi/OhImoy4SbqKBXQnnuYl2+uXJZTGBFhdj3LdWzOmBeQCzPmAhBHJR uDwhcxaKVo2wejEqmF9pp/Te6l9zH8OrV71DYlnQ0AUcaWopMgu7Q8j9Nw4SoWoa08oQ yc0d8NNGVQ79sR8K+9LhZn/FHDYEYqVi6YxaHHryvAduJhDmo43Lw1Z7lQq5IiOQw3x9 Amh0goTt85/SETIk0VoMIIUduf3FN/6vzVhQa2hwiHZrabG53/AmYMLO4DafwncQZI47 948Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si6918567otq.41.2019.12.06.05.56.28; Fri, 06 Dec 2019 05:56:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726479AbfLFNzN (ORCPT + 99 others); Fri, 6 Dec 2019 08:55:13 -0500 Received: from foss.arm.com ([217.140.110.172]:44946 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726881AbfLFNyg (ORCPT ); Fri, 6 Dec 2019 08:54:36 -0500 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 DDF6711FB; Fri, 6 Dec 2019 05:54:35 -0800 (PST) Received: from e112269-lin.cambridge.arm.com (e112269-lin.cambridge.arm.com [10.1.194.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5E2CA3F718; Fri, 6 Dec 2019 05:54:33 -0800 (PST) From: Steven Price To: Andrew Morton , linux-mm@kvack.org Cc: Steven Price , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Dave Hansen , Ingo Molnar , James Morse , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Peter Zijlstra , Thomas Gleixner , Will Deacon , x86@kernel.org, "H. Peter Anvin" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Rutland , "Liang, Kan" Subject: [PATCH v16 18/25] x86: mm+efi: Convert ptdump_walk_pgd_level() to take a mm_struct Date: Fri, 6 Dec 2019 13:53:09 +0000 Message-Id: <20191206135316.47703-19-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191206135316.47703-1-steven.price@arm.com> References: <20191206135316.47703-1-steven.price@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To enable x86 to use the generic walk_page_range() function, the callers of ptdump_walk_pgd_level() need to pass an mm_struct rather than the raw pgd_t pointer. Luckily since commit 7e904a91bf60 ("efi: Use efi_mm in x86 as well as ARM") we now have an mm_struct for EFI on x86. Signed-off-by: Steven Price --- arch/x86/include/asm/pgtable.h | 2 +- arch/x86/mm/dump_pagetables.c | 4 ++-- arch/x86/platform/efi/efi_32.c | 2 +- arch/x86/platform/efi/efi_64.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 8091a1c62596..5a30bf58156e 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -29,7 +29,7 @@ extern pgd_t early_top_pgt[PTRS_PER_PGD]; int __init __early_make_pgtable(unsigned long address, pmdval_t pmd); -void ptdump_walk_pgd_level(struct seq_file *m, pgd_t *pgd); +void ptdump_walk_pgd_level(struct seq_file *m, struct mm_struct *mm); void ptdump_walk_pgd_level_debugfs(struct seq_file *m, pgd_t *pgd, bool user); void ptdump_walk_pgd_level_checkwx(void); void ptdump_walk_user_pgd_level_checkwx(void); diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c index 4dc6f4df40af..24fe76325b31 100644 --- a/arch/x86/mm/dump_pagetables.c +++ b/arch/x86/mm/dump_pagetables.c @@ -567,9 +567,9 @@ static void ptdump_walk_pgd_level_core(struct seq_file *m, pgd_t *pgd, pr_info("x86/mm: Checked W+X mappings: passed, no W+X pages found.\n"); } -void ptdump_walk_pgd_level(struct seq_file *m, pgd_t *pgd) +void ptdump_walk_pgd_level(struct seq_file *m, struct mm_struct *mm) { - ptdump_walk_pgd_level_core(m, pgd, false, true); + ptdump_walk_pgd_level_core(m, mm->pgd, false, true); } void ptdump_walk_pgd_level_debugfs(struct seq_file *m, pgd_t *pgd, bool user) diff --git a/arch/x86/platform/efi/efi_32.c b/arch/x86/platform/efi/efi_32.c index 9959657127f4..1616074075c3 100644 --- a/arch/x86/platform/efi/efi_32.c +++ b/arch/x86/platform/efi/efi_32.c @@ -49,7 +49,7 @@ void efi_sync_low_kernel_mappings(void) {} void __init efi_dump_pagetable(void) { #ifdef CONFIG_EFI_PGT_DUMP - ptdump_walk_pgd_level(NULL, swapper_pg_dir); + ptdump_walk_pgd_level(NULL, &init_mm); #endif } diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c index 08ce8177c3af..3cb63cd369d6 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c @@ -614,9 +614,9 @@ void __init efi_dump_pagetable(void) { #ifdef CONFIG_EFI_PGT_DUMP if (efi_enabled(EFI_OLD_MEMMAP)) - ptdump_walk_pgd_level(NULL, swapper_pg_dir); + ptdump_walk_pgd_level(NULL, &init_mm); else - ptdump_walk_pgd_level(NULL, efi_mm.pgd); + ptdump_walk_pgd_level(NULL, &efi_mm); #endif } -- 2.20.1