All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>, qemu-devel@nongnu.org
Cc: kvm@vger.kernel.org
Subject: [PATCH v2 00/38] Memory API, batch 2: PCI devices
Date: Wed,  3 Aug 2011 14:55:30 +0300	[thread overview]
Message-ID: <1312372568-5215-1-git-send-email-avi@redhat.com> (raw)

This is a mostly mindless conversion of all QEMU PCI devices to the memory API.
After this patchset is applied, it is no longer possible to create a PCI device
using the old API.

An immediate benefit is that PCI BARs that overlap each other are now handled
correctly: currently, the sequence

  map BAR 0
  map BAR 1 at an overlapping address
  unmap either BAR 0 or BAR 1

will leave a hole where the overlap exists.  With the patchset, the memory map
is restored correctly.

Note that overlaps of PCI BARs with memory or non-PCI resources are still not
resolved correctly; this will be fixed later on.

The vga patches have ugly intermediate states; however the result is fairly clean.

This patchset should be merged after

  memory: synchronize dirty bitmap before unmapping a range
  memory: use signed arithmetic

though there's no hard dependency.

Changes from v1:
 - cmd646 type fix
 - folded a fixlet into its parent


Avi Kivity (38):
  pci: add API to get a BAR's mapped address
  vmsvga: don't remember pci BAR address in callback any more
  vga: convert vga and its derivatives to the memory API
  cirrus: simplify mmio BAR access functions
  cirrus: simplify bitblt BAR access functions
  cirrus: simplify vga window mmio access functions
  vga: simplify vga window mmio access functions
  cirrus: simplify linear framebuffer access functions
  Integrate I/O memory regions into qemu
  pci: pass I/O address space to new PCI bus
  pci: allow I/O BARs to be registered with pci_register_bar_region()
  rtl8139: convert to memory API
  ac97: convert to memory API
  e1000: convert to memory API
  eepro100: convert to memory API
  es1370: convert to memory API
  ide: convert to memory API
  ivshmem: convert to memory API
  virtio-pci: convert to memory API
  ahci: convert to memory API
  intel-hda: convert to memory API
  lsi53c895a: convert to memory API
  ppc: convert to memory API
  ne2000: convert to memory API
  pcnet: convert to memory API
  i6300esb: convert to memory API
  isa-mmio: concert to memory API
  sun4u: convert to memory API
  ehci: convert to memory API
  uhci: convert to memory API
  xen-platform: convert to memory API
  msix: convert to memory API
  pci: remove pci_register_bar_simple()
  pci: convert pci rom to memory API
  pci: remove pci_register_bar()
  pci: fold BAR mapping function into its caller
  pci: rename pci_register_bar_region() to pci_register_bar()
  pci: remove support for pre memory API BARs

 exec-memory.h      |    2 +
 exec.c             |   10 ++
 hw/ac97.c          |   88 ++++++-----
 hw/apb_pci.c       |    1 +
 hw/bonito.c        |    1 +
 hw/cirrus_vga.c    |  458 ++++++++++++++++-----------------------------------
 hw/cuda.c          |    6 +-
 hw/e1000.c         |  113 ++++++--------
 hw/eepro100.c      |  181 ++++-----------------
 hw/es1370.c        |   43 +++--
 hw/escc.c          |   42 +++---
 hw/escc.h          |    2 +-
 hw/grackle_pci.c   |    8 +-
 hw/gt64xxx.c       |    4 +-
 hw/heathrow_pic.c  |   29 ++--
 hw/ide.h           |    2 +-
 hw/ide/ahci.c      |   31 ++--
 hw/ide/ahci.h      |    2 +-
 hw/ide/cmd646.c    |  204 +++++++++++++++---------
 hw/ide/ich.c       |    3 +-
 hw/ide/macio.c     |   36 +++--
 hw/ide/pci.c       |   25 ++--
 hw/ide/pci.h       |   19 ++-
 hw/ide/piix.c      |   63 ++++++--
 hw/ide/via.c       |   64 ++++++--
 hw/intel-hda.c     |   35 +++--
 hw/isa.h           |    2 +
 hw/isa_mmio.c      |   30 ++--
 hw/ivshmem.c       |  158 +++++++------------
 hw/lance.c         |   31 ++--
 hw/lsi53c895a.c    |  257 +++++++-----------------------
 hw/mac_dbdma.c     |   32 ++--
 hw/mac_dbdma.h     |    4 +-
 hw/mac_nvram.c     |   39 ++---
 hw/macio.c         |   73 ++++-----
 hw/msix.c          |   64 +++-----
 hw/msix.h          |    6 +-
 hw/ne2000-isa.c    |   14 +--
 hw/ne2000.c        |   77 ++++++---
 hw/ne2000.h        |    8 +-
 hw/openpic.c       |   81 +++++-----
 hw/openpic.h       |    2 +-
 hw/pc.h            |    4 +-
 hw/pc_piix.c       |    6 +-
 hw/pci.c           |  133 +++++-----------
 hw/pci.h           |   26 ++--
 hw/pci_internals.h |    3 +-
 hw/pcnet-pci.c     |   74 +++++----
 hw/pcnet.h         |    4 +-
 hw/piix_pci.c      |   14 +-
 hw/ppc4xx_pci.c    |    1 +
 hw/ppc_mac.h       |   27 ++--
 hw/ppc_newworld.c  |   34 ++--
 hw/ppc_oldworld.c  |   27 ++--
 hw/ppc_prep.c      |    2 +-
 hw/ppce500_pci.c   |    7 +-
 hw/prep_pci.c      |    8 +-
 hw/prep_pci.h      |    4 +-
 hw/qxl-render.c    |    2 +-
 hw/qxl.c           |  129 ++++++----------
 hw/qxl.h           |    6 +-
 hw/rtl8139.c       |   70 ++++----
 hw/sh_pci.c        |    4 +-
 hw/sun4u.c         |   53 +++----
 hw/unin_pci.c      |   16 ++-
 hw/usb-ehci.c      |   36 +---
 hw/usb-ohci.c      |    2 +-
 hw/usb-uhci.c      |   41 +++--
 hw/versatile_pci.c |    2 +-
 hw/vga-isa-mm.c    |   45 ++++--
 hw/vga-isa.c       |   11 +-
 hw/vga-pci.c       |   27 +---
 hw/vga.c           |  179 ++++++++-------------
 hw/vga_int.h       |   18 +--
 hw/virtio-pci.c    |   89 +++++------
 hw/virtio-pci.h    |    3 +-
 hw/vmware_vga.c    |  153 +++++++++---------
 hw/wdt_i6300esb.c  |   43 ++++--
 hw/xen_platform.c  |   83 ++++++----
 79 files changed, 1654 insertions(+), 2082 deletions(-)

