From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752390AbdFMKGK (ORCPT ); Tue, 13 Jun 2017 06:06:10 -0400 Received: from terminus.zytor.com ([65.50.211.136]:47213 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751892AbdFMKGI (ORCPT ); Tue, 13 Jun 2017 06:06:08 -0400 Date: Tue, 13 Jun 2017 03:02:14 -0700 From: tip-bot for Vlastimil Babka Message-ID: Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, borntraeger@de.ibm.com, penberg@kernel.org, vegardno@ifi.uio.no, torvalds@linux-foundation.org, mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de, vbabka@suse.cz Reply-To: penberg@kernel.org, vegardno@ifi.uio.no, linux-kernel@vger.kernel.org, peterz@infradead.org, borntraeger@de.ibm.com, tglx@linutronix.de, vbabka@suse.cz, mingo@kernel.org, torvalds@linux-foundation.org, hpa@zytor.com In-Reply-To: <2be70c78-6130-855d-3dfa-d87bd1dd4fda@suse.cz> References: <2be70c78-6130-855d-3dfa-d87bd1dd4fda@suse.cz> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/mm: Disable 1GB direct mappings when disabling 2MB mappings Git-Commit-ID: d9ee35acfabbc909c3be4360cd5655a006628b2e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d9ee35acfabbc909c3be4360cd5655a006628b2e Gitweb: http://git.kernel.org/tip/d9ee35acfabbc909c3be4360cd5655a006628b2e Author: Vlastimil Babka AuthorDate: Mon, 12 Jun 2017 09:21:30 +0200 Committer: Ingo Molnar CommitDate: Tue, 13 Jun 2017 08:33:00 +0200 x86/mm: Disable 1GB direct mappings when disabling 2MB mappings The kmemleak and debug_pagealloc features both disable using huge pages for direct mappings so they can do cpa() on page level granularity in any context. However they only do that for 2MB pages, which means 1GB pages can still be used if the CPU supports it, unless disabled by a boot param, which is non-obvious. Disable also 1GB pages when disabling 2MB pages. Signed-off-by: Vlastimil Babka Cc: Christian Borntraeger Cc: Linus Torvalds Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Vegard Nossum Cc: linux-mm@kvack.org Link: http://lkml.kernel.org/r/2be70c78-6130-855d-3dfa-d87bd1dd4fda@suse.cz Signed-off-by: Ingo Molnar --- arch/x86/mm/init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index cbc87ea..9b3f9fa 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -161,16 +161,16 @@ static int page_size_mask; static void __init probe_page_size_mask(void) { -#if !defined(CONFIG_KMEMCHECK) /* * For CONFIG_KMEMCHECK or pagealloc debugging, identity mapping will * use small pages. * This will simplify cpa(), which otherwise needs to support splitting * large pages into small in interrupt context, etc. */ - if (boot_cpu_has(X86_FEATURE_PSE) && !debug_pagealloc_enabled()) + if (boot_cpu_has(X86_FEATURE_PSE) && !debug_pagealloc_enabled() && !IS_ENABLED(CONFIG_KMEMCHECK)) page_size_mask |= 1 << PG_LEVEL_2M; -#endif + else + direct_gbpages = 0; /* Enable PSE if available */ if (boot_cpu_has(X86_FEATURE_PSE))