From: Andrei Borzenkov <arvidjaar@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: pfsmorigo@linux.vnet.ibm.com
Subject: Re: [PATCH] Add flags for powerpc in order to avoid exceptions
Date: Fri, 10 Oct 2014 20:43:33 +0400 [thread overview]
Message-ID: <20141010204333.6e9aa851@opensuse.site> (raw)
In-Reply-To: <20141008233827.GA7716@beren.chocolate>
В Wed, 8 Oct 2014 20:38:29 -0300
Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com> пишет:
> Mon, Sep 29, 2014 at 10:30:16PM +0400, Andrei Borzenkov wrote:
> > В Sat, 27 Sep 2014 09:06:53 +0400
> > Andrei Borzenkov <arvidjaar@gmail.com> пишет:
> >
> > > В Fri, 26 Sep 2014 16:29:40 -0300
> > > Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com> пишет:
> > >
> > > > * conf/Makefile.common [COND_powerpc_ieee1275] (CFLAGS_PLATFORM): Add
> > > > -msoft-float -mno-vsx -mno-altivec.
> > > >
> > > > Also-By: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
> > > > ---
> > > > 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 <pfsmorigo@linux.vnet.ibm.com>
> > > > +
> > > > + 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 <cjwatson@ubuntu.com>
> > > >
> > > > 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
Fine if you say so.
> * add "-msoft-float" to be completly safe.
>
Is it really necessary? I do not think grub is using floating point
anywhere.
> Something like:
>
> +if COND_powerpc_ieee1275
> + CFLAGS_PLATFORM += -mcpu=powerpc -msoft-float
> +endif
>
Should not we also add -mbig-endian here, and not in configure? This is
really something we always use, not something we need to detect
dynamically.
> 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?
>
Could you resend your patches as discussed and rebased to git master,
so they are easier to review and comment?
next prev parent reply other threads:[~2014-10-10 16:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-26 19:29 [PATCH] Add flags for powerpc in order to avoid exceptions Paulo Flabiano Smorigo
2014-09-27 5:06 ` Andrei Borzenkov
2014-09-29 18:30 ` Andrei Borzenkov
2014-10-08 23:38 ` Paulo Flabiano Smorigo
2014-10-10 16:43 ` Andrei Borzenkov [this message]
2014-11-28 19:30 ` Vladimir 'φ-coder/phcoder' Serbinenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141010204333.6e9aa851@opensuse.site \
--to=arvidjaar@gmail.com \
--cc=grub-devel@gnu.org \
--cc=pfsmorigo@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).