[1/2] powerpc/boot: Disable vector instructions

Message ID 20181010024523.4921-2-joel@jms.id.au
State Accepted
Commit e8e132e6885962582784b6fa16a80d07ea739c0f
Headers show
Series
  • powerpc/boot: Build wrapper with optimisations
Related show

Checks

Context Check Description
snowpatch_ozlabs/checkpatch success Test checkpatch on branch next
snowpatch_ozlabs/apply_patch success next/apply_patch Successfully applied

Commit Message

Joel Stanley Oct. 10, 2018, 2:45 a.m.
This will avoid auto-vectorisation when building with higher
optimisation levels.

We don't know if the machine can support VSX and even if it's present
it's probably not going to be enabled at this point in boot.

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 arch/powerpc/boot/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Michael Ellerman Oct. 10, 2018, 12:11 p.m. | #1
Joel Stanley <joel@jms.id.au> writes:

> This will avoid auto-vectorisation when building with higher
> optimisation levels.
>
> We don't know if the machine can support VSX and even if it's present
> it's probably not going to be enabled at this point in boot.
>
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
>  arch/powerpc/boot/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> index 0fb96c26136f..739ef8d43b91 100644
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -32,8 +32,8 @@ else
>  endif
>  
>  BOOTCFLAGS    := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
> -		 -fno-strict-aliasing -Os -msoft-float -pipe \
> -		 -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \
> +		 -fno-strict-aliasing -Os -msoft-float -mno-altivec -mno-vsx \

That's going to break if the compiler doesn't understand -mno-vsx isn't it?

I'm not sure if "support" a compiler that old though.

cheers
Joel Stanley Oct. 10, 2018, 9:52 p.m. | #2
On Wed, 10 Oct 2018 at 22:41, Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> Joel Stanley <joel@jms.id.au> writes:
>
> > This will avoid auto-vectorisation when building with higher
> > optimisation levels.
> >
> > We don't know if the machine can support VSX and even if it's present
> > it's probably not going to be enabled at this point in boot.
> >
> > Signed-off-by: Joel Stanley <joel@jms.id.au>
> > ---
> >  arch/powerpc/boot/Makefile | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> > index 0fb96c26136f..739ef8d43b91 100644
> > --- a/arch/powerpc/boot/Makefile
> > +++ b/arch/powerpc/boot/Makefile
> > @@ -32,8 +32,8 @@ else
> >  endif
> >
> >  BOOTCFLAGS    := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
> > -              -fno-strict-aliasing -Os -msoft-float -pipe \
> > -              -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \
> > +              -fno-strict-aliasing -Os -msoft-float -mno-altivec -mno-vsx \
>
> That's going to break if the compiler doesn't understand -mno-vsx isn't it?
>
> I'm not sure if "support" a compiler that old though.

Segher, the kernel mandates 4.6 as the minimum. Do we need to worry
about the compiler not supporting  -mno-altivec -mno-vsx?
Segher Boessenkool Oct. 10, 2018, 10:05 p.m. | #3
On Thu, Oct 11, 2018 at 08:22:54AM +1030, Joel Stanley wrote:
> On Wed, 10 Oct 2018 at 22:41, Michael Ellerman <mpe@ellerman.id.au> wrote:
> > Joel Stanley <joel@jms.id.au> writes:
> > >  BOOTCFLAGS    := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
> > > -              -fno-strict-aliasing -Os -msoft-float -pipe \
> > > -              -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \
> > > +              -fno-strict-aliasing -Os -msoft-float -mno-altivec -mno-vsx \
> >
> > That's going to break if the compiler doesn't understand -mno-vsx isn't it?
> >
> > I'm not sure if "support" a compiler that old though.
> 
> Segher, the kernel mandates 4.6 as the minimum. Do we need to worry
> about the compiler not supporting  -mno-altivec -mno-vsx?

-mvsx is gcc 4.5 and later.
https://www.gnu.org/software/gcc/gcc-4.5/changes.html

-maltivec is...  Hrm, not so easy to find...  gcc 3.1 and later it seems.
https://www.gnu.org/software/gcc/gcc-3.1/changes.html

You should be fine.


Segher
Michael Ellerman Oct. 10, 2018, 11:59 p.m. | #4
Segher Boessenkool <segher@kernel.crashing.org> writes:
> On Thu, Oct 11, 2018 at 08:22:54AM +1030, Joel Stanley wrote:
>> On Wed, 10 Oct 2018 at 22:41, Michael Ellerman <mpe@ellerman.id.au> wrote:
>> > Joel Stanley <joel@jms.id.au> writes:
>> > >  BOOTCFLAGS    := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
>> > > -              -fno-strict-aliasing -Os -msoft-float -pipe \
>> > > -              -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \
>> > > +              -fno-strict-aliasing -Os -msoft-float -mno-altivec -mno-vsx \
>> >
>> > That's going to break if the compiler doesn't understand -mno-vsx isn't it?
>> >
>> > I'm not sure if "support" a compiler that old though.
>> 
>> Segher, the kernel mandates 4.6 as the minimum. Do we need to worry
>> about the compiler not supporting  -mno-altivec -mno-vsx?
>
> -mvsx is gcc 4.5 and later.
> https://www.gnu.org/software/gcc/gcc-4.5/changes.html
>
> -maltivec is...  Hrm, not so easy to find...  gcc 3.1 and later it seems.
> https://www.gnu.org/software/gcc/gcc-3.1/changes.html

Thanks.

cheers
Michael Ellerman Oct. 15, 2018, 4:01 a.m. | #5
On Wed, 2018-10-10 at 02:45:22 UTC, Joel Stanley wrote:
> This will avoid auto-vectorisation when building with higher
> optimisation levels.
> 
> We don't know if the machine can support VSX and even if it's present
> it's probably not going to be enabled at this point in boot.
> 
> Signed-off-by: Joel Stanley <joel@jms.id.au>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/e8e132e6885962582784b6fa16a80d

cheers

Patch

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 0fb96c26136f..739ef8d43b91 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -32,8 +32,8 @@  else
 endif
 
 BOOTCFLAGS    := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-		 -fno-strict-aliasing -Os -msoft-float -pipe \
-		 -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \
+		 -fno-strict-aliasing -Os -msoft-float -mno-altivec -mno-vsx \
+		 -pipe -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \
 		 -D$(compress-y)
 
 ifdef CONFIG_PPC64_BOOT_WRAPPER