Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Aug 2016 21:40:32 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r304706 - projects/powernv/powerpc/aim
Message-ID:  <201608232140.u7NLeWYs077420@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Tue Aug 23 21:40:32 2016
New Revision: 304706
URL: https://svnweb.freebsd.org/changeset/base/304706

Log:
  Use the correct value of the IS selector in tlbiel when flushing the TLB.
  The way-based mechanism (IS=11) on newer CPUs can in principle cause problems
  on older ones, so use a CPU-dependent selection.

Modified:
  projects/powernv/powerpc/aim/moea64_native.c

Modified: projects/powernv/powerpc/aim/moea64_native.c
==============================================================================
--- projects/powernv/powerpc/aim/moea64_native.c	Tue Aug 23 21:34:36 2016	(r304705)
+++ projects/powernv/powerpc/aim/moea64_native.c	Tue Aug 23 21:40:32 2016	(r304706)
@@ -465,9 +465,23 @@ tlbia(void)
 	register_t msr, scratch;
 	#endif
 
+	i = 0xc00; /* IS = 11 */
+	switch (mfpvr() >> 16) {
+	case IBM970:
+	case IBM970FX:
+	case IBM970MP:
+	case IBM970GX:
+	case IBMPOWER4:
+	case IBMPOWER4PLUS:
+	case IBMPOWER5:
+	case IBMPOWER5PLUS:
+		i = 0; /* IS not supported */
+		break;
+	}
+
 	TLBSYNC();
 
-	for (i = 0x800 /* IS=10 */; i < 0xFF000; i += 0x00001000) {
+	for (; i < 0x200000; i += 0x00001000) {
 		#ifdef __powerpc64__
 		__asm __volatile("tlbiel %0" :: "r"(i));
 		#else



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