[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/10] spapr_pci: Define default DMA window size as
From: |
Alexey Kardashevskiy |
Subject: |
[Qemu-devel] [PATCH 05/10] spapr_pci: Define default DMA window size as a macro |
Date: |
Mon, 23 Feb 2015 19:33:55 +1100 |
This gets rid of a magic constant describing the default DMA window size
for an emulated PHB.
Signed-off-by: Alexey Kardashevskiy <address@hidden>
---
hw/ppc/spapr_pci.c | 6 +++---
include/hw/pci-host/spapr.h | 2 ++
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 388fd53..130c532 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -641,11 +641,11 @@ static void spapr_phb_realize(DeviceState *dev, Error
**errp)
static void spapr_phb_finish_realize(sPAPRPHBState *sphb, Error **errp)
{
sPAPRTCETable *tcet;
+ uint32_t nb_table;
+ nb_table = SPAPR_PCI_DMA32_SIZE >> SPAPR_TCE_PAGE_SHIFT;
tcet = spapr_tce_new_table(DEVICE(sphb), sphb->dma_liobn,
- 0,
- SPAPR_TCE_PAGE_SHIFT,
- 0x40000000 >> SPAPR_TCE_PAGE_SHIFT, false);
+ 0, SPAPR_TCE_PAGE_SHIFT, nb_table, false);
if (!tcet) {
error_setg(errp, "Unable to create TCE table for %s",
sphb->dtbusname);
diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
index d725f0e..718bf59 100644
--- a/include/hw/pci-host/spapr.h
+++ b/include/hw/pci-host/spapr.h
@@ -110,6 +110,8 @@ struct sPAPRPHBVFIOState {
#define SPAPR_PCI_MSI_WINDOW 0x40000000000ULL
+#define SPAPR_PCI_DMA32_SIZE 0x40000000
+
static inline qemu_irq spapr_phb_lsi_qirq(struct sPAPRPHBState *phb, int pin)
{
return xics_get_qirq(spapr->icp, phb->lsi_table[pin].irq);
--
2.0.0
- [Qemu-devel] [PATCH 02/10] spapr_iommu: Make H_PUT_TCE_INDIRECT endian-safe, (continued)
- [Qemu-devel] [PATCH 02/10] spapr_iommu: Make H_PUT_TCE_INDIRECT endian-safe, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 04/10] spapr_vio: Introduce a liobn number generating macros, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 01/10] spapr_iommu: Disable in-kernel IOMMU tables for >4GB windows, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 03/10] spapr_pci: Introduce a liobn number generating macros, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 08/10] spapr_iommu: Make spapr_tce_find_by_liobn() public, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 07/10] spapr_pci: Make find_phb()/find_dev() public, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 06/10] spapr_iommu: Add separate trace points for PCI DMA operations, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 09/10] spapr_pci: Rework device-tree rendering, Alexey Kardashevskiy, 2015/02/23
- [Qemu-devel] [PATCH 05/10] spapr_pci: Define default DMA window size as a macro,
Alexey Kardashevskiy <=
- [Qemu-devel] [PATCH 10/10] spapr_iommu: Give unique QOM name to TCE table, Alexey Kardashevskiy, 2015/02/23