aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/amd64/pmap.c6
-rw-r--r--sys/i386/i386/pmap.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index a52736bb3d55..9a2f35983a9e 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -443,6 +443,12 @@ pmap_set_opt(void)
if (pgeflag) {
/* Turn on PG_G for text, data, bss pages. */
va = (vm_offset_t)btext;
+#ifndef DISABLE_PSE
+ if (pseflag && (cpu_feature & CPUID_PSE)) {
+ if (va < KERNBASE + (1 << PDRSHIFT))
+ va = KERNBASE + (1 << PDRSHIFT);
+ }
+#endif
endva = KERNBASE + KERNend;
while (va < endva) {
pte = vtopte(va);
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index a52736bb3d55..9a2f35983a9e 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -443,6 +443,12 @@ pmap_set_opt(void)
if (pgeflag) {
/* Turn on PG_G for text, data, bss pages. */
va = (vm_offset_t)btext;
+#ifndef DISABLE_PSE
+ if (pseflag && (cpu_feature & CPUID_PSE)) {
+ if (va < KERNBASE + (1 << PDRSHIFT))
+ va = KERNBASE + (1 << PDRSHIFT);
+ }
+#endif
endva = KERNBASE + KERNend;
while (va < endva) {
pte = vtopte(va);