SOLARIS: prevent BAD TRAP panic with Studio 12.5 67/12567/3
authorMark Vitale <mvitale@sinenomine.net>
Tue, 28 Feb 2017 23:02:39 +0000 (18:02 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 15 Mar 2017 18:10:27 +0000 (14:10 -0400)
commit33b5495e1b6b1da44cf3218811cc2efdff46b961
tree9236c462a8fa1369574231259d474dfe8b25e89f
parent58464339da8884bc1530e2a8e4fe4dcfeca09d81
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

[wiesand: limit change to solaris 5.11 for stable branch]

Reviewed-on: https://gerrit.openafs.org/12558
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 22d841a45fff7026318b529a41dd957ce8bb0ddf)

Change-Id: I2e87f26dbac47289694346639b396dfc556368f4
Reviewed-on: https://gerrit.openafs.org/12567
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
acinclude.m4
src/cf/osconf.m4
src/cf/solaris-test1.m4 [new file with mode: 0644]
src/libafs/MakefileProto.SOLARIS.in