Received: by 10.223.176.5 with SMTP id f5csp445888wra; Fri, 9 Feb 2018 01:32:50 -0800 (PST) X-Google-Smtp-Source: AH8x225v7isGV5EVvz3prNLrNfUpM+db92lUHjoYFxxSWWU7g+PQ2JLLgMLD4WEOzL4qpjroanDK X-Received: by 2002:a17:902:5305:: with SMTP id b5-v6mr1927869pli.61.1518168770273; Fri, 09 Feb 2018 01:32:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518168770; cv=none; d=google.com; s=arc-20160816; b=QlJUL4Xoo5ID9FM+ePfWXZkXZ18ccPWuQE4w6gnyvAedaYtiTnaSKqc6036vwucNrJ T8kP3QfhqIHI10tVNUxp3XeIk8IW8PYSiR8KxiQLxQdN+VABD49QXZHeIP830LvXxuZ8 egev/cdCw6gUHQlwVOEe/cqNCfko5BwCesBScOCQogNcwwgVURlcvjrOAElFZlgsucD3 7yTbr/59Juu9GHn/n1kZyyotUYoLc3wGQIHc88AaI3KiSN3/f3uuZ/pLO9OsMCnKdQbk tMj6st1Bi1exhl5SBVaLw4aveN/Iyj/urdZj4TcOWRIvyOSJSUhVBuuCBia0vBF/S40c 6Gaw== 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=UAwabmMmp+XtxG4ZYpCvwEl/Y1lGwzZjxCD6k2nuzxF+pAlTYQRYLkjloCu4XDlSRZ zj3IrlNp7Yr9akQaCaKrPLdcBuj2XfaqvVIt4idmIewaFnQzIQDRLvMMPH7tdWzG3/dC Wx+d0/qW/08kTBJUxkTgTbSJAGYp5F/BUalbrEktUDA9L2j1AzaiKOlPo7i5Sral+8He Wx5PdniwjA9TcJ4V2tZLjERvbfgaJCOtUOxhu0HISsBQJomo/f3pZrfFtz1x8VUMXpzr 0RMwclRouUi1PJdUK2bMLEznhR7KxDtfefCgvdxIxQIw99r+mrE3xF5BR7zFk10lli+n vu6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@8bytes.org header.s=mail-1 header.b=QvcKtZ4u; 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 p128si1158243pga.15.2018.02.09.01.32.33; Fri, 09 Feb 2018 01:32:50 -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=QvcKtZ4u; 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 S1752657AbeBIJa7 (ORCPT + 99 others); Fri, 9 Feb 2018 04:30:59 -0500 Received: from 8bytes.org ([81.169.241.247]:43094 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752253AbeBIJ0H (ORCPT ); Fri, 9 Feb 2018 04:26:07 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id A187DC81; Fri, 9 Feb 2018 10:25:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1518168355; bh=bfB/nsdr6IM/VxDGv1qHsRi5CDoWaQ+8E5IACHvVluk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QvcKtZ4uEM8UViexeIlyNTfh8nn+iJoo1rlcVng89c+45pbfpZpy+yqqI+r/k8Ena uvtCTkZkD9aJLMUYwFGzdGpNh5jhAjw8jOPO86V2tfr85duzNNW7Y/nFfSGeUjEmG8 mWNFcRUijk6n9c76t/BO0zwIzN0R56YE/kwmgF3T9daSXYRXpbWE9vSSxloYtCPnP+ KRrHXZveg1gQj07DU0mYWXN5lSyOpAUc3Rn+XbvLn+H0AwkV7mQo0wM2u8oQPE7wT3 RcWpkXFkDz9031NIyddd9aiqfEcg05osjy3ljEKj2l8llLpE23JKnHePaMEFuJWFNJ DnbJk5Zw+dRyQ== 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 25/31] x86/mm/dump_pagetables: Define INIT_PGD Date: Fri, 9 Feb 2018 10:25:34 +0100 Message-Id: <1518168340-9392-26-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518168340-9392-1-git-send-email-joro@8bytes.org> References: <1518168340-9392-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