-- 
1.7.5.3


WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>, qemu-devel@nongnu.org
Cc: kvm@vger.kernel.org
Subject: [Qemu-devel] [PATCH v2 00/38] Memory API, batch 2: PCI devices
Date: Wed,  3 Aug 2011 14:55:30 +0300	[thread overview]
Message-ID: <1312372568-5215-1-git-send-email-avi@redhat.com> (raw)

This is a mostly mindless conversion of all QEMU PCI devices to the memory API.
After this patchset is applied, it is no longer possible to create a PCI device
using the old API.

An immediate benefit is that PCI BARs that overlap each other are now handled
correctly: currently, the sequence

  map BAR 0
  map BAR 1 at an overlapping address
  unmap either BAR 0 or BAR 1

will leave a hole where the overlap exists.  With the patchset, the memory map
is restored correctly.

Note that overlaps of PCI BARs with memory or non-PCI resources are still not
resolved correctly; this will be fixed later on.

The vga patches have ugly intermediate states; however the result is fairly clean.

This patchset should be merged after

  memory: synchronize dirty bitmap before unmapping a range
  memory: use signed arithmetic

though there's no hard dependency.

Changes from v1:
 - cmd646 type fix
 - folded a fixlet into its parent


Avi Kivity (38):
  pci: add API to get a BAR's mapped address
  vmsvga: don't remember pci BAR address in callback any more
  vga: convert vga and its derivatives to the memory API
  cirrus: simplify mmio BAR access functions
  cirrus: simplify bitblt BAR access functions
  cirrus: simplify vga window mmio access functions
  vga: simplify vga window mmio access functions
  cirrus: simplify linear framebuffer access functions
  Integrate I/O memory regions into qemu
  pci: pass I/O address space to new PCI bus
  pci: allow I/O BARs to be registered with pci_register_bar_region()
  rtl8139: convert to memory API
  ac97: convert to memory API
  e1000: convert to memory API
  eepro100: convert to memory API
  es1370: convert to memory API
  ide: convert to memory API
  ivshmem: convert to memory API
  virtio-pci: convert to memory API
  ahci: convert to memory API
  intel-hda: convert to memory API
  lsi53c895a: convert to memory API
  ppc: convert to memory API
  ne2000: convert to memory API
  pcnet: convert to memory API
  i6300esb: convert to memory API
  isa-mmio: concert to memory API
  sun4u: convert to memory API
  ehci: convert to memory API
  uhci: convert to memory API
  xen-platform: convert to memory API
  msix: convert to memory API
  pci: remove pci_register_bar_simple()
  pci: convert pci rom to memory API
  pci: remove pci_register_bar()
  pci: fold BAR mapping function into its caller
  pci: rename pci_register_bar_region() to pci_register_bar()
  pci: remove support for pre memory API BARs

 exec-memory.h      |    2 +
 exec.c             |   10 ++
 hw/ac97.c          |   88 ++++++-----
 hw/apb_pci.c       |    1 +
 hw/bonito.c        |    1 +
 hw/cirrus_vga.c    |  458 ++++++++++++++++-----------------------------------
 hw/cuda.c          |    6 +-
 hw/e1000.c         |  113 ++++++--------
 hw/eepro100.c      |  181 ++++-----------------
 hw/es1370.c        |   43 +++--
 hw/escc.c          |   42 +++---
 hw/escc.h          |    2 +-
 hw/grackle_pci.c   |    8 +-
 hw/gt64xxx.c       |    4 +-
 hw/heathrow_pic.c  |   29 ++--
 hw/ide.h           |    2 +-
 hw/ide/ahci.c      |   31 ++--
 hw/ide/ahci.h      |    2 +-
 hw/ide/cmd646.c    |  204 +++++++++++++++---------
 hw/ide/ich.c       |    3 +-
 hw/ide/macio.c     |   36 +++--
 hw/ide/pci.c       |   25 ++--
 hw/ide/pci.h       |   19 ++-
 hw/ide/piix.c      |   63 ++++++--
 hw/ide/via.c       |   64 ++++++--
 hw/intel-hda.c     |   35 +++--
 hw/isa.h           |    2 +
 hw/isa_mmio.c      |   30 ++--
 hw/ivshmem.c       |  158 +++++++------------
 hw/lance.c         |   31 ++--
 hw/lsi53c895a.c    |  257 +++++++-----------------------
 hw/mac_dbdma.c     |   32 ++--
 hw/mac_dbdma.h     |    4 +-
 hw/mac_nvram.c     |   39 ++---
 hw/macio.c         |   73 ++++-----
 hw/msix.c          |   64 +++-----
 hw/msix.h          |    6 +-
 hw/ne2000-isa.c    |   14 +--
 hw/ne2000.c        |   77 ++++++---
 hw/ne2000.h        |    8 +-
 hw/openpic.c       |   81 +++++-----
 hw/openpic.h       |    2 +-
 hw/pc.h            |    4 +-
 hw/pc_piix.c       |    6 +-
 hw/pci.c           |  133 +++++-----------
 hw/pci.h           |   26 ++--
 hw/pci_internals.h |    3 +-
 hw/pcnet-pci.c     |   74 +++++----
 hw/pcnet.h         |    4 +-
 hw/piix_pci.c      |   14 +-
 hw/ppc4xx_pci.c    |    1 +
 hw/ppc_mac.h       |   27 ++--
 hw/ppc_newworld.c  |   34 ++--
 hw/ppc_oldworld.c  |   27 ++--
 hw/ppc_prep.c      |    2 +-
 hw/ppce500_pci.c   |    7 +-
 hw/prep_pci.c      |    8 +-
 hw/prep_pci.h      |    4 +-
 hw/qxl-render.c    |    2 +-
 hw/qxl.c           |  129 ++++++----------
 hw/qxl.h           |    6 +-
 hw/rtl8139.c       |   70 ++++----
 hw/sh_pci.c        |    4 +-
 hw/sun4u.c         |   53 +++----
 hw/unin_pci.c      |   16 ++-
 hw/usb-ehci.c      |   36 +---
 hw/usb-ohci.c      |    2 +-
 hw/usb-uhci.c      |   41 +++--
 hw/versatile_pci.c |    2 +-
 hw/vga-isa-mm.c    |   45 ++++--
 hw/vga-isa.c       |   11 +-
 hw/vga-pci.c       |   27 +---
 hw/vga.c           |  179 ++++++++-------------
 hw/vga_int.h       |   18 +--
 hw/virtio-pci.c    |   89 +++++------
 hw/virtio-pci.h    |    3 +-
 hw/vmware_vga.c    |  153 +++++++++---------
 hw/wdt_i6300esb.c  |   43 ++++--
 hw/xen_platform.c  |   83 ++++++----
 79 files changed, 1654 insertions(+), 2082 deletions(-)

