Skip to contentSkip to conversation

x86-64: also clear _PAGE_GLOBAL from __supported_pte_mask if !cpu_has_pge

PATCH New Jan Beulich 2 participants 3 messages Jan 23, 2015 – Feb 19, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86-64: also clear _PAGE_GLOBAL from __supported_pte_mask if !cpu_has_pge

Not just setting it when the feature is available is for consistency, and may allow Xen to drop its custom clearing of the flag (unless it needs it cleared earlier than this code executes). Note that the change is benign to ix86, as the flag starts out clear there.

---
 arch/x86/mm/init.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/mm/init.c +2 -1
@@ -179,7 +179,8 @@ static void __init probe_page_size_mask(
 	if (cpu_has_pge) {
 		set_in_cr4(X86_CR4_PGE);
 		__supported_pte_mask |= _PAGE_GLOBAL;
-	}
+	} else
+		__supported_pte_mask &= ~_PAGE_GLOBAL;
 }
 
 #ifdef CONFIG_X86_32
#1 lore raw

[tip:x86/asm] x86-64: Also clear _PAGE_GLOBAL from __supported_pte_mask if !cpu_has_pge

x86-64: Also clear _PAGE_GLOBAL from __supported_pte_mask if !cpu_has_pge
Commit-ID:  3ebfaff2bbd1d2ef882e475245d9f0276f21fe83
Gitweb:     http://git.kernel.org/tip/3ebfaff2bbd1d2ef882e475245d9f0276f21fe83
Author:     Jan Beulich <[email protected]>
AuthorDate: Fri, 23 Jan 2015 08:35:13 +0000
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 19 Feb 2015 00:44:46 +0100

x86-64: Also clear _PAGE_GLOBAL from __supported_pte_mask if !cpu_has_pge

Not just setting it when the feature is available is for consistency, and may allow Xen to drop its custom clearing of the flag (unless it needs it cleared earlier than this code executes). Note that the change is benign to ix86, as the flag starts out clear there.

---
 arch/x86/mm/init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/mm/init.c +2 -1
index 079c3b6..090499a 100644
@@ -179,7 +179,8 @@ static void __init probe_page_size_mask(void)
 	if (cpu_has_pge) {
 		set_in_cr4(X86_CR4_PGE);
 		__supported_pte_mask |= _PAGE_GLOBAL;
-	}
+	} else
+		__supported_pte_mask &= ~_PAGE_GLOBAL;
 }
 
 #ifdef CONFIG_X86_32
#2 lore raw

[tip:x86/asm] x86-64: Also clear _PAGE_GLOBAL from __supported_pte_mask if !cpu_has_pge

In reply to Jan Beulich
x86-64: Also clear _PAGE_GLOBAL from __supported_pte_mask if !cpu_has_pge
Commit-ID:  0cdb81bef20b1d9e12111fa6cd81f748ebd87778
Gitweb:     http://git.kernel.org/tip/0cdb81bef20b1d9e12111fa6cd81f748ebd87778
Author:     Jan Beulich <[email protected]>
AuthorDate: Fri, 23 Jan 2015 08:35:13 +0000
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 19 Feb 2015 02:18:26 +0100

x86-64: Also clear _PAGE_GLOBAL from __supported_pte_mask if !cpu_has_pge

Not just setting it when the feature is available is for consistency, and may allow Xen to drop its custom clearing of the flag (unless it needs it cleared earlier than this code executes). Note that the change is benign to ix86, as the flag starts out clear there.

---
 arch/x86/mm/init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/mm/init.c +2 -1
index 079c3b6..090499a 100644
@@ -179,7 +179,8 @@ static void __init probe_page_size_mask(void)
 	if (cpu_has_pge) {
 		set_in_cr4(X86_CR4_PGE);
 		__supported_pte_mask |= _PAGE_GLOBAL;
-	}
+	} else
+		__supported_pte_mask &= ~_PAGE_GLOBAL;
 }
 
 #ifdef CONFIG_X86_32