From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751810AbdFIN6g (ORCPT ); Fri, 9 Jun 2017 09:58:36 -0400 Received: from mx2.suse.de ([195.135.220.15]:37822 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751739AbdFIN6f (ORCPT ); Fri, 9 Jun 2017 09:58:35 -0400 From: Vlastimil Babka To: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Vegard Nossum , Pekka Enberg , Christian Borntraeger , Vlastimil Babka Subject: [PATCH] x86, mm: disable 1GB direct mapping when disabling 2MB mapping Date: Fri, 9 Jun 2017 15:57:43 +0200 Message-Id: <20170609135743.9920-1-vbabka@suse.cz> X-Mailer: git-send-email 2.13.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The kmemleak and debug_pagealloc features both disable using huge pages for direct mapping 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 --- arch/x86/mm/init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index cbc87ea98751..20282dfce0fa 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -170,6 +170,10 @@ static void __init probe_page_size_mask(void) */ if (boot_cpu_has(X86_FEATURE_PSE) && !debug_pagealloc_enabled()) page_size_mask |= 1 << PG_LEVEL_2M; + else + direct_gbpages = 0; +#else + direct_gbpages = 0; #endif /* Enable PSE if available */ -- 2.13.1