Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Xc0op-0002Dt-4V for mharc-grub-devel@gnu.org; Wed, 08 Oct 2014 19:38:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xc0of-0002C3-Sr for grub-devel@gnu.org; Wed, 08 Oct 2014 19:38:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xc0oY-0000n2-V5 for grub-devel@gnu.org; Wed, 08 Oct 2014 19:38:45 -0400 Received: from e24smtp02.br.ibm.com ([32.104.18.86]:54325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xc0oY-0000mj-Jb for grub-devel@gnu.org; Wed, 08 Oct 2014 19:38:38 -0400 Received: from /spool/local by e24smtp02.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 8 Oct 2014 20:38:35 -0300 Received: from d24dlp02.br.ibm.com (9.18.248.206) by e24smtp02.br.ibm.com (10.172.0.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 8 Oct 2014 20:38:34 -0300 Received: from d24relay03.br.ibm.com (d24relay03.br.ibm.com [9.13.184.25]) by d24dlp02.br.ibm.com (Postfix) with ESMTP id 6AADA1DC0051 for ; Wed, 8 Oct 2014 19:38:32 -0400 (EDT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.8.31.91]) by d24relay03.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s98NbVJv58523826 for ; Wed, 8 Oct 2014 20:37:32 -0300 Received: from d24av01.br.ibm.com (localhost [127.0.0.1]) by d24av01.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s98NcWFS024326 for ; Wed, 8 Oct 2014 20:38:32 -0300 Received: from beren.chocolate ([9.8.13.104]) by d24av01.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s98NcTQr024235 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 8 Oct 2014 20:38:31 -0300 Date: Wed, 8 Oct 2014 20:38:29 -0300 From: Paulo Flabiano Smorigo To: The development of GNU GRUB Subject: Re: [PATCH] Add flags for powerpc in order to avoid exceptions Message-ID: <20141008233827.GA7716@beren.chocolate> References: <20140926192936.GA30134@beren.chocolate> <20140927090653.062225be@opensuse.site> <20140929223016.1ebb5d7b@opensuse.site> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20140929223016.1ebb5d7b@opensuse.site> User-Agent: Mutt/1.5.22.1 (2013-10-16) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14100823-0005-0000-0000-000000B9295A X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 32.104.18.86 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Oct 2014 23:38:53 -0000 Mon, Sep 29, 2014 at 10:30:16PM +0400, Andrei Borzenkov wrote: > В Sat, 27 Sep 2014 09:06:53 +0400 > Andrei Borzenkov пишет: > > > В Fri, 26 Sep 2014 16:29:40 -0300 > > Paulo Flabiano Smorigo пишет: > > > > > * conf/Makefile.common [COND_powerpc_ieee1275] (CFLAGS_PLATFORM): Add > > > -msoft-float -mno-vsx -mno-altivec. > > > > > > Also-By: Adhemerval Zanella > > > --- > > > ChangeLog | 7 +++++++ > > > conf/Makefile.common | 3 +++ > > > 2 files changed, 10 insertions(+) > > > > > > diff --git a/ChangeLog b/ChangeLog > > > index 192e8bc..40eb90c 100644 > > > --- a/ChangeLog > > > +++ b/ChangeLog > > > @@ -1,3 +1,10 @@ > > > +2014-09-26 Paulo Flabiano Smorigo > > > + > > > + Add flags for powerpc in order to avoid exceptions > > > + > > > + * conf/Makefile.common [COND_powerpc_ieee1275] (CFLAGS_PLATFORM): Add > > > + -msoft-float -mno-vsx -mno-altivec. > > > + > > > 2014-09-25 Colin Watson > > > > > > Fix in-tree --platform=none > > > diff --git a/conf/Makefile.common b/conf/Makefile.common > > > index 51fbaf9..57c491a 100644 > > > --- a/conf/Makefile.common > > > +++ b/conf/Makefile.common > > > @@ -22,6 +22,9 @@ endif > > > if COND_arm64 > > > CFLAGS_PLATFORM += -mcmodel=large > > > endif > > > +if COND_powerpc_ieee1275 > > > + CFLAGS_PLATFORM += -msoft-float -mno-vsx -mno-altivec > > > +endif > > > > > > #FIXME: discover and check XEN headers > > > CPPFLAGS_XEN = -I/usr/include > > > > Thank you! I confirm that this patch works and does not break grub on > > earlier CPU :) > > > > There are still differences in generated code, so we probably need to > > tune some more flags. > > I looked at compiler options for PowerPC and I think instead of trying > to catch individual flags which may change with every release we should > simply force the most common platform by > > +if COND_powerpc_ieee1275 > + CFLAGS_PLATFORM += -mcpu=powerpc -mtune=powerpc > +endif > > > This makes sure result is identical on every platform and provides most > generic code that is expected to run on every(?) system. > > WDYT? Hi Andrei, Sorry to take so long to answer your question. After an internal discussion with some toolchain experts we found out that your approach is good. It works and it's more generic but we think that we should change it a little bit: * skip -mtune, not really necessary * add "-msoft-float" to be completly safe. Something like: +if COND_powerpc_ieee1275 + CFLAGS_PLATFORM += -mcpu=powerpc -msoft-float +endif This approach is similar to what the linux kernel do. In addition, they recomend to set FP MSR value to zero as well. Andrei, Vladimir, agree? > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel -- Paulo Flabiano Smorigo IBM Linux Technology Center