All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: qemu-devel@nongnu.org
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PATCH 02/13] Better support for dma_addr_t variables
Date: Thu, 22 Mar 2012 13:14:37 +1100	[thread overview]
Message-ID: <1332382488-12869-3-git-send-email-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <1332382488-12869-1-git-send-email-david@gibson.dropbear.id.au>

A while back, we introduced the dma_addr_t type, which is supposed to
be used for bus visible memory addresses.  At present, this is an
alias for target_phys_addr_t, but this will change when we eventually
add support for guest visible IOMMUs.

There are some instances of target_phys_addr_t in the code now which
should really be dma_addr_t, but can't be trivially converted due to
missing features which this patch corrects.

 * We add DMA_ADDR_BITS analagous to TARGET_PHYS_ADDR_BITS.  This is
   important where we need to make a compile-time (#if) based on the
   size of dma_addr_t.

 * We add a new helper macro to create device properties which take a
   dma_addr_t, currently an alias to DEFINE_PROP_TADDR().

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 dma.h         |    1 +
 hw/qdev-dma.h |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)
 create mode 100644 hw/qdev-dma.h

diff --git a/dma.h b/dma.h
index 05ac325..463095c 100644
--- a/dma.h
+++ b/dma.h
@@ -32,6 +32,7 @@ struct QEMUSGList {
 #if defined(TARGET_PHYS_ADDR_BITS)
 typedef target_phys_addr_t dma_addr_t;
 
+#define DMA_ADDR_BITS TARGET_PHYS_ADDR_BITS
 #define DMA_ADDR_FMT TARGET_FMT_plx
 
 struct ScatterGatherEntry {
diff --git a/hw/qdev-dma.h b/hw/qdev-dma.h
new file mode 100644
index 0000000..e407771
--- /dev/null
+++ b/hw/qdev-dma.h
@@ -0,0 +1,4 @@
+#include "qdev-addr.h"
+
+#define DEFINE_PROP_DMAADDR(_n, _s, _f, _d)                               \
+    DEFINE_PROP_TADDR(_n, _s, _f, _d)
-- 
1.7.9.1

  parent reply	other threads:[~2012-03-22  2:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22  2:14 [Qemu-devel] [0/13] RFC: Guest visible IOMMU David Gibson
2012-03-22  2:14 ` [Qemu-devel] [PATCH 01/13] Use DMADirection type for dma_bdrv_io David Gibson
2012-03-22  2:14 ` David Gibson [this message]
2012-03-22  2:14 ` [Qemu-devel] [PATCH 03/13] usb-xhci: Use PCI DMA helper functions David Gibson
2012-03-22 10:00   ` Gerd Hoffmann
2012-03-23  2:05     ` David Gibson
2012-03-22  2:14 ` [Qemu-devel] [PATCH 04/13] Implement cpu_physical_memory_zero() David Gibson
2012-03-22  2:14 ` [Qemu-devel] [PATCH 05/13] iommu: Add universal DMA helper functions David Gibson
2012-03-22  2:14 ` [Qemu-devel] [PATCH 06/13] usb-ohci: Use " David Gibson
2012-03-22 10:01   ` Gerd Hoffmann
2012-03-22  2:14 ` [Qemu-devel] [PATCH 07/13] iommu: Make sglists and dma_bdrv helpers use new universal DMA helpers David Gibson
2012-03-22  2:14 ` [Qemu-devel] [PATCH 08/13] ide/ahci: Use universal DMA helper functions David Gibson
2012-03-22  2:14 ` [Qemu-devel] [PATCH 09/13] usb: Convert usb_packet_{map, unmap} to universal DMA helpers David Gibson
2012-03-22  2:14 ` [Qemu-devel] [PATCH 10/13] iommu: Introduce IOMMU emulation infrastructure David Gibson
2012-03-22  2:14 ` [Qemu-devel] [PATCH 11/13] pseries: Convert sPAPR TCEs to use generic IOMMU infrastructure David Gibson
2012-03-22  2:14 ` [Qemu-devel] [PATCH 12/13] iommu: Allow PCI to use " David Gibson
2012-03-22  2:14 ` [Qemu-devel] [PATCH 13/13] pseries: Implement IOMMU and DMA for PAPR PCI devices David Gibson
2012-03-22 13:50 ` [Qemu-devel] [0/13] RFC: Guest visible IOMMU Wei Wang
2012-03-23  2:02   ` David Gibson
  -- strict thread matches above, loose matches on Subject: below --
2012-03-09  5:01 [Qemu-devel] [0/13] Implement support for guest visible IOMMUs David Gibson
2012-03-09  5:01 ` [Qemu-devel] [PATCH 02/13] Better support for dma_addr_t variables David Gibson
2012-03-09 10:00   ` Paolo Bonzini
2012-03-01  5:35 [Qemu-devel] [0/13] RFC: Support for guest-visible IOMMUs David Gibson
2012-03-01  5:35 ` [Qemu-devel] [PATCH 02/13] Better support for dma_addr_t variables David Gibson

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=1332382488-12869-3-git-send-email-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --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.