Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jun 2009 14:11:43 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r195193 - in stable/7/sys: . amd64/amd64 arm/arm contrib/pf i386/i386 ia64/ia64 sparc64/sparc64
Message-ID:  <200906301411.n5UEBhm5082955@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Tue Jun 30 14:11:43 2009
New Revision: 195193
URL: http://svn.freebsd.org/changeset/base/195193

Log:
  MFC 179229 (alc), 195188: The VM system no longer uses setPQL2().
  
  Remove it and its helpers.
  Drop unused extern declarations in amd64 that seem to have been related.
  
  Reviewed by:	alc

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/amd64/amd64/identcpu.c
  stable/7/sys/arm/arm/identcpu.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/i386/i386/identcpu.c
  stable/7/sys/ia64/ia64/machdep.c
  stable/7/sys/sparc64/sparc64/identcpu.c

Modified: stable/7/sys/amd64/amd64/identcpu.c
==============================================================================
--- stable/7/sys/amd64/amd64/identcpu.c	Tue Jun 30 13:53:54 2009	(r195192)
+++ stable/7/sys/amd64/amd64/identcpu.c	Tue Jun 30 14:11:43 2009	(r195193)
@@ -71,8 +71,6 @@ void panicifcpuunsupported(void);
 
 static void print_AMD_info(void);
 static void print_AMD_assoc(int i);
-void setPQL2(int *const size, int *const ways);
-static void setPQL2_AMD(int *const size, int *const ways);
 
 int	cpu_class;
 char machine[] = "amd64";
@@ -97,9 +95,6 @@ static struct {
 	{ "Sledgehammer",	CPUCLASS_K8 },		/* CPU_SLEDGEHAMMER */
 };
 
-extern int pq_l2size;
-extern int pq_l2nways;
-
 void
 printcpuinfo(void)
 {
@@ -564,30 +559,3 @@ print_AMD_info(void)
 		print_AMD_l2_assoc((regs[2] >> 12) & 0x0f);	
 	}
 }
-
-static void             
-setPQL2_AMD(int *const size, int *const ways)
-{
-	if (cpu_exthigh >= 0x80000006) {
-		u_int regs[4];
-
-		do_cpuid(0x80000006, regs);
-		*size = regs[2] >> 16;
-		*ways = (regs[2] >> 12) & 0x0f;
-		switch (*ways) {
-		case 0:				/* disabled/not present */
-		case 15:			/* fully associative */
-		default: *ways = 1; break;	/* reserved configuration */
-		case 4: *ways = 4; break;
-		case 6: *ways = 8; break;
-		case 8: *ways = 16; break;
-		}
-	}
-}
-
-void
-setPQL2(int *const size, int *const ways)
-{
-	if (strcmp(cpu_vendor, "AuthenticAMD") == 0)
-		setPQL2_AMD(size, ways);
-}

Modified: stable/7/sys/arm/arm/identcpu.c
==============================================================================
--- stable/7/sys/arm/arm/identcpu.c	Tue Jun 30 13:53:54 2009	(r195192)
+++ stable/7/sys/arm/arm/identcpu.c	Tue Jun 30 14:11:43 2009	(r195193)
@@ -356,14 +356,6 @@ static const char * const wtnames[] = {
 	"**unknown 15**",
 };
 
-void setPQL2(int *const size, int *const ways);
-
-void
-setPQL2(int *const size, int *const ways)
-{
-	return;
-}
-
 
 extern int ctrl;
 void

Modified: stable/7/sys/i386/i386/identcpu.c
==============================================================================
--- stable/7/sys/i386/i386/identcpu.c	Tue Jun 30 13:53:54 2009	(r195192)
+++ stable/7/sys/i386/i386/identcpu.c	Tue Jun 30 14:11:43 2009	(r195193)
@@ -77,10 +77,6 @@ void panicifcpuunsupported(void);
 
 static void identifycyrix(void);
 static void init_exthigh(void);
-void setPQL2(int *const size, int *const ways);
-static void setPQL2_AMD(int *const size, int *const ways);
-static void setPQL2_INTEL(int *const size, int *const ways);
-static void get_INTEL_TLB(u_int data, int *const size, int *const ways);
 static void print_AMD_info(void);
 static void print_INTEL_info(void);
 static void print_INTEL_TLB(u_int data);
@@ -1477,300 +1473,6 @@ print_INTEL_TLB(u_int data)
 	}
 }
 
