[prev in list] [next in list] [prev in thread] [next in thread]
List: qemu-ppc
Subject: [Qemu-ppc] [RFC PATCH v3 11/18] spapr_pci: Add windows counter
From: Alexey Kardashevskiy <aik () ozlabs ! ru>
Date: 2014-08-29 10:12:15
Message-ID: 1409307142-2600-12-git-send-email-aik () ozlabs ! ru
[Download RAW message or body]
We are goint to have more than one DMA window and this is going to
be dynamic. This adds a counter which will be used to get a new DMA
window LIOBN. It is set to 1 by default as window #0 is there by default.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
hw/ppc/spapr_pci.c | 5 ++++-
hw/ppc/spapr_pci_vfio.c | 2 ++
include/hw/pci-host/spapr.h | 1 +
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index ea4b1bb..2968b39 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -651,6 +651,8 @@ static void spapr_phb_finish_realize(sPAPRPHBState *sphb, Error **errp)
spapr_tce_get_iommu(tcet));
object_unref(OBJECT(tcet));
+
+ sphb->windows_num = 1;
}
static int spapr_phb_children_reset(Object *child, void *opaque)
@@ -754,7 +756,7 @@ static int spapr_pci_post_load(void *opaque, int version_id)
static const VMStateDescription vmstate_spapr_pci = {
.name = "spapr_pci",
- .version_id = 2,
+ .version_id = 3,
.minimum_version_id = 2,
.pre_save = spapr_pci_pre_save,
.post_load = spapr_pci_post_load,
@@ -770,6 +772,7 @@ static const VMStateDescription vmstate_spapr_pci = {
VMSTATE_INT32(msi_devs_num, sPAPRPHBState),
VMSTATE_STRUCT_VARRAY_ALLOC(msi_devs, sPAPRPHBState, msi_devs_num, 0,
vmstate_spapr_pci_msi, spapr_pci_msi_mig),
+ VMSTATE_UINT32_V(windows_num, sPAPRPHBState, 3),
VMSTATE_END_OF_LIST()
},
};
diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c
index 51b4314..efed23f 100644
--- a/hw/ppc/spapr_pci_vfio.c
+++ b/hw/ppc/spapr_pci_vfio.c
@@ -71,6 +71,8 @@ static void spapr_phb_vfio_finish_realize(sPAPRPHBState *sphb, Error **errp)
spapr_tce_get_iommu(tcet));
object_unref(OBJECT(tcet));
+
+ sphb->windows_num = 1;
}
static void spapr_phb_vfio_reset(DeviceState *qdev)
diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
index 6658b9c..07b60c3 100644
--- a/include/hw/pci-host/spapr.h
+++ b/include/hw/pci-host/spapr.h
@@ -91,6 +91,7 @@ struct sPAPRPHBState {
MemoryRegion memwindow, iowindow, msiwindow;
uint32_t dma_liobn;
+ uint32_t windows_num;
AddressSpace iommu_as;
MemoryRegion iommu_root;
--
2.0.0
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic