svn commit: r263464 - head/sys/powerpc/include

Justin Hibbits jhibbits at FreeBSD.org
Fri Mar 21 04:45:58 UTC 2014


Author: jhibbits
Date: Fri Mar 21 04:45:57 2014
New Revision: 263464
URL: http://svnweb.freebsd.org/changeset/base/263464

Log:
  Mask out SRR1 bits that aren't exported to the MSR.
  
  This appears to fix a strange condition with X on 32-bit PowerBooks I observed,
  caused by one of these bits getting set in the mcontext, but not set in the
  thread, which may be a symptom of another problem, more difficult to diagnose.
  Since these bits aren't exported anyway, this change makes it more explicit that
  the bits aren't MSR-related in SRR1.
  
  MFC after:	3 weeks

Modified:
  head/sys/powerpc/include/psl.h

Modified: head/sys/powerpc/include/psl.h
==============================================================================
--- head/sys/powerpc/include/psl.h	Fri Mar 21 04:33:38 2014	(r263463)
+++ head/sys/powerpc/include/psl.h	Fri Mar 21 04:45:57 2014	(r263464)
@@ -88,15 +88,17 @@
 #define PSL_KERNSET		(PSL_CE | PSL_ME | PSL_EE)
 #elif defined(BOOKE_PPC4XX)
 #define PSL_KERNSET	(PSL_CE | PSL_ME | PSL_EE | PSL_FP)
+#define PSL_SRR1_MASK	0x00000000UL	/* No mask on Book-E */
 #elif defined(AIM)
 #ifdef __powerpc64__
 #define	PSL_KERNSET	(PSL_SF | PSL_EE | PSL_ME | PSL_IR | PSL_DR | PSL_RI)
 #else
 #define	PSL_KERNSET	(PSL_EE | PSL_ME | PSL_IR | PSL_DR | PSL_RI)
 #endif
+#define PSL_SRR1_MASK	0x78300000UL	/* Bits 1-4, 10-15 (ppc32), 33-36, 42-47 (ppc64) */
 #endif
 
 #define	PSL_USERSET	(PSL_KERNSET | PSL_PR)
-#define	PSL_USERSTATIC	~(PSL_VEC | PSL_FP | PSL_FE0 | PSL_FE1)
+#define	PSL_USERSTATIC	(~(PSL_VEC | PSL_FP | PSL_FE0 | PSL_FE1) & ~PSL_SRR1_MASK)
 
 #endif	/* _MACHINE_PSL_H_ */


More information about the svn-src-head mailing list