Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Sep 2020 02:28:20 +0000 (UTC)
From:      Brandon Bergren <bdragon@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r366057 - head/sys/powerpc/powerpc
Message-ID:  <202009230228.08N2SKDR003793@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdragon
Date: Wed Sep 23 02:28:19 2020
New Revision: 366057
URL: https://svnweb.freebsd.org/changeset/base/366057

Log:
  [PowerPC64LE] Fix sleeping on POWER8.
  
  Due to enter_idle_powerx fabricating a MSR from scratch, it is necessary
  for it to care about the endianness, so we don't accidentally switch
  endian the first time we idle a thread.
  
  Took about five seconds to spot after seeing an unmangled backtrace.
  
  The hard bit was needing to temporarily set up a mutex to sort out the
  logjam that happens when every thread simultaneously wakes up in the wrong
  endian due to the panic IPI and panics, leaving what I can best describe as
  "alphabet soup" on the console.
  
  Luckily, I already had a patch sitting around to do that.
  
  This brings POWER8 up to equivilence with POWER9 on PPC64LE.
  
  Sponsored by:	Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/powerpc/cpu_subr64.S

Modified: head/sys/powerpc/powerpc/cpu_subr64.S
==============================================================================
--- head/sys/powerpc/powerpc/cpu_subr64.S	Wed Sep 23 02:17:44 2020	(r366056)
+++ head/sys/powerpc/powerpc/cpu_subr64.S	Wed Sep 23 02:28:19 2020	(r366057)
@@ -71,7 +71,11 @@ ENTRY(enter_idle_powerx)
 
 	/* Set MSR */
 	li	%r3,0
+#ifdef __LITTLE_ENDIAN__
+	ori	%r3,%r3,(PSL_ME | PSL_RI | PSL_LE)
+#else
 	ori	%r3,%r3,(PSL_ME | PSL_RI)
+#endif
 	li	%r8,0x9			/* PSL_SF and PSL_HV */
 	insrdi	%r3,%r8,4,0
 	mtsrr1	%r3



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