[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/4] pci: Split pcie_host_mmcfg_map()
From: |
Claudio Fontana |
Subject: |
Re: [Qemu-devel] [PATCH 1/4] pci: Split pcie_host_mmcfg_map() |
Date: |
Mon, 12 Jan 2015 17:28:04 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 |
On 06.01.2015 17:03, Alexander Graf wrote:
> 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>
> ---
> hw/pci/pcie_host.c | 9 +++++++--
> include/hw/pci/pcie_host.h | 1 +
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> 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);
> }
> 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,
>
Fine for me.
Reviewed-by: Claudio Fontana <address@hidden>
--
Claudio Fontana
Server Virtualization Architect
Huawei Technologies Duesseldorf GmbH
Riesstraße 25 - 80992 München
office: +49 89 158834 4135
mobile: +49 15253060158
Re: [Qemu-devel] [PATCH 3/4] arm: Add PCIe host bridge in virt machine, Claudio Fontana, 2015/01/12
Re: [Qemu-devel] [PATCH 3/4] arm: Add PCIe host bridge in virt machine, alvise rigo, 2015/01/12
[Qemu-devel] [PATCH 1/4] pci: Split pcie_host_mmcfg_map(), Alexander Graf, 2015/01/06
- Re: [Qemu-devel] [PATCH 1/4] pci: Split pcie_host_mmcfg_map(),
Claudio Fontana <=
[Qemu-devel] [PATCH 2/4] pci: Add generic PCIe host bridge, Alexander Graf, 2015/01/06
- Re: [Qemu-devel] [PATCH 2/4] pci: Add generic PCIe host bridge, Claudio Fontana, 2015/01/12
- Re: [Qemu-devel] [PATCH 2/4] pci: Add generic PCIe host bridge, alvise rigo, 2015/01/12
- Re: [Qemu-devel] [PATCH 2/4] pci: Add generic PCIe host bridge, Alexander Graf, 2015/01/12
- Re: [Qemu-devel] [PATCH 2/4] pci: Add generic PCIe host bridge, Peter Maydell, 2015/01/12
- Re: [Qemu-devel] [PATCH 2/4] pci: Add generic PCIe host bridge, Alexander Graf, 2015/01/12
- Re: [Qemu-devel] [PATCH 2/4] pci: Add generic PCIe host bridge, Peter Maydell, 2015/01/12
- Re: [Qemu-devel] [PATCH 2/4] pci: Add generic PCIe host bridge, Alexander Graf, 2015/01/12
- Re: [Qemu-devel] [PATCH 2/4] pci: Add generic PCIe host bridge, Peter Maydell, 2015/01/13
- Re: [Qemu-devel] [PATCH 2/4] pci: Add generic PCIe host bridge, Claudio Fontana, 2015/01/13