All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] memory: Fix 'Kill old-style I/O dispatch'
@ 2012-01-07  8:45 Andreas Färber
  2012-01-07  8:45 ` [Qemu-devel] [PATCH 1/2] memory: Fix memory_region_wrong_endianness() Andreas Färber
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Andreas Färber @ 2012-01-07  8:45 UTC (permalink / raw)
  To: qemu-devel
  Cc: Anthony Liguori, Alexander Graf, Hervé Poussineau,
	Avi Kivity, qemu-ppc, Andreas Färber

Hello,

This series fixes endianness issues in the memory core.
Apparently the actual byte swapping had not yet been tested.

Together with the BIOS MemoryRegion patch and revert of m48t59 I/O base
this restores the PReP machine to previous behavior.

Regards,
Andreas

Cc: Avi Kivity <avi@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Cc: Alexander Graf <agraf@suse.de>
Cc: Hervé Poussineau <hpoussin@reactos.org>

Andreas Färber (2):
  memory: Fix memory_region_wrong_endianness()
  memory: Fix adjust_endianness()

 memory.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

-- 
1.7.7

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

* [Qemu-devel] [PATCH 1/2] memory: Fix memory_region_wrong_endianness()
  2012-01-07  8:45 [Qemu-devel] [PATCH 0/2] memory: Fix 'Kill old-style I/O dispatch' Andreas Färber
@ 2012-01-07  8:45 ` Andreas Färber
  2012-01-07  8:45 ` [Qemu-devel] [PATCH 2/2] memory: Fix adjust_endianness() Andreas Färber
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Andreas Färber @ 2012-01-07  8:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, Andreas Färber, Avi Kivity

Since commit be675c972088eba210e18dc125613e9f205a6bfb (memory: move
endianness compensation to memory core) it was checking for
TARGET_BIG_ENDIAN instead of TARGET_WORDS_BIGENDIAN, thereby not
swapping correctly for Big Endian targets.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Avi Kivity <avi@redhat.com>
---
 memory.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/memory.c b/memory.c
index 394cbab..5e55a90 100644
--- a/memory.c
+++ b/memory.c
@@ -843,7 +843,7 @@ static void memory_region_destructor_rom_device(MemoryRegion *mr)
 
 static bool memory_region_wrong_endianness(MemoryRegion *mr)
 {
-#ifdef TARGET_BIG_ENDIAN
+#ifdef TARGET_WORDS_BIGENDIAN
     return mr->ops->endianness == DEVICE_LITTLE_ENDIAN;
 #else
     return mr->ops->endianness == DEVICE_BIG_ENDIAN;
-- 
1.7.7

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

* [Qemu-devel] [PATCH 2/2] memory: Fix adjust_endianness()
  2012-01-07  8:45 [Qemu-devel] [PATCH 0/2] memory: Fix 'Kill old-style I/O dispatch' Andreas Färber
  2012-01-07  8:45 ` [Qemu-devel] [PATCH 1/2] memory: Fix memory_region_wrong_endianness() Andreas Färber