-
-static void
-setPQL2_AMD(int *const size, int *const ways)
-{
-	if (cpu_exthigh >= 0x80000006) {
-		u_int regs[4];
-
-		do_cpuid(0x80000006, regs);
-		*size = regs[2] >> 16;
-		*ways = (regs[2] >> 12) & 0x0f;
-	}
-}
-
-
-static void
-setPQL2_INTEL(int *const size, int *const ways)
-{
-	u_int rounds, regnum;
-	u_int regs[4];
-	u_int nwaycode;
-
-	if (cpu_high >= 2) {
-		rounds = 0;
-		do {
-			do_cpuid(0x2, regs);
-			if (rounds == 0 && (rounds = (regs[0] & 0xff)) == 0)
-				break;	/* we have a buggy CPU */
-
-			for (regnum = 0; regnum <= 3; ++regnum) {
-				if (regs[regnum] & (1<<31))
-					continue;
-				if (regnum != 0)
-					get_INTEL_TLB(regs[regnum] & 0xff,
-					    size, ways);
-				get_INTEL_TLB((regs[regnum] >> 8) & 0xff,
-				    size, ways);
-				get_INTEL_TLB((regs[regnum] >> 16) & 0xff,
-				    size, ways);
-				get_INTEL_TLB((regs[regnum] >> 24) & 0xff,
-				    size, ways);
-			}
-		} while (--rounds > 0);
-	}
-
-	if (cpu_exthigh >= 0x80000006) {
-		do_cpuid(0x80000006, regs);
-		if (*size < ((regs[2] >> 16) & 0xffff)) {
-			*size = (regs[2] >> 16) & 0xffff;
-			nwaycode = (regs[2] >> 12) & 0x0f;
-			if (nwaycode >= 0x02 && nwaycode <= 0x08)
-				*ways = 1 << (nwaycode / 2);
-			else
-				*ways = 0;
-		}
-        }
-}
-
-static void
-get_INTEL_TLB(u_int data, int *const size, int *const ways)
-{
-	switch (data) {
-	default:
-		break;
-	case 0x22:
-		/* 3rd-level cache: 512 KB, 4-way set associative,
-		 * sectored cache, 64 byte line size */
-		if (*size < 512) {
-			*size = 512;
-			*ways = 4;
-		}
-		break;
-	case 0x23:
-		/* 3rd-level cache: 1 MB, 8-way set associative,
-		 * sectored cache, 64 byte line size */
-		if (*size < 1024) {
-			*size = 1024;
-			*ways = 8;
-		}
-		break;
-	case 0x25:
-		/* 3rd-level cache: 2 MB, 8-way set associative,
-		 * sectored cache, 64 byte line size */
-		if (*size < 2048) {
-			*size = 2048;
-			*ways = 8;
-		}
-		break;
-	case 0x29:
-		/* 3rd-level cache: 4 MB, 8-way set associative,
-		 * sectored cache, 64 byte line size */
-		if (*size < 4096) {
-			*size = 4096;
-			*ways = 8;
-		}
-		break;
-	case 0x39:
-		/* 2nd-level cache: 128 KB, 4-way set associative,
-		 * sectored cache, 64 byte line size */
-		if (*size < 128) {
-			*size = 128;
-			*ways = 4;
-		}
-		break;
-	case 0x3b:
-		/* 2nd-level cache: 128 KB, 2-way set associative,
-		 * sectored cache, 64 byte line size */
-		if (*size < 128) {
-			*size = 128;
-			*ways = 2;
-		}
-		break;
-	case 0x3c:
-		/* 2nd-level cache: 256 KB, 4-way set associative,
-		 * sectored cache, 64 byte line size */
-		if (*size < 256) {
-			*size = 256;
-			*ways = 4;
-		}
-		break;
-	case 0x41:
-		/* 2nd-level cache: 128 KB, 4-way set associative,
-		 * 32 byte line size */
-		if (*size < 128) {
-			*size = 128;
-			*ways = 4;
-		}
-		break;
-	case 0x42:
-		/* 2nd-level cache: 256 KB, 4-way set associative,
-		 * 32 byte line size */
-		if (*size < 256) {
-			*size = 256;
-			*ways = 4;
-		}
-		break;
-	case 0x43:
-		/* 2nd-level cache: 512 KB, 4-way set associative,
-		 * 32 byte line size */
-		if (*size < 512) {
-			*size = 512;
-			*ways = 4;
-		}
-		break;
-	case 0x44:
-		/* 2nd-level cache: 1 MB, 4-way set associative,
-		 * 32 byte line size */
-		if (*size < 1024) {
-			*size = 1024;
-			*ways = 4;
-		}
-		break;
-	case 0x45:
-		/* 2nd-level cache: 2 MB, 4-way set associative,
-		 * 32 byte line size */
-		if (*size < 2048) {
-			*size = 2048;
-			*ways = 4;
-		}
-		break;
-	case 0x46:
-		/* 3rd-level cache: 4 MB, 4-way set associative,
-		 * 64 byte line size */
-		if (*size < 4096) {
-			*size = 4096;
-			*ways = 4;
-		}
-		break;
-	case 0x47:
-		/* 3rd-level cache: 8 MB, 8-way set associative,
-		 * 64 byte line size */
-		if (*size < 8192) {
-			*size = 8192;
-			*ways = 8;
-		}
-		break;
-	case 0x78:
-		/* 2nd-level cache: 1 MB, 4-way set associative,
-		 * 64-byte line size */
-		if (*size < 1024) {
-			*size = 1024;
-			*ways = 4;
-		}
-		break;
-	case 0x79:
-		/* 2nd-level cache: 128 KB, 8-way set associative,
-		 * sectored cache, 64 byte line size */
-		if (*size < 128) {
-			*size = 128;
-			*ways = 8;
-		}
-		break;
-	case 0x7a:
-		/* 2nd-level cache: 256 KB, 8-way set associative,
-		 * sectored cache, 64 byte line size */
-		if (*size < 256) {
-			*size = 256;
-			*ways = 8;
-		}
-		break;
-	case 0x7b:
-		/* 2nd-level cache: 512 KB, 8-way set associative,
-		 * sectored cache, 64 byte line size */
-		if (*size < 512) {
-			*size = 512;
-			*ways = 8;
-		}
-		break;
-	case 0x7c:
-		/* 2nd-level cache: 1 MB, 8-way set associative,
-		 * sectored cache, 64 byte line size */
-		if (*size < 1024) {
-			*size = 1024;
-			*ways = 8;
-		}
-		break;
-	case 0x7d:
-		/* 2nd-level cache: 2 MB, 8-way set associative,
-		 * 64-byte line size */
-		if (*size < 2048) {
-			*size = 2048;
-			*ways = 8;
-		}
-		break;
-	case 0x7f:
-		/* 2nd-level cache: 512 KB, 2-way set associative,
-		 * 64-byte line size */
-		if (*size < 512) {
-			*size = 512;
-			*ways = 2;
-		}
-		break;
-	case 0x82:
-		/* 2nd-level cache: 256 KB, 8-way set associative,
-		 * 32 byte line size */
-		if (*size < 256) {
-			*size = 256;
-			*ways = 8;
-		}
-		break;
-	case 0x83:
-		/* 2nd-level cache: 512 KB, 8-way set associative,
-		 * 32 byte line size */
-		if (*size < 512) {
-			*size = 512;
-			*ways = 8;
-		}
-		break;
-	case 0x84:
-		/* 2nd-level cache: 1 MB, 8-way set associative,
-		 * 32 byte line size */
-		if (*size < 1024) {
-			*size = 1024;
-			*ways = 8;
-		}
-		break;
-	case 0x85:
-		/* 2nd-level cache: 2 MB, 8-way set associative,
-		 * 32 byte line size */
-		if (*size < 2048) {
-			*size = 2048;
-			*ways = 8;
-		}
-		break;
-	case 0x86:
-		/* 2nd-level cache: 512 KB, 4-way set associative,
-		 * 64 byte line size */
-		if (*size < 512) {
-			*size = 512;
-			*ways = 4;
-		}
-		break;
-	case 0x87:
-		/* 2nd-level cache: 1 MB, 8-way set associative,
-		 * 64 byte line size */
-		if (*size < 1024) {
-			*size = 512;
-			*ways = 8;
-		}
-		break;
-	}
-}
-
-void
-setPQL2(int *const size, int *const ways)
-{
-	/* make sure the cpu_exthigh variable is initialized */
-	init_exthigh();
-
-	if (strcmp(cpu_vendor, "AuthenticAMD") == 0)
-		setPQL2_AMD(size, ways);
-	else if (strcmp(cpu_vendor, "GenuineIntel") == 0)
-		setPQL2_INTEL(size, ways);
-}
-
 static void
 print_transmeta_info(void)
 {

Modified: stable/7/sys/ia64/ia64/machdep.c
==============================================================================
--- stable/7/sys/ia64/ia64/machdep.c	Tue Jun 30 13:53:54 2009	(r195192)
+++ stable/7/sys/ia64/ia64/machdep.c	Tue Jun 30 14:11:43 2009	(r195193)
@@ -162,14 +162,6 @@ struct kva_md_info kmi;
 #define	Mhz	1000000L
 #define	Ghz	(1000L*Mhz)
 
-void setPQL2(int *const size, int *const ways);
-
-void
-setPQL2(int *const size, int *const ways)
-{
-	return;
-}
-
 static void
 identifycpu(void)
 {

Modified: stable/7/sys/sparc64/sparc64/identcpu.c
==============================================================================
--- stable/7/sys/sparc64/sparc64/identcpu.c	Tue Jun 30 13:53:54 2009	(r195192)
+++ stable/7/sys/sparc64/sparc64/identcpu.c	Tue Jun 30 14:11:43 2009	(r195193)
@@ -29,19 +29,6 @@ SYSCTL_STRING(_hw, HW_MODEL, model, CTLF
 
 int cpu_impl;
 
-void setPQL2(int *const size, int *const ways);
-
-void
-setPQL2(int *const size, int *const ways)
-{
-#ifdef SUN4V
-/* XXX hardcoding is lame */
-	*size = 3*1024;
-	*ways = 12;
-#endif
-	return;
-}
-
 void
 cpu_identify(u_long vers, u_int freq, u_int id)
 {



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