SOLARIS: prevent BAD TRAP panic with Studio 12.5
commit22d841a45fff7026318b529a41dd957ce8bb0ddf
authorMark Vitale <mvitale@sinenomine.net>
Tue, 28 Feb 2017 23:02:39 +0000 (28 18:02 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Sat, 11 Mar 2017 19:14:23 +0000 (11 14:14 -0500)
treea53930ad2f4abe68635915a8c122dbf35e4395d0
parent38a3f51fb8b3910ecdd7cacb06f35ec681990aea
SOLARIS: prevent BAD TRAP panic with Studio 12.5

Starting with Solaris Studio 12.3, it is documented that Solaris kernel
modules (such as libafs) must not use any floating point, vector, or
SIMD/SSE instructions on x86 hardware.  However, each new Studio
compiler release (12.4 and especially 12.5) is more likely to use these
types of instructions by default.

If the libafs kernel module includes any forbidden kernel instructions,
Solaris will panic the system with:
  BAD TRAP:  type=7 (#nm Device not available)

Provide a new autoconfig test to specify the required compiler options
(-xvector=%none -xregs=no%float) when building the OpenAFS kernel module
for Solaris, so that no invalid x86 instructions are used.

In addition, reinstate default kernel module optimization for Solaris.
It had been disabled in commit 80592c53cbb0bce782eb39a5e64860786654be9f
to address this same issue in Studio 12.3 and 12.4.  However, Studio
12.5 started using some SSE instructions even with no optimization.

This commit has been tested with OpenAFS master and Studio 12.5 at all
optimization levels (none, -xO1 through -xO5) and verified to contain no
XMM register instructions via the following command:
  $ gobjdump -dlr libafs64.o | grep xmm | wc -l

Change-Id: Ic3c7860f7d524162fd9178a1dab5dd223722ee43
Reviewed-on: https://gerrit.openafs.org/12558
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
acinclude.m4
src/cf/osconf.m4
src/cf/solaris-test1.m4 [new file with mode: 0644]
src/crypto/hcrypto/kernel/config.h
src/libafs/MakefileProto.SOLARIS.in