diff mbox series

make.rules: Compile SLOF for power5

Message ID 20220105162238.4023564-1-clg@kaod.org
State Accepted
Headers show
Series make.rules: Compile SLOF for power5 | expand

Commit Message

Cédric Le Goater Jan. 5, 2022, 4:22 p.m. UTC
By default, SLOF would implement the cpu_to_le64() helper with
the 'stdbrx' instruction which is invalid under POWER5+ and 970
CPUs. This breaks the QEMU pseries machine with such CPUs when
virtio or USB devices or in use.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 make.rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexey Kardashevskiy Jan. 7, 2022, 2:47 a.m. UTC | #1
On 06/01/2022 03:22, Cédric Le Goater wrote:
> By default, SLOF would implement the cpu_to_le64() helper with
> the 'stdbrx' instruction which is invalid under POWER5+ and 970

A nit: slof uses __builtin_bswap64() which gcc turns into stdbrx unless 
-mcpu=power5.

I'll fix this up and push out if nobody objects. Thanks,


> CPUs. This breaks the QEMU pseries machine with such CPUs when
> virtio or USB devices or in use.
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>   make.rules | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/make.rules b/make.rules
> index eeff4f4a4117..aea57fe36f1e 100644
> --- a/make.rules
> +++ b/make.rules
> @@ -76,7 +76,7 @@ WARNFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -Wformat-security -We
>   CFLAGS ?= -g -O2 -fno-builtin -ffreestanding -nostdinc -msoft-float \
>   	  -fno-strict-aliasing -mno-altivec -mabi=no-altivec \
>   	  -fno-stack-protector -fno-asynchronous-unwind-tables $(WARNFLAGS) \
> -	  -fshort-wchar
> +	  -fshort-wchar -mcpu=power5
>   
>   export CC AS LD CLEAN OBJCOPY OBJDUMP STRIP AR RANLIB CFLAGS
>
diff mbox series

Patch

diff --git a/make.rules b/make.rules
index eeff4f4a4117..aea57fe36f1e 100644
--- a/make.rules
+++ b/make.rules
@@ -76,7 +76,7 @@  WARNFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -Wformat-security -We
 CFLAGS ?= -g -O2 -fno-builtin -ffreestanding -nostdinc -msoft-float \
 	  -fno-strict-aliasing -mno-altivec -mabi=no-altivec \
 	  -fno-stack-protector -fno-asynchronous-unwind-tables $(WARNFLAGS) \
-	  -fshort-wchar
+	  -fshort-wchar -mcpu=power5
 
 export CC AS LD CLEAN OBJCOPY OBJDUMP STRIP AR RANLIB CFLAGS