Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Oct 1998 18:46:03 +0100
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        freebsd-smp@FreeBSD.ORG
Cc:        nops@maths.tcd.ie
Message-ID:   <9810141846.aa07903@salmon.maths.tcd.ie>

next in thread | raw e-mail | index | archive | help
Subject: Re: dual PII 450 Iwill DBL00 and DBS100 
In-reply-to: Your message of "Tue, 13 Oct 1998 14:48:25 BST."
             <9810131448.aa21100@salmon.maths.tcd.ie> 
--------
In message <9810131448.aa21100@salmon.maths.tcd.ie>, Eoin Lawless writes:
>
>We are trying to use a dual PII 450 Iwill motherboard with FreeBSD
>(sources current to 9 October, using elf). We've tried both the
>DBL100 and DBS100.  Unfortunately the second processor does not
>seem to behave correctly. It runs, but only at about 1% of the
>correct speed.

We've just figured out what is causing this. There are two problems:

1.	The BIOS in the DBL100 (and DBS100) motherboard does not set up the
	MTRRs for the second CPU correctly. All the variable-range MTRRs
	in the AP contain 0. (I haven't checked the fixed ones yet)

2.	Due to some broken code in i386/pmap.c, FreeBSD does not copy the
	MTRRs from the BSP to the AP. It checks cpu == CPU_686 instead of
	cpu_class == CPUCLASS_686 to determine if the MTRRs are present.
	The cpu is now detected as CPU_PII, so the MTRRs are never
	programmed. The patch below fixes this.

BTW is the getmtrr() in ap_init() necessary? As far as I can see this will
just overwrite the global PPro_vmtrr array with the APs MTRR register
contents - this isn't a problem as such because init_secondary writes
the contents of PPro_vmtrr to the AP first, but seems unnecessary.

Ian


--- pmap.c.orig	Wed Oct 14 18:20:27 1998
+++ pmap.c	Wed Oct 14 18:21:32 1998
@@ -459,7 +459,7 @@
 {
 	int i;
 
-	if (cpu == CPU_686) {
+	if (cpu_class == CPUCLASS_686) {
 		for(i = 0; i < NPPROVMTRR; i++) {
 			PPro_vmtrr[i].base = rdmsr(PPRO_VMTRRphysBase0 + i * 2);
 			PPro_vmtrr[i].mask = rdmsr(PPRO_VMTRRphysMask0 + i * 2);
@@ -472,7 +472,7 @@
 {
 	int i;
 
-	if (cpu == CPU_686) {
+	if (cpu_class == CPUCLASS_686) {
 		wbinvd();
 		for(i = 0; i < NPPROVMTRR; i++) {
 			wrmsr(PPRO_VMTRRphysBase0 + i * 2, PPro_vmtrr[i].base);
@@ -485,7 +485,7 @@
 pmap_setvidram(void)
 {
 #if 0
-	if (cpu == CPU_686) {
+	if (cpu_class == CPUCLASS_686) {
 		wbinvd();
 		/*
 		 * Set memory between 0-640K to be WB
@@ -508,7 +508,7 @@
 	unsigned long long base;
 	unsigned long long mask;
 
-	if (cpu != CPU_686)
+	if (cpu_class != CPUCLASS_686)
 		return;
 
 	free = -1;
@@ -2819,7 +2819,7 @@
 	cpu_invlpg(&prv_CPAGE3);
 
 #if defined(I686_CPU)
-	if (cpu == CPU_686)
+	if (cpu_class == CPUCLASS_686)
 		i686_pagezero(&prv_CPAGE3);
 	else
 #endif
@@ -2840,7 +2840,7 @@
 	}
 
 #if defined(I686_CPU)
-	if (cpu == CPU_686)
+	if (cpu_class == CPUCLASS_686)
 		i686_pagezero(CADDR2);
 	else
 #endif



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9810141846.aa07903>