Received: by 10.223.185.116 with SMTP id b49csp2474019wrg; Mon, 5 Mar 2018 03:36:46 -0800 (PST) X-Google-Smtp-Source: AG47ELueJi2pTU1/N9Loc0NrygdmyxANR0yyAoPPpcmoZAVtKKfaItO/cflU/3y7pg/hHMjRUdtH X-Received: by 10.99.51.74 with SMTP id z71mr11807489pgz.272.1520249806704; Mon, 05 Mar 2018 03:36:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520249806; cv=none; d=google.com; s=arc-20160816; b=w82hOyZTwhFGzSScUI0iqPPPP4hYynxtfeds+MzBHiOqzODHpLkeCGnlfHIOozvj3q 5vu3S2+fhtfqH6fGluQ41vgVAfOqv0VKWKR7T3aGMKRp1KqeAcaR1YPjfOsVEeJB4kgm KvLPGlgZ/NCQ0JF1dGuPEe0myG3yMLbjcKAaM4PNB/aKlJwPgFnIg2KiTYKJczAYZfgg oF4leaK7xIBL7YHoGK2MBY8ivpwEQKv0YsLYiGBGIGvNveL9mVzl3BUMdflXeGsSQqtl OF1GQsk813qZcHXipQKvjWpN0qiv/+3ngbi2B9+TLRhFcI7+CJyt4ZjXrFHvBGT9kREF WatQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=TBtohe2X5SHsmPjdTDHZdNzRuX9gI4sKHKxpvfjShHc=; b=dqYoQUfsM/euShDh9T9qrOMvDe1eTbJErETXFKp6LmHy5zOwEm9JfHfTQTmBCASZ5d ZpDSDCGIll+Ei9UMbpqFkU+PNOuF7DmspuUidkyIco1Cu0hPoY7TeOHq1A+yvhLjVnxH juW7dKBbTHnqqIz4vXVl/dQVJO/+ngYj1TBVIurIWMgP6xMCoqPfkotiavCVezqZS2QU 0fsAQX+ePrX/gCCFyYKTNh2g8y3pZxFDRyz8zn5yKMeIzbCe2cna0FIVeBsNsBYyCN2r DnjZCDzd+hcfPGtqB9aTa8jqDg4Gg6fg01Z7gWl5WFdtCUzqhpaqHGl1kNePaxovEipo oFqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=Pa8xxOpK; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e125si8207196pgc.506.2018.03.05.03.36.32; Mon, 05 Mar 2018 03:36:46 -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; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=Pa8xxOpK; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934058AbeCEK2e (ORCPT + 99 others); Mon, 5 Mar 2018 05:28:34 -0500 Received: from 8bytes.org ([81.169.241.247]:54736 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933816AbeCEK0V (ORCPT ); Mon, 5 Mar 2018 05:26:21 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id 40652282E; Mon, 5 Mar 2018 11:26:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1520245570; bh=bfB/nsdr6IM/VxDGv1qHsRi5CDoWaQ+8E5IACHvVluk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pa8xxOpK4PipjwUGLyzPhCPXqnVBl3PeTjK5OGIiyfD/7n7DNoA5Jnq8AFG5/+UA9 dLhLUUP2IgjtwsEBUYa5aZB9a+boIrCyWcd/VffGkT3AwNEr3W7/lgTI4iwbv3cuXq X6XbOen0+qt1Vy5xyoYwBNCPAGWBqiDUCDjrA14kgUv4TYgwsCMaf2txDB+991lPvV +gq3Lp97uzeFEmbsueszUtdC+M5xxlacuhtiWpstIb7ip/RH6IyLrqe0PwvEEFg1fy 4CxC/x9UjXTDRvdWjuaVxCFC3Y3VTZ4qUjqLf5OKUSyUqt+q06uKuJhAae6iM8BRkt Zx31V/hsuqeEg== From: Joerg Roedel To: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , Andy Lutomirski , Dave Hansen , Josh Poimboeuf , Juergen Gross , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , Brian Gerst , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , aliguori@amazon.com, daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, Andrea Arcangeli , Waiman Long , Pavel Machek , jroedel@suse.de, joro@8bytes.org Subject: [PATCH 27/34] x86/mm/dump_pagetables: Define INIT_PGD Date: Mon, 5 Mar 2018 11:25:56 +0100 Message-Id: <1520245563-8444-28-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520245563-8444-1-git-send-email-joro@8bytes.org> References: <1520245563-8444-1-git-send-email-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joerg Roedel Define INIT_PGD to point to the correct initial page-table for 32 and 64 bit and use it where needed. This fixes the build on 32 bit with CONFIG_PAGE_TABLE_ISOLATION enabled. Signed-off-by: Joerg Roedel --- arch/x86/mm/dump_pagetables.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c index 2a4849e..2151ebb 100644 --- a/arch/x86/mm/dump_pagetables.c +++ b/arch/x86/mm/dump_pagetables.c @@ -105,6 +105,8 @@ static struct addr_marker address_markers[] = { [END_OF_SPACE_NR] = { -1, NULL } }; +#define INIT_PGD ((pgd_t *) &init_top_pgt) + #else /* CONFIG_X86_64 */ enum address_markers_idx { @@ -133,6 +135,8 @@ static struct addr_marker address_markers[] = { [END_OF_SPACE_NR] = { -1, NULL } }; +#define INIT_PGD (swapper_pg_dir) + #endif /* !CONFIG_X86_64 */ /* Multipliers for offsets within the PTEs */ @@ -478,11 +482,7 @@ static inline bool is_hypervisor_range(int idx) static void ptdump_walk_pgd_level_core(struct seq_file *m, pgd_t *pgd, bool checkwx, bool dmesg) { -#ifdef CONFIG_X86_64 - pgd_t *start = (pgd_t *) &init_top_pgt; -#else - pgd_t *start = swapper_pg_dir; -#endif + pgd_t *start = INIT_PGD; pgprotval_t prot; int i; struct pg_state st = {}; @@ -543,7 +543,7 @@ EXPORT_SYMBOL_GPL(ptdump_walk_pgd_level_debugfs); static void ptdump_walk_user_pgd_level_checkwx(void) { #ifdef CONFIG_PAGE_TABLE_ISOLATION - pgd_t *pgd = (pgd_t *) &init_top_pgt; + pgd_t *pgd = INIT_PGD; if (!static_cpu_has(X86_FEATURE_PTI)) return; -- 2.7.4