qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH, RFC 0/4] Byte swapping I/O memory, preview


From: Michael S. Tsirkin
Subject: [Qemu-devel] Re: [PATCH, RFC 0/4] Byte swapping I/O memory, preview
Date: Thu, 27 May 2010 17:43:45 +0300
User-agent: Mutt/1.5.19 (2009-01-05)

On Sun, May 23, 2010 at 08:34:17PM +0000, Blue Swirl wrote:
> Hi,
> 
> The overall plan is to add a new flag, IO_MEM_BSWAP, which triggers
> byte swapping inside CPU load/store functions. Convert all PCI devices
> to register their memory areas via the PCI host. Then the big endian
> PCI hosts enable IO_MEM_BSWAP for all registered regions,
> simultaneously all PCI devices stop swapping bytes. Some more PCI
> devices can probably be compiled once, though since this is not
> Generic DMA, there won't be too many.
> 
> The patches are not acceptable yet, APB part should be moved from 1/4
> to 2/4 even though it means a bit of extra work, this breaks
> bisection. Instead of PCIBus, the registration functions should take a
> PCIDevice parameter.

So if we rewrite all devices anyway, let's finally move memory
mapping for BARs out of devices and into pci.c.
As it is, memory is mapped by devices but unmapped by pci.c

> 3/4 breaks several architectures. 4/4 should
> remove byte swapping from devices. VGA is a problem because the byte
> swaps are in common functions.

Yes, VGA is hairy.

> Sparc64 almost works, other architectures show blank screen.
> 
> Anyway, I thought I'll send the patches for comments. Especially, is
> the idea of using IO_MEM_BSWAP viable?
> 
> Blue Swirl (4):
>   pci: add I/O registration functions
>   Convert PCI devices to use pci_register_memory()
>   Implement byte swapped MMIO type
>   apb: use IO_MEM_BSWAP with device registration
> 
>  cpu-common.h       |    3 +-
>  hw/apb_pci.c       |   23 ++++++++++++++++-
>  hw/cirrus_vga.c    |   12 ++++----
>  hw/e1000.c         |    2 +-
>  hw/eepro100.c      |    2 +-
>  hw/isa.h           |    1 +
>  hw/isa_mmio.c      |   18 ++++++++++++-
>  hw/lsi53c895a.c    |    4 +-
>  hw/macio.c         |   24 +++++++++---------
>  hw/msix.c          |    4 +-
>  hw/openpic.c       |    6 ++--
>  hw/pci.c           |   64 ++++++++++++++++++++++++++++-------------------
>  hw/pci.h           |    9 ++++++-
>  hw/pcnet.c         |    3 +-
>  hw/rtl8139.c       |    2 +-
>  hw/sun4u.c         |    7 ++++-
>  hw/usb-ohci.c      |    2 +-
>  hw/vga-pci.c       |    4 +-
>  hw/vmware_vga.c    |    7 ++---
>  hw/wdt_i6300esb.c  |    2 +-
>  softmmu_template.h |   69 
> ++++++++++++++++++++++++++++++++++++++++++++++------
>  21 files changed, 190 insertions(+), 78 deletions(-)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]