qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH, RFC 2/4] Convert PCI devices to use pci_registe


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH, RFC 2/4] Convert PCI devices to use pci_register_memory()
Date: Mon, 24 May 2010 15:00:49 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0

On 05/23/2010 03:34 PM, Blue Swirl wrote:
Signed-off-by: Blue Swirl<address@hidden>
---
  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/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 +-
  16 files changed, 59 insertions(+), 41 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index ba48289..52e51e0 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -3145,10 +3145,10 @@ static void cirrus_pci_lfb_map(PCIDevice *d,
int region_num,
      CirrusVGAState *s =&DO_UPCAST(PCICirrusVGAState, dev, d)->cirrus_vga;

      /* XXX: add byte swapping apertures */
-    cpu_register_physical_memory(addr, s->vga.vram_size,
-                                s->cirrus_linear_io_addr);
-    cpu_register_physical_memory(addr + 0x1000000, 0x400000,
-                                s->cirrus_linear_bitblt_io_addr);
+    pci_register_memory(d->bus, addr, s->vga.vram_size,
+                        s->cirrus_linear_io_addr);
+    pci_register_memory(d->bus, addr + 0x1000000, 0x400000,
+                        s->cirrus_linear_bitblt_io_addr);

It would probably be better to pass the PCIDevice instead of the bus. That would allow a per-device PCI IOMMU to be used (such as emulated VT-d).

Ultimately, I don't think devices should be handling their IO region mappings but I think this could be a reasonable intermediate solution.

Regards,

Anthony Liguori



reply via email to

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