qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-1.6] fw_cfg: the I/O port variant expects little-endian
@ 2013-07-28 12:35 Paolo Bonzini
  2013-07-29 11:44 ` Mark Cave-Ayland
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Paolo Bonzini @ 2013-07-28 12:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: Mark Cave-Ayland

The I/O port variant of fw_cfg is used by sparc64, which is a big-endian machine.
Firmware swaps bytes before sending them to fw_cfg, so we need to unswap them in
the device.

This is only used on sparc64 and on (little-endian) x86, so it does not affect
any other target.  32-bit Sparc and PPC all use memory-mapped fw_cfg.

Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/nvram/fw_cfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 0a35015..d0820e5 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -324,7 +324,7 @@ static const MemoryRegionOps fw_cfg_data_mem_ops = {
 static const MemoryRegionOps fw_cfg_comb_mem_ops = {
     .read = fw_cfg_comb_read,
     .write = fw_cfg_comb_write,
-    .endianness = DEVICE_NATIVE_ENDIAN,
+    .endianness = DEVICE_LITTLE_ENDIAN,
     .valid.accepts = fw_cfg_comb_valid,
 };
 
-- 
1.8.1.4

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

* Re: [Qemu-devel] [PATCH for-1.6] fw_cfg: the I/O port variant expects little-endian
  2013-07-28 12:35 [Qemu-devel] [PATCH for-1.6] fw_cfg: the I/O port variant expects little-endian Paolo Bonzini
@ 2013-07-29 11:44 ` Mark Cave-Ayland
  2013-08-05 16:21 ` [Qemu-devel] PING for-1.6 " Paolo Bonzini
  2013-08-14 16:29 ` [Qemu-devel] " Anthony Liguori
  2 siblings, 0 replies; 5+ messages in thread
From: Mark Cave-Ayland @ 2013-07-29 11:44 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On 28/07/13 13:35, Paolo Bonzini wrote:

> The I/O port variant of fw_cfg is used by sparc64, which is a big-endian machine.
> Firmware swaps bytes before sending them to fw_cfg, so we need to unswap them in
> the device.
>
> This is only used on sparc64 and on (little-endian) x86, so it does not affect
> any other target.  32-bit Sparc and PPC all use memory-mapped fw_cfg.
>
> Reported-by: Mark Cave-Ayland<mark.cave-ayland@ilande.co.uk>
> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
> ---
>   hw/nvram/fw_cfg.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 0a35015..d0820e5 100644
> --- a/hw/nvram/fw_cfg.c
> +++ b/hw/nvram/fw_cfg.c
> @@ -324,7 +324,7 @@ static const MemoryRegionOps fw_cfg_data_mem_ops = {
>   static const MemoryRegionOps fw_cfg_comb_mem_ops = {
>       .read = fw_cfg_comb_read,
>       .write = fw_cfg_comb_write,
> -    .endianness = DEVICE_NATIVE_ENDIAN,
> +    .endianness = DEVICE_LITTLE_ENDIAN,
>       .valid.accepts = fw_cfg_comb_valid,
>   };

Hi Paolo,

I can confirm that this fixes SPARC64 boot for me - thanks!

Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>


ATB,

Mark.

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

* [Qemu-devel] PING for-1.6 Re: [PATCH for-1.6] fw_cfg: the I/O port variant expects little-endian
  2013-07-28 12:35 [Qemu-devel] [PATCH for-1.6] fw_cfg: the I/O port variant expects little-endian Paolo Bonzini
  2013-07-29 11:44 ` Mark Cave-Ayland
@ 2013-08-05 16:21 ` Paolo Bonzini
  2013-08-05 17:19   ` Laszlo Ersek
  2013-08-14 16:29 ` [Qemu-devel] " Anthony Liguori
  2 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2013-08-05 16:21 UTC (permalink / raw)
  Cc: Mark Cave-Ayland, qemu-devel

On 07/28/2013 02:35 PM, Paolo Bonzini wrote:
> The I/O port variant of fw_cfg is used by sparc64, which is a big-endian machine.
> Firmware swaps bytes before sending them to fw_cfg, so we need to unswap them in
> the device.
>
> This is only used on sparc64 and on (little-endian) x86, so it does not affect
> any other target.  32-bit Sparc and PPC all use memory-mapped fw_cfg.
>
> Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   hw/nvram/fw_cfg.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 0a35015..d0820e5 100644
> --- a/hw/nvram/fw_cfg.c
> +++ b/hw/nvram/fw_cfg.c
> @@ -324,7 +324,7 @@ static const MemoryRegionOps fw_cfg_data_mem_ops = {
>   static const MemoryRegionOps fw_cfg_comb_mem_ops = {
>       .read = fw_cfg_comb_read,
>       .write = fw_cfg_comb_write,
> -    .endianness = DEVICE_NATIVE_ENDIAN,
> +    .endianness = DEVICE_LITTLE_ENDIAN,
>       .valid.accepts = fw_cfg_comb_valid,
>   };
>
>

Ping.

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

* Re: [Qemu-devel] PING for-1.6 Re: [PATCH for-1.6] fw_cfg: the I/O port variant expects little-endian
  2013-08-05 16:21 ` [Qemu-devel] PING for-1.6 " Paolo Bonzini
@ 2013-08-05 17:19   ` Laszlo Ersek
  0 siblings, 0 replies; 5+ messages in thread
From: Laszlo Ersek @ 2013-08-05 17:19 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Mark Cave-Ayland, qemu-devel

On 08/05/13 18:21, Paolo Bonzini wrote:
> On 07/28/2013 02:35 PM, Paolo Bonzini wrote:
>> The I/O port variant of fw_cfg is used by sparc64, which is a
>> big-endian machine.
>> Firmware swaps bytes before sending them to fw_cfg, so we need to
>> unswap them in
>> the device.
>>
>> This is only used on sparc64 and on (little-endian) x86, so it does
>> not affect
>> any other target.  32-bit Sparc and PPC all use memory-mapped fw_cfg.
>>
>> Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>   hw/nvram/fw_cfg.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
>> index 0a35015..d0820e5 100644
>> --- a/hw/nvram/fw_cfg.c
>> +++ b/hw/nvram/fw_cfg.c
>> @@ -324,7 +324,7 @@ static const MemoryRegionOps fw_cfg_data_mem_ops = {
>>   static const MemoryRegionOps fw_cfg_comb_mem_ops = {
>>       .read = fw_cfg_comb_read,
>>       .write = fw_cfg_comb_write,
>> -    .endianness = DEVICE_NATIVE_ENDIAN,
>> +    .endianness = DEVICE_LITTLE_ENDIAN,
>>       .valid.accepts = fw_cfg_comb_valid,
>>   };
>>
>>
> 
> Ping.
> 

Not sure if you were asking for a review, but the patch and the argument
in the commit msg look sane to me.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

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

* Re: [Qemu-devel] [PATCH for-1.6] fw_cfg: the I/O port variant expects little-endian
  2013-07-28 12:35 [Qemu-devel] [PATCH for-1.6] fw_cfg: the I/O port variant expects little-endian Paolo Bonzini
  2013-07-29 11:44 ` Mark Cave-Ayland
  2013-08-05 16:21 ` [Qemu-devel] PING for-1.6 " Paolo Bonzini
@ 2013-08-14 16:29 ` Anthony Liguori
  2 siblings, 0 replies; 5+ messages in thread
From: Anthony Liguori @ 2013-08-14 16:29 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: Mark Cave-Ayland

Applied.  Thanks.

Regards,

Anthony Liguori

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

end of thread, other threads:[~2013-08-14 16:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-28 12:35 [Qemu-devel] [PATCH for-1.6] fw_cfg: the I/O port variant expects little-endian Paolo Bonzini
2013-07-29 11:44 ` Mark Cave-Ayland
2013-08-05 16:21 ` [Qemu-devel] PING for-1.6 " Paolo Bonzini
2013-08-05 17:19   ` Laszlo Ersek
2013-08-14 16:29 ` [Qemu-devel] " Anthony Liguori

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