[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/25] pcie: pass pcie window size to pcie_host_mmcf
From: |
Jason Baron |
Subject: |
[Qemu-devel] [PATCH 09/25] pcie: pass pcie window size to pcie_host_mmcfg_update() |
Date: |
Thu, 13 Sep 2012 16:12:41 -0400 |
This allows q35 to pass/set the size of the pcie window in its update routine.
Signed-off-by: Jason Baron <address@hidden>
---
hw/pcie_host.c | 21 ++++++++++++---------
hw/pcie_host.h | 8 +++++---
2 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/hw/pcie_host.c b/hw/pcie_host.c
index 28bbe72..e2fd276 100644
--- a/hw/pcie_host.c
+++ b/hw/pcie_host.c
@@ -107,14 +107,9 @@ static const MemoryRegionOps pcie_mmcfg_ops = {
/* pcie_host::base_addr == PCIE_BASE_ADDR_UNMAPPED when it isn't mapped. */
#define PCIE_BASE_ADDR_UNMAPPED ((target_phys_addr_t)-1ULL)
-int pcie_host_init(PCIExpressHost *e, uint32_t size)
+int pcie_host_init(PCIExpressHost *e)
{
- assert(!(size & (size - 1))); /* power of 2 */
- assert(size >= PCIE_MMCFG_SIZE_MIN);
- assert(size <= PCIE_MMCFG_SIZE_MAX);
e->base_addr = PCIE_BASE_ADDR_UNMAPPED;
- e->size = size;
- memory_region_init_io(&e->mmio, &pcie_mmcfg_ops, e, "pcie-mmcfg", e->size);
return 0;
}
@@ -123,22 +118,30 @@ void pcie_host_mmcfg_unmap(PCIExpressHost *e)
{
if (e->base_addr != PCIE_BASE_ADDR_UNMAPPED) {
memory_region_del_subregion(get_system_memory(), &e->mmio);
+ memory_region_destroy(&e->mmio);
e->base_addr = PCIE_BASE_ADDR_UNMAPPED;
}
}
-void pcie_host_mmcfg_map(PCIExpressHost *e, target_phys_addr_t addr)
+void pcie_host_mmcfg_map(PCIExpressHost *e, target_phys_addr_t addr,
+ uint32_t size)
{
+ assert(!(size & (size - 1))); /* power of 2 */
+ assert(size >= PCIE_MMCFG_SIZE_MIN);
+ assert(size <= PCIE_MMCFG_SIZE_MAX);
+ e->size = size;
+ memory_region_init_io(&e->mmio, &pcie_mmcfg_ops, e, "pcie-mmcfg", e->size);
e->base_addr = addr;
memory_region_add_subregion(get_system_memory(), e->base_addr, &e->mmio);
}
void pcie_host_mmcfg_update(PCIExpressHost *e,
int enable,
- target_phys_addr_t addr)
+ target_phys_addr_t addr,
+ uint32_t size)
{
pcie_host_mmcfg_unmap(e);
if (enable) {
- pcie_host_mmcfg_map(e, addr);
+ pcie_host_mmcfg_map(e, addr, size);
}
}
diff --git a/hw/pcie_host.h b/hw/pcie_host.h
index 0074508..2faa54e 100644
--- a/hw/pcie_host.h
+++ b/hw/pcie_host.h
@@ -39,11 +39,13 @@ struct PCIExpressHost {
MemoryRegion mmio;
};
-int pcie_host_init(PCIExpressHost *e, uint32_t size);
+int pcie_host_init(PCIExpressHost *e);
void pcie_host_mmcfg_unmap(PCIExpressHost *e);
-void pcie_host_mmcfg_map(PCIExpressHost *e, target_phys_addr_t addr);
+void pcie_host_mmcfg_map(PCIExpressHost *e, target_phys_addr_t addr,
+ uint32_t size);
void pcie_host_mmcfg_update(PCIExpressHost *e,
int enable,
- target_phys_addr_t addr);
+ target_phys_addr_t addr,
+ uint32_t size);
#endif /* PCIE_HOST_H */
--
1.7.1
- [Qemu-devel] [PATCH 00/25] q35 series take #1, Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 02/25] pci: add opaque argument to pci_map_irq_fn, Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 08/25] pci_ids: add intel 82801BA pci-to-pci bridge id and PCI_CLASS_SERIAL_SMBUS, Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 07/25] pc/piix_pci: factor out smram/pam logic, Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 10/25] pcie: Convert PCIExpressHost to use the QOM., Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 06/25] pc: Move ioapic_init() from pc_piix.c to pc.c, Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 13/25] q35: Suppress SMM BIOS initialization under KVM, Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 03/25] pci: introduce pci_swizzle_map_irq_fn() for standardized interrupt pin swizzle, Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 04/25] ahci: add ide device initialization helper, Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 15/25] q35: smbus: Remove PCI_STATUS_SIG_SYSTEM_ERROR and PCI_STATUS_DETECTED_PARITY from w1cmask, Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 09/25] pcie: pass pcie window size to pcie_host_mmcfg_update(),
Jason Baron <=
- [Qemu-devel] [PATCH 17/25] q35: Add kvmclock support, Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 14/25] q35: Fix non-PCI IRQ processing in ich9_lpc_update_apic, Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 20/25] pcie: drop version_id field for live migration, Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 25/25] q35: automatically load the q35 dsdt table, Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 22/25] ahci: properly reset PxCMD on HBA reset, Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 01/25] pci: pci capability must be in PCI space, Jason Baron, 2012/09/13
- [Qemu-devel] [PATCH 05/25] pc, pc_piix: split out pc nic initialization, Jason Baron, 2012/09/13