[PATCH] ppc/ppc64: Compile purgatory code with gcc option -msoft-float

Vivek Goyal vgoyal at redhat.com
Fri Jun 8 10:39:49 EDT 2012

On Fri, Jun 08, 2012 at 03:48:01PM +0200, Jakub Jelinek wrote:
> On Fri, Jun 08, 2012 at 09:43:15AM -0400, Vivek Goyal wrote:
> > Recently we faced an issue on power7 machine where kernel hanged in purgatory.
> > Some investigation revealed that gcc is generating hardware FPU instructions.
> > I have been told we can't use it at this point of time and as kernel is
> > compiled with -msoft-float for ppc/ppc64, so should be purgatory (as it runs
> > inside kernel context).
> > 
> > Thanks to Jakub Jelinek and Lingzhu Xiang for debugging and coming up with
> > a fix for this issue.
> IMNSHO as a follow-up all other architectures should be changed to
> compile kernel code with the right kernel CFLAGS (e.g. -mcmodel=kernel
> -mno-sse -mno-mmx should be used probably on x86_64, etc.).

Sure. These changes can be done in separate patches.

BTW, What does -mcmodel do and why should we use -mcmodel? purgatory, is a
separate binary which we reloate at turn time based on physical memory
location. IOW, why should we make any assumptions about running location
of purgatory and pass -mcmodel flag.

Eric, would have have any objections to making use of above gcc flags
for purgatory?

> Furthermore, is there still a reason to compile sha256.c with -O0?  If
> there was a compiler bug? on ia64 6 years ago, with which gcc version
> it was, has the problem been reported and resolved?  Compiling code like
> hash computation unconditionally everywhere at -O0 must IMHO pessimize
> things unnecessarily.

git blame points to following commit for forcing -O0 on sha256. CCing
Jermey, if we can give some details why -O2 was a problem on IA6 and
if problem is still there if he has objections if we swtich back to -O2.

commit adf85cbc1756e56c1f52f56235a3c08b3c5b8e05
Author: Jeremy Kerr <jk at ozlabs.org>
Date:   Thu Dec 13 16:18:53 2007 +0900

    Build system simplification/standardisation

More information about the kexec mailing list