On Tue, Jul 5, 2011 at 7:28 PM, Alexander Graf wrote:
> We have quite some code in hw/ that uses ld./st._phys functions
> in device emulation code. This is just pure wrong, as devices
> don't know about the CPU endianness (except for virtio), so they
> should instead use something endian specific.
>
> Unfortunately, there is no endian specific call to easily receive
> an integer from memory, so this patch set introduces some and then
> converts all the obvious users to them.
>
> I tested the targets I could, but please double-check if your
> architecture behaves differently or I accidently put in a _be
> instead of _le :)
>
> Alex
>
> Alexander Graf (9):
> exec: add endian specific phys ld/st functions
Here I'd prefer a more optimal approach. Other patches looked OK, nice cleanup.
> hpet: use specific endian ld/st_phys
> intel-hda: use specific endian ld/st_phys
> msi: use specific endian ld/st_phys
> msix: use specific endian ld/st_phys
> pl080: use specific endian ld/st_phys
> ppc405_uc: use specific endian ld/st_phys
> s390-virtio: use specific endian ld/st_phys
> spapr: use specific endian ld/st_phys
>
> cpu-common.h | 12 ++
> exec.c | 102
> ++
> hw/hpet.c | 2 +-
> hw/intel-hda.c | 21 ++
> hw/msi.c | 2 +-
> hw/msix.c | 2 +-
> hw/pl080.c | 8 ++--
> hw/ppc405_uc.c | 43 +++--
> hw/s390-virtio-bus.c | 10 ++--
> hw/s390-virtio.c | 6 +-
> hw/spapr.h | 4 +-
> hw/spapr_hcall.c | 12 +++---
> 12 files changed, 164 insertions(+), 60 deletions(-)
>
> --
> 1.7.3.4
>
>
>