* [PATCH 0/2] x86/mm: Fix 'no5lvl' handling in v4.18-rc1
@ 2018-06-22 22:08 Kirill A. Shutemov
2018-06-22 22:08 ` [PATCH 1/2] Revert "x86/mm: Mark __pgtable_l5_enabled __initdata" Kirill A. Shutemov
2018-06-22 22:08 ` [PATCH 2/2] x86/mm: Fix 'no5lvl' handling Kirill A. Shutemov
0 siblings, 2 replies; 5+ messages in thread
From: Kirill A. Shutemov @ 2018-06-22 22:08 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, x86
Cc: linux-kernel, Kirill A. Shutemov
One of patches from 'no5lvl' patchset didn't get merged due collision with
other code and I screwed up bisectablity. As result 'no5lvl' is broken in
v4.18-rc1.
Fix the mess.
Kirill A. Shutemov (2):
Revert "x86/mm: Mark __pgtable_l5_enabled __initdata"
x86/mm: Fix 'no5lvl' handling
arch/x86/kernel/cpu/common.c | 3 +++
arch/x86/kernel/head64.c | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
--
2.17.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] Revert "x86/mm: Mark __pgtable_l5_enabled __initdata"
2018-06-22 22:08 [PATCH 0/2] x86/mm: Fix 'no5lvl' handling in v4.18-rc1 Kirill A. Shutemov
@ 2018-06-22 22:08 ` Kirill A. Shutemov
2018-06-23 12:30 ` [tip:x86/urgent] " tip-bot for Kirill A. Shutemov
2018-06-22 22:08 ` [PATCH 2/2] x86/mm: Fix 'no5lvl' handling Kirill A. Shutemov
1 sibling, 1 reply; 5+ messages in thread
From: Kirill A. Shutemov @ 2018-06-22 22:08 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, x86
Cc: linux-kernel, Kirill A. Shutemov
This reverts commit e4e961e36f063484c48bed919013c106d178995d.
We need to use early version of pgtable_l5_enabled() in
early_identify_cpu() as this code runs before cpu_feature_enabled() is
usable.
But it leads to section mismatch:
cpu_init()
load_mm_ldt()
ldt_slot_va()
LDT_BASE_ADDR
LDT_PGD_ENTRY
pgtable_l5_enabled()
__pgtable_l5_enabled
__pgtable_l5_enabled marked as __initdata, but cpu_init() is not __init.
It's fixable: early code can be isolated into a separate translation
unit, but such change collides with other work in the area.
That's too much hassle to save 4 bytes of memory.
Return __pgtable_l5_enabled back to be __ro_after_init.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
arch/x86/kernel/head64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index a21d6ace648e..8047379e575a 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -44,7 +44,7 @@ static unsigned int __initdata next_early_pgt;
pmdval_t early_pmd_flags = __PAGE_KERNEL_LARGE & ~(_PAGE_GLOBAL | _PAGE_NX);
#ifdef CONFIG_X86_5LEVEL
-unsigned int __pgtable_l5_enabled __initdata;
+unsigned int __pgtable_l5_enabled __ro_after_init;
unsigned int pgdir_shift __ro_after_init = 39;
EXPORT_SYMBOL(pgdir_shift);
unsigned int ptrs_per_p4d __ro_after_init = 1;
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] x86/mm: Fix 'no5lvl' handling
2018-06-22 22:08 [PATCH 0/2] x86/mm: Fix 'no5lvl' handling in v4.18-rc1 Kirill A. Shutemov
2018-06-22 22:08 ` [PATCH 1/2] Revert "x86/mm: Mark __pgtable_l5_enabled __initdata" Kirill A. Shutemov
@ 2018-06-22 22:08 ` Kirill A. Shutemov
2018-06-23 12:31 ` [tip:x86/urgent] " tip-bot for Kirill A. Shutemov
1 sibling, 1 reply; 5+ messages in thread
From: Kirill A. Shutemov @ 2018-06-22 22:08 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, x86
Cc: linux-kernel, Kirill A. Shutemov
early_identify_cpu() has to use early version of pgtable_l5_enabled()
that doesn't rely on cpu_feature_enabled().
Defining USE_EARLY_PGTABLE_L5 before all includes does the trick.
I lost the define in one of reworks of the original patch.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Fixes: 372fddf70904 ("x86/mm: Introduce the 'no5lvl' kernel parameter")
---
arch/x86/kernel/cpu/common.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 0df7151cfef4..eb4cb3efd20e 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1,3 +1,6 @@
+/* cpu_feature_enabled() cannot be used this early */
+#define USE_EARLY_PGTABLE_L5
+
#include <linux/bootmem.h>
#include <linux/linkage.h>
#include <linux/bitops.h>
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [tip:x86/urgent] Revert "x86/mm: Mark __pgtable_l5_enabled __initdata"
2018-06-22 22:08 ` [PATCH 1/2] Revert "x86/mm: Mark __pgtable_l5_enabled __initdata" Kirill A. Shutemov
@ 2018-06-23 12:30 ` tip-bot for Kirill A. Shutemov
0 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Kirill A. Shutemov @ 2018-06-23 12:30 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, tglx, kirill.shutemov, mingo, hpa
Commit-ID: 51be1335151771075dcb19f3464ca9f331134285
Gitweb: https://git.kernel.org/tip/51be1335151771075dcb19f3464ca9f331134285
Author: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
AuthorDate: Sat, 23 Jun 2018 01:08:40 +0300
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sat, 23 Jun 2018 14:20:37 +0200
Revert "x86/mm: Mark __pgtable_l5_enabled __initdata"
This reverts commit e4e961e36f063484c48bed919013c106d178995d.
We need to use early version of pgtable_l5_enabled() in
early_identify_cpu() as this code runs before cpu_feature_enabled() is
usable.
But it leads to section mismatch:
cpu_init()
load_mm_ldt()
ldt_slot_va()
LDT_BASE_ADDR
LDT_PGD_ENTRY
pgtable_l5_enabled()
__pgtable_l5_enabled
__pgtable_l5_enabled marked as __initdata, but cpu_init() is not __init.
It's fixable: early code can be isolated into a separate translation unit,
but such change collides with other work in the area. That's too much
hassle to save 4 bytes of memory.
Return __pgtable_l5_enabled back to be __ro_after_init.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Link: https://lkml.kernel.org/r/20180622220841.54135-2-kirill.shutemov@linux.intel.com
---
arch/x86/kernel/head64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index a21d6ace648e..8047379e575a 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -44,7 +44,7 @@ static unsigned int __initdata next_early_pgt;
pmdval_t early_pmd_flags = __PAGE_KERNEL_LARGE & ~(_PAGE_GLOBAL | _PAGE_NX);
#ifdef CONFIG_X86_5LEVEL
-unsigned int __pgtable_l5_enabled __initdata;
+unsigned int __pgtable_l5_enabled __ro_after_init;
unsigned int pgdir_shift __ro_after_init = 39;
EXPORT_SYMBOL(pgdir_shift);
unsigned int ptrs_per_p4d __ro_after_init = 1;
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [tip:x86/urgent] x86/mm: Fix 'no5lvl' handling
2018-06-22 22:08 ` [PATCH 2/2] x86/mm: Fix 'no5lvl' handling Kirill A. Shutemov
@ 2018-06-23 12:31 ` tip-bot for Kirill A. Shutemov
0 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Kirill A. Shutemov @ 2018-06-23 12:31 UTC (permalink / raw)
To: linux-tip-commits; +Cc: mingo, kirill.shutemov, linux-kernel, tglx, hpa
Commit-ID: 2458e53ff74cd1063ed3e00459da1d35c559d369
Gitweb: https://git.kernel.org/tip/2458e53ff74cd1063ed3e00459da1d35c559d369
Author: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
AuthorDate: Sat, 23 Jun 2018 01:08:41 +0300
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sat, 23 Jun 2018 14:20:37 +0200
x86/mm: Fix 'no5lvl' handling
early_identify_cpu() has to use early version of pgtable_l5_enabled()
that doesn't rely on cpu_feature_enabled().
Defining USE_EARLY_PGTABLE_L5 before all includes does the trick.
I lost the define in one of reworks of the original patch.
Fixes: 372fddf70904 ("x86/mm: Introduce the 'no5lvl' kernel parameter")
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Link: https://lkml.kernel.org/r/20180622220841.54135-3-kirill.shutemov@linux.intel.com
---
arch/x86/kernel/cpu/common.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 0df7151cfef4..eb4cb3efd20e 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1,3 +1,6 @@
+/* cpu_feature_enabled() cannot be used this early */
+#define USE_EARLY_PGTABLE_L5
+
#include <linux/bootmem.h>
#include <linux/linkage.h>
#include <linux/bitops.h>
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-06-23 12:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-22 22:08 [PATCH 0/2] x86/mm: Fix 'no5lvl' handling in v4.18-rc1 Kirill A. Shutemov
2018-06-22 22:08 ` [PATCH 1/2] Revert "x86/mm: Mark __pgtable_l5_enabled __initdata" Kirill A. Shutemov
2018-06-23 12:30 ` [tip:x86/urgent] " tip-bot for Kirill A. Shutemov
2018-06-22 22:08 ` [PATCH 2/2] x86/mm: Fix 'no5lvl' handling Kirill A. Shutemov
2018-06-23 12:31 ` [tip:x86/urgent] " tip-bot for Kirill A. Shutemov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox