qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH qemu] spapr/rtas: Force big endian compile for rtas
@ 2019-02-01  0:40 Alexey Kardashevskiy
  2019-02-13  6:00 ` Alexey Kardashevskiy
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Kardashevskiy @ 2019-02-01  0:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexey Kardashevskiy, qemu-ppc

At the moment the rtas's Makefile uses generic QEMU rules which means
that when QEMU is compiled on a little endian system, the spapr-rtas.bin
is compiled as little endian too which is incorrect as it is always
executed in big endian mode.

This enforces -mbig by defining %.o:%.S rule as spapr-rtas.bin is
a standalone guest binary which should not depend on QEMU flags anyway.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 pc-bios/spapr-rtas/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pc-bios/spapr-rtas/Makefile b/pc-bios/spapr-rtas/Makefile
index f26dd42..4b9bb12 100644
--- a/pc-bios/spapr-rtas/Makefile
+++ b/pc-bios/spapr-rtas/Makefile
@@ -14,8 +14,11 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/spapr-rtas)
 
 build-all: spapr-rtas.bin
 
+%.o: %.S
+	$(call quiet-command,$(CCAS) -mbig -c -o $@ $<,"CCAS","$(TARGET_DIR)$@")
+
 %.img: %.o
-	$(call quiet-command,$(CC) -nostdlib -o $@ $<,"Building","$(TARGET_DIR)$@")
+	$(call quiet-command,$(CC) -nostdlib -mbig -o $@ $<,"Building","$(TARGET_DIR)$@")
 
 %.bin: %.img
 	$(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,"Building","$(TARGET_DIR)$@")
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH qemu] spapr/rtas: Force big endian compile for rtas
  2019-02-01  0:40 [Qemu-devel] [PATCH qemu] spapr/rtas: Force big endian compile for rtas Alexey Kardashevskiy
@ 2019-02-13  6:00 ` Alexey Kardashevskiy
  2019-02-14  3:30   ` David Gibson
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Kardashevskiy @ 2019-02-13  6:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc@nongnu.org, David Gibson



On 01/02/2019 11:40, Alexey Kardashevskiy wrote:
> At the moment the rtas's Makefile uses generic QEMU rules which means
> that when QEMU is compiled on a little endian system, the spapr-rtas.bin
> is compiled as little endian too which is incorrect as it is always
> executed in big endian mode.
> 
> This enforces -mbig by defining %.o:%.S rule as spapr-rtas.bin is
> a standalone guest binary which should not depend on QEMU flags anyway.

Bag? Good? Useless? :)


> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>  pc-bios/spapr-rtas/Makefile | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/pc-bios/spapr-rtas/Makefile b/pc-bios/spapr-rtas/Makefile
> index f26dd42..4b9bb12 100644
> --- a/pc-bios/spapr-rtas/Makefile
> +++ b/pc-bios/spapr-rtas/Makefile
> @@ -14,8 +14,11 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/spapr-rtas)
>  
>  build-all: spapr-rtas.bin
>  
> +%.o: %.S
> +	$(call quiet-command,$(CCAS) -mbig -c -o $@ $<,"CCAS","$(TARGET_DIR)$@")
> +
>  %.img: %.o
> -	$(call quiet-command,$(CC) -nostdlib -o $@ $<,"Building","$(TARGET_DIR)$@")
> +	$(call quiet-command,$(CC) -nostdlib -mbig -o $@ $<,"Building","$(TARGET_DIR)$@")
>  
>  %.bin: %.img
>  	$(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,"Building","$(TARGET_DIR)$@")
> 

-- 
Alexey

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH qemu] spapr/rtas: Force big endian compile for rtas
  2019-02-13  6:00 ` Alexey Kardashevskiy
@ 2019-02-14  3:30   ` David Gibson
  2019-06-12  0:29     ` Alexey Kardashevskiy
  0 siblings, 1 reply; 5+ messages in thread
From: David Gibson @ 2019-02-14  3:30 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: qemu-devel, qemu-ppc@nongnu.org

[-- Attachment #1: Type: text/plain, Size: 1765 bytes --]

On Wed, Feb 13, 2019 at 05:00:50PM +1100, Alexey Kardashevskiy wrote:
> 
> 
> On 01/02/2019 11:40, Alexey Kardashevskiy wrote:
> > At the moment the rtas's Makefile uses generic QEMU rules which means
> > that when QEMU is compiled on a little endian system, the spapr-rtas.bin
> > is compiled as little endian too which is incorrect as it is always
> > executed in big endian mode.
> > 
> > This enforces -mbig by defining %.o:%.S rule as spapr-rtas.bin is
> > a standalone guest binary which should not depend on QEMU flags anyway.
> 
> Bag? Good? Useless? :)

I missed the original send of this, I'm afraid.  Looks like a good
idea.


> 
> 
> > 
> > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > ---
> >  pc-bios/spapr-rtas/Makefile | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/pc-bios/spapr-rtas/Makefile b/pc-bios/spapr-rtas/Makefile
> > index f26dd42..4b9bb12 100644
> > --- a/pc-bios/spapr-rtas/Makefile
> > +++ b/pc-bios/spapr-rtas/Makefile
> > @@ -14,8 +14,11 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/spapr-rtas)
> >  
> >  build-all: spapr-rtas.bin
> >  
> > +%.o: %.S
> > +	$(call quiet-command,$(CCAS) -mbig -c -o $@ $<,"CCAS","$(TARGET_DIR)$@")
> > +
> >  %.img: %.o
> > -	$(call quiet-command,$(CC) -nostdlib -o $@ $<,"Building","$(TARGET_DIR)$@")
> > +	$(call quiet-command,$(CC) -nostdlib -mbig -o $@ $<,"Building","$(TARGET_DIR)$@")
> >  
> >  %.bin: %.img
> >  	$(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,"Building","$(TARGET_DIR)$@")
> > 
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH qemu] spapr/rtas: Force big endian compile for rtas
  2019-02-14  3:30   ` David Gibson
@ 2019-06-12  0:29     ` Alexey Kardashevskiy
  2019-06-12  1:06       ` David Gibson
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Kardashevskiy @ 2019-06-12  0:29 UTC (permalink / raw)
  To: David Gibson; +Cc: qemu-ppc@nongnu.org, qemu-devel



On 14/02/2019 14:30, David Gibson wrote:
> On Wed, Feb 13, 2019 at 05:00:50PM +1100, Alexey Kardashevskiy wrote:
>>
>>
>> On 01/02/2019 11:40, Alexey Kardashevskiy wrote:
>>> At the moment the rtas's Makefile uses generic QEMU rules which means
>>> that when QEMU is compiled on a little endian system, the spapr-rtas.bin
>>> is compiled as little endian too which is incorrect as it is always
>>> executed in big endian mode.
>>>
>>> This enforces -mbig by defining %.o:%.S rule as spapr-rtas.bin is
>>> a standalone guest binary which should not depend on QEMU flags anyway.
>>
>> Bag? Good? Useless? :)
> 
> I missed the original send of this, I'm afraid.  Looks like a good
> idea.

Totally forgot this one. It is still in pw:
https://patchwork.ozlabs.org/patch/1034543/

Or you want a repost?


> 
> 
>>
>>
>>>
>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>> ---
>>>  pc-bios/spapr-rtas/Makefile | 5 ++++-
>>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/pc-bios/spapr-rtas/Makefile b/pc-bios/spapr-rtas/Makefile
>>> index f26dd42..4b9bb12 100644
>>> --- a/pc-bios/spapr-rtas/Makefile
>>> +++ b/pc-bios/spapr-rtas/Makefile
>>> @@ -14,8 +14,11 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/spapr-rtas)
>>>  
>>>  build-all: spapr-rtas.bin
>>>  
>>> +%.o: %.S
>>> +	$(call quiet-command,$(CCAS) -mbig -c -o $@ $<,"CCAS","$(TARGET_DIR)$@")
>>> +
>>>  %.img: %.o
>>> -	$(call quiet-command,$(CC) -nostdlib -o $@ $<,"Building","$(TARGET_DIR)$@")
>>> +	$(call quiet-command,$(CC) -nostdlib -mbig -o $@ $<,"Building","$(TARGET_DIR)$@")
>>>  
>>>  %.bin: %.img
>>>  	$(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,"Building","$(TARGET_DIR)$@")
>>>
>>
> 

-- 
Alexey


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH qemu] spapr/rtas: Force big endian compile for rtas
  2019-06-12  0:29     ` Alexey Kardashevskiy
@ 2019-06-12  1:06       ` David Gibson
  0 siblings, 0 replies; 5+ messages in thread
From: David Gibson @ 2019-06-12  1:06 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: qemu-ppc@nongnu.org, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1158 bytes --]

On Wed, Jun 12, 2019 at 10:29:55AM +1000, Alexey Kardashevskiy wrote:
> 
> 
> On 14/02/2019 14:30, David Gibson wrote:
> > On Wed, Feb 13, 2019 at 05:00:50PM +1100, Alexey Kardashevskiy wrote:
> >>
> >>
> >> On 01/02/2019 11:40, Alexey Kardashevskiy wrote:
> >>> At the moment the rtas's Makefile uses generic QEMU rules which means
> >>> that when QEMU is compiled on a little endian system, the spapr-rtas.bin
> >>> is compiled as little endian too which is incorrect as it is always
> >>> executed in big endian mode.
> >>>
> >>> This enforces -mbig by defining %.o:%.S rule as spapr-rtas.bin is
> >>> a standalone guest binary which should not depend on QEMU flags anyway.
> >>
> >> Bag? Good? Useless? :)
> > 
> > I missed the original send of this, I'm afraid.  Looks like a good
> > idea.
> 
> Totally forgot this one. It is still in pw:
> https://patchwork.ozlabs.org/patch/1034543/
> 
> Or you want a repost?

Repost, please.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-06-12  1:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-01  0:40 [Qemu-devel] [PATCH qemu] spapr/rtas: Force big endian compile for rtas Alexey Kardashevskiy
2019-02-13  6:00 ` Alexey Kardashevskiy
2019-02-14  3:30   ` David Gibson
2019-06-12  0:29     ` Alexey Kardashevskiy
2019-06-12  1:06       ` David Gibson

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).