-- 
1.7.5.3

             reply	other threads:[~2011-08-03 11:56 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03 11:55 Avi Kivity [this message]
2011-08-03 11:55 ` [Qemu-devel] [PATCH v2 00/38] Memory API, batch 2: PCI devices Avi Kivity
2011-08-03 11:55 ` [PATCH v2 01/38] pci: add API to get a BAR's mapped address Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 02/38] vmsvga: don't remember pci BAR address in callback any more Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 03/38] vga: convert vga and its derivatives to the memory API Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 04/38] cirrus: simplify mmio BAR access functions Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 05/38] cirrus: simplify bitblt " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 06/38] cirrus: simplify vga window mmio " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 07/38] vga: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 08/38] cirrus: simplify linear framebuffer " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 09/38] Integrate I/O memory regions into qemu Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 10/38] pci: pass I/O address space to new PCI bus Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 11/38] pci: allow I/O BARs to be registered with pci_register_bar_region() Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 12/38] rtl8139: convert to memory API Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 13/38] ac97: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 14/38] e1000: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 15/38] eepro100: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 16/38] es1370: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 17/38] ide: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 18/38] ivshmem: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 19/38] virtio-pci: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 20/38] ahci: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 21/38] intel-hda: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 22/38] lsi53c895a: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 23/38] ppc: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 24/38] ne2000: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 25/38] pcnet: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 26/38] i6300esb: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 27/38] isa-mmio: concert " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 28/38] sun4u: convert " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:55 ` [PATCH v2 29/38] ehci: " Avi Kivity
2011-08-03 11:55   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:56 ` [PATCH v2 30/38] uhci: " Avi Kivity
2011-08-03 11:56   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:56 ` [PATCH v2 31/38] xen-platform: " Avi Kivity
2011-08-03 11:56   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:56 ` [PATCH v2 32/38] msix: " Avi Kivity
2011-08-03 11:56   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:56 ` [PATCH v2 33/38] pci: remove pci_register_bar_simple() Avi Kivity
2011-08-03 11:56   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:56 ` [PATCH v2 34/38] pci: convert pci rom to memory API Avi Kivity
2011-08-03 11:56   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:56 ` [PATCH v2 35/38] pci: remove pci_register_bar() Avi Kivity
2011-08-03 11:56   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:56 ` [PATCH v2 36/38] pci: fold BAR mapping function into its caller Avi Kivity
2011-08-03 11:56   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:56 ` [PATCH v2 37/38] pci: rename pci_register_bar_region() to pci_register_bar() Avi Kivity
2011-08-03 11:56   ` [Qemu-devel] " Avi Kivity
2011-08-03 11:56 ` [PATCH v2 38/38] pci: remove support for pre memory API BARs Avi Kivity
2011-08-03 11:56   ` [Qemu-devel] " Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1312372568-5215-1-git-send-email-avi@redhat.com \
    --to=avi@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.