[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/16] pci: Split pcie_host_mmcfg_map()
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 03/16] pci: Split pcie_host_mmcfg_map() |
Date: |
Tue, 27 Jan 2015 15:13:56 +0200 |
From: Alexander Graf <address@hidden>
The mmcfg space is a memory region that allows access to PCI config space
in the PCIe world. To maintain abstraction layers, I would like to expose
the mmcfg space as a sysbus mmio region rather than have it mapped straight
into the system's memory address space though.
So this patch splits the initialization of the mmcfg space from the actual
mapping, allowing us to only have an mmfg memory region without the map.
Signed-off-by: Alexander Graf <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Claudio Fontana <address@hidden>
---
include/hw/pci/pcie_host.h | 1 +
hw/pci/pcie_host.c | 9 +++++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/hw/pci/pcie_host.h b/include/hw/pci/pcie_host.h
index ff44ef6..4d23c80 100644
--- a/include/hw/pci/pcie_host.h
+++ b/include/hw/pci/pcie_host.h
@@ -50,6 +50,7 @@ struct PCIExpressHost {
};
void pcie_host_mmcfg_unmap(PCIExpressHost *e);
+void pcie_host_mmcfg_init(PCIExpressHost *e, uint32_t size);
void pcie_host_mmcfg_map(PCIExpressHost *e, hwaddr addr, uint32_t size);
void pcie_host_mmcfg_update(PCIExpressHost *e,
int enable,
diff --git a/hw/pci/pcie_host.c b/hw/pci/pcie_host.c
index 3db038f..dfb4a2b 100644
--- a/hw/pci/pcie_host.c
+++ b/hw/pci/pcie_host.c
@@ -98,8 +98,7 @@ void pcie_host_mmcfg_unmap(PCIExpressHost *e)
}
}
-void pcie_host_mmcfg_map(PCIExpressHost *e, hwaddr addr,
- uint32_t size)
+void pcie_host_mmcfg_init(PCIExpressHost *e, uint32_t size)
{
assert(!(size & (size - 1))); /* power of 2 */
assert(size >= PCIE_MMCFG_SIZE_MIN);
@@ -107,6 +106,12 @@ void pcie_host_mmcfg_map(PCIExpressHost *e, hwaddr addr,
e->size = size;
memory_region_init_io(&e->mmio, OBJECT(e), &pcie_mmcfg_ops, e,
"pcie-mmcfg", e->size);
+}
+
+void pcie_host_mmcfg_map(PCIExpressHost *e, hwaddr addr,
+ uint32_t size)
+{
+ pcie_host_mmcfg_init(e, size);
e->base_addr = addr;
memory_region_add_subregion(get_system_memory(), e->base_addr, &e->mmio);
}
--
MST
- [Qemu-devel] [PULL 01/16] ich9: add disable_s3, disable_s4, s4_val properties, (continued)
- [Qemu-devel] [PULL 01/16] ich9: add disable_s3, disable_s4, s4_val properties, Michael S. Tsirkin, 2015/01/27
- [Qemu-devel] [PULL 05/16] acpi-test: update expected DSDT, Michael S. Tsirkin, 2015/01/27
- [Qemu-devel] [PULL 06/16] acpi: update generated hex files, Michael S. Tsirkin, 2015/01/27
- [Qemu-devel] [PULL 04/16] pc: acpi: fix WindowsXP BSOD when memory hotplug is enabled, Michael S. Tsirkin, 2015/01/27
- [Qemu-devel] [PULL 14/16] pc: Fix DIMMs capacity calculation, Michael S. Tsirkin, 2015/01/27
- [Qemu-devel] [PULL 15/16] pc-dimm: Make pc_existing_dimms_capacity global, Michael S. Tsirkin, 2015/01/27
- [Qemu-devel] [PULL 16/16] pc-dimm: Add Error argument to pc_existing_dimms_capacity, Michael S. Tsirkin, 2015/01/27
- [Qemu-devel] [PULL 11/16] bios-linker-loader: move source to common location, Michael S. Tsirkin, 2015/01/27
- [Qemu-devel] [PULL 12/16] smbios: Fix dimm size calculation when RAM is multiple of 16GB, Michael S. Tsirkin, 2015/01/27
- [Qemu-devel] [PULL 09/16] virtio: fix feature bit checks, Michael S. Tsirkin, 2015/01/27
- [Qemu-devel] [PULL 03/16] pci: Split pcie_host_mmcfg_map(),
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 13/16] smbios: Don't report unknown CPU speed (fix SVVP regression), Michael S. Tsirkin, 2015/01/27
- [Qemu-devel] [PULL 10/16] bios-linker-loader: move header to common location, Michael S. Tsirkin, 2015/01/27
- [Qemu-devel] [PULL 07/16] acpi: build_append_nameseg(): add padding if necessary, Michael S. Tsirkin, 2015/01/27
- [Qemu-devel] [PULL 08/16] bios-tables-test: split piix4 and q35 tests, Michael S. Tsirkin, 2015/01/27
- Re: [Qemu-devel] [PULL 00/16] pci, pc, virtio fixes and cleanups, Peter Maydell, 2015/01/27