summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-02-13 01:52:44 +0000
committerpeter <peter@FreeBSD.org>2003-02-13 01:52:44 +0000
commitcd0627ca28463482281255ffd580c4ed7af16f0c (patch)
tree73d501de2574069d440318c272878cd5924b34dc /sys/amd64
parent30c571736e3b0f7e68085689796538a8b6232925 (diff)
downloadFreeBSD-src-cd0627ca28463482281255ffd580c4ed7af16f0c.zip
FreeBSD-src-cd0627ca28463482281255ffd580c4ed7af16f0c.tar.gz
Turn of PG_PS and PG_G for Pentium-4 cpus at boot time. This is so
that we can stop turning off PG_G and PG_PS globally for releases.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/pmap.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 46d8bb5..e730ffc 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -259,6 +259,13 @@ pmap_kmem_choose(vm_offset_t addr)
{
vm_offset_t newaddr = addr;
+#ifdef I686_CPU
+ /* Deal with un-resolved Pentium4 issues */
+ if (cpu_class == CPUCLASS_686 &&
+ strcmp(cpu_vendor, "GenuineIntel") == 0 &&
+ (cpu_id & 0xf00) == 0xf00)
+ return newaddr;
+#endif
#ifndef DISABLE_PSE
if (cpu_feature & CPUID_PSE)
newaddr = (addr + (NBPDR - 1)) & ~(NBPDR - 1);
@@ -370,6 +377,15 @@ pmap_bootstrap(firstaddr, loadaddr)
if (cpu_feature & CPUID_PGE)
pgeflag = PG_G;
#endif
+#ifdef I686_CPU
+ /* Deal with un-resolved Pentium4 issues */
+ if (cpu_class == CPUCLASS_686 &&
+ strcmp(cpu_vendor, "GenuineIntel") == 0 &&
+ (cpu_id & 0xf00) == 0xf00) {
+ printf("Warning: Pentium 4 cpu: PG_G disabled (global flag)\n");
+ pgeflag = 0;
+ }
+#endif
/*
* Initialize the 4MB page size flag
@@ -382,12 +398,24 @@ pmap_bootstrap(firstaddr, loadaddr)
pdir4mb = 0;
#ifndef DISABLE_PSE
- if (cpu_feature & CPUID_PSE) {
+ if (cpu_feature & CPUID_PSE)
+ pseflag = PG_PS;
+#endif
+#ifdef I686_CPU
+ /* Deal with un-resolved Pentium4 issues */
+ if (cpu_class == CPUCLASS_686 &&
+ strcmp(cpu_vendor, "GenuineIntel") == 0 &&
+ (cpu_id & 0xf00) == 0xf00) {
+ printf("Warning: Pentium 4 cpu: PG_PS disabled (4MB pages)\n");
+ pseflag = 0;
+ }
+#endif
+#ifndef DISABLE_PSE
+ if (pseflag) {
pd_entry_t ptditmp;
/*
* Note that we have enabled PSE mode
*/
- pseflag = PG_PS;
ptditmp = *(PTmap + i386_btop(KERNBASE));
ptditmp &= ~(NBPDR - 1);
ptditmp |= PG_V | PG_RW | PG_PS | PG_U | pgeflag;
OpenPOWER on IntegriCloud