@ 2012-01-07  8:45 ` Andreas Färber
  2012-01-07 19:46 ` [Qemu-devel] [PATCH 0/2] memory: Fix 'Kill old-style I/O dispatch' Aurelien Jarno
  2012-01-08 11:11 ` Avi Kivity
  3 siblings, 0 replies; 6+ messages in thread
From: Andreas Färber @ 2012-01-07  8:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc, Andreas Färber, Avi Kivity

Commit a621f38de85598a13d8d8524d1a94fc6a1818215 (Direct dispatch
through MemoryRegion) moved byte swaps to a central function.

Add a missing break, so that long-sized byte swaps don't abort.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Avi Kivity <avi@redhat.com>
---
 memory.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/memory.c b/memory.c
index 5e55a90..5ab2112 100644
--- a/memory.c
+++ b/memory.c
@@ -942,6 +942,7 @@ static void adjust_endianness(MemoryRegion *mr, uint64_t *data, unsigned size)
             break;
         case 4:
             *data = bswap32(*data);
+            break;
         default:
             abort();
         }
-- 
1.7.7

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

* Re: [Qemu-devel] [PATCH 0/2] memory: Fix 'Kill old-style I/O dispatch'
  2012-01-07  8:45 [Qemu-devel] [PATCH 0/2] memory: Fix 'Kill old-style I/O dispatch' Andreas Färber
  2012-01-07  8:45 ` [Qemu-devel] [PATCH 1/2] memory: Fix memory_region_wrong_endianness() Andreas Färber
  2012-01-07  8:45 ` [Qemu-devel] [PATCH 2/2] memory: Fix adjust_endianness() Andreas Färber
@ 2012-01-07 19:46 ` Aurelien Jarno
  2012-01-08 11:11 ` Avi Kivity
  3 siblings, 0 replies; 6+ messages in thread
From: Aurelien Jarno @ 2012-01-07 19:46 UTC (permalink / raw)
  To: Andreas Färber
  Cc: Anthony Liguori, qemu-devel, Alexander Graf, qemu-ppc,
	Avi Kivity, Hervé Poussineau

On Sat, Jan 07, 2012 at 09:45:13AM +0100, Andreas Färber wrote:
> Hello,
> 
> This series fixes endianness issues in the memory core.
> Apparently the actual byte swapping had not yet been tested.
> 
> Together with the BIOS MemoryRegion patch and revert of m48t59 I/O base
> this restores the PReP machine to previous behavior.

I confirm this totally break the big endian targets. At least MIPS and
PowerPC are affected.

Both patches are:

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

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

* Re: [Qemu-devel] [PATCH 0/2] memory: Fix 'Kill old-style I/O dispatch'
  2012-01-07  8:45 [Qemu-devel] [PATCH 0/2] memory: Fix 'Kill old-style I/O dispatch' Andreas Färber
                   ` (2 preceding siblings ...)
  2012-01-07 19:46 ` [Qemu-devel] [PATCH 0/2] memory: Fix 'Kill old-style I/O dispatch' Aurelien Jarno
@ 2012-01-08 11:11 ` Avi Kivity
  2012-01-08 17:13   ` Andreas Färber
  3 siblings, 1 reply; 6+ messages in thread
From: Avi Kivity @ 2012-01-08 11:11 UTC (permalink / raw)
  To: Andreas Färber
  Cc: Hervé Poussineau, Anthony Liguori, qemu-ppc, qemu-devel,
	Alexander Graf

On 01/07/2012 10:45 AM, Andreas Färber wrote:
> Hello,
>
> This series fixes endianness issues in the memory core.
> Apparently the actual byte swapping had not yet been tested.

/me hangs head.  But strangely, sparc-test, mips-test, and
ppc-virtex-ml507 (after the idstr fix) all boot for me.

> Together with the BIOS MemoryRegion patch and revert of m48t59 I/O base
> this restores the PReP machine to previous behavior.
>

Thanks, applied.

-- 
error compiling committee.c: too many arguments to function

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

* Re: [Qemu-devel] [PATCH 0/2] memory: Fix 'Kill old-style I/O dispatch'
  2012-01-08 11:11 ` Avi Kivity
@ 2012-01-08 17:13   ` Andreas Färber
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Färber @ 2012-01-08 17:13 UTC (permalink / raw)
  To: Avi Kivity
  Cc: Hervé Poussineau, Anthony Liguori, qemu-ppc, qemu-devel,
	Alexander Graf

Am 08.01.2012 12:11, schrieb Avi Kivity:
> On 01/07/2012 10:45 AM, Andreas Färber wrote:
>> This series fixes endianness issues in the memory core.
>> Apparently the actual byte swapping had not yet been tested.
> 
> /me hangs head.  But strangely, sparc-test, mips-test, and
> ppc-virtex-ml507 (after the idstr fix) all boot for me.

IIUC the byte swaps only have to happen when some MemoryRegion has an
endianness other than the target.

So when CHRP uses BE and native I/O exclusively it may work, whereas
someone once summarized PReP as "a PC with a PowerPC CPU". ;)

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

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

end of thread, other threads:[~2012-01-08 17:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-07  8:45 [Qemu-devel] [PATCH 0/2] memory: Fix 'Kill old-style I/O dispatch' Andreas Färber
2012-01-07  8:45 ` [Qemu-devel] [PATCH 1/2] memory: Fix memory_region_wrong_endianness() Andreas Färber
2012-01-07  8:45 ` [Qemu-devel] [PATCH 2/2] memory: Fix adjust_endianness() Andreas Färber
2012-01-07 19:46 ` [Qemu-devel] [PATCH 0/2] memory: Fix 'Kill old-style I/O dispatch' Aurelien Jarno
2012-01-08 11:11 ` Avi Kivity
2012-01-08 17:13   ` Andreas Färber

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.