From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755020AbdIRK7l (ORCPT ); Mon, 18 Sep 2017 06:59:41 -0400 Received: from mga07.intel.com ([134.134.136.100]:26252 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753855AbdIRK4O (ORCPT ); Mon, 18 Sep 2017 06:56:14 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,412,1500966000"; d="scan'208";a="312867688" From: "Kirill A. Shutemov" To: Ingo Molnar , Linus Torvalds , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" Cc: Andrew Morton , Andy Lutomirski , Cyrill Gorcunov , Borislav Petkov , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCHv7 11/19] x86/mm: Make STACK_TOP_MAX dynamic Date: Mon, 18 Sep 2017 13:55:45 +0300 Message-Id: <20170918105553.27914-12-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170918105553.27914-1-kirill.shutemov@linux.intel.com> References: <20170918105553.27914-1-kirill.shutemov@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For boot-time switching between paging modes, we need to be able to change STACK_TOP_MAX at runtime. The change is trivial and it doesn't affect kernel image size. Signed-off-by: Kirill A. Shutemov --- arch/x86/include/asm/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 3fa26a61eabc..fa9300ccce1b 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -871,7 +871,7 @@ static inline void spin_lock_prefetch(const void *x) IA32_PAGE_OFFSET : TASK_SIZE_MAX) #define STACK_TOP TASK_SIZE_LOW -#define STACK_TOP_MAX TASK_SIZE_MAX +#define STACK_TOP_MAX (pgtable_l5_enabled ? TASK_SIZE_MAX : DEFAULT_MAP_WINDOW) #define INIT_THREAD { \ .sp0 = TOP_OF_INIT_STACK, \ -- 2.14.1