[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [for-2.11 PATCH 06/26] spapr_pci: parent the MSI memory r
From: |
Alexey Kardashevskiy |
Subject: |
Re: [Qemu-ppc] [for-2.11 PATCH 06/26] spapr_pci: parent the MSI memory region to the PHB |
Date: |
Wed, 26 Jul 2017 14:29:26 +1000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 26/07/17 03:59, Greg Kurz wrote:
> This memory region should be owned by the PHB. This ensures the PHB
> cannot be finalized as long as the the region is guest visible, or
> used by a CPU or a device.
Out of curiosity - does it really ensure this? Passing a parent to
memory_region_init_io() adds a reference to a child (i.e. "msi" region),
not to the PHB object. It is probably a good thing to have an owner for
every MR anyway, I am just not sure about the commit log, what does not
work if you do not do this?
>
> Signed-off-by: Greg Kurz <address@hidden>
> ---
> hw/ppc/spapr_pci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
> index 3fe7f3145467..4e4165b44b9a 100644
> --- a/hw/ppc/spapr_pci.c
> +++ b/hw/ppc/spapr_pci.c
> @@ -1703,7 +1703,7 @@ static void spapr_phb_realize(DeviceState *dev, Error
> **errp)
> }
> #endif
>
> - memory_region_init_io(&sphb->msiwindow, NULL, &spapr_msi_ops, spapr,
> + memory_region_init_io(&sphb->msiwindow, OBJECT(sphb), &spapr_msi_ops,
> spapr,
> "msi", msi_window_size);
> memory_region_add_subregion(&sphb->iommu_root, SPAPR_PCI_MSI_WINDOW,
> &sphb->msiwindow);
>
>
--
Alexey
- Re: [Qemu-ppc] [for-2.11 PATCH 04/26] spapr_drc: use g_strdup_printf() instead of snprintf(), (continued)
[Qemu-ppc] [for-2.11 PATCH 05/26] spapr_iommu: convert TCE table object to realize(), Greg Kurz, 2017/07/25
[Qemu-ppc] [for-2.11 PATCH 06/26] spapr_pci: parent the MSI memory region to the PHB, Greg Kurz, 2017/07/25
[Qemu-ppc] [for-2.11 PATCH 07/26] spapr_drc: fix realize and unrealize, Greg Kurz, 2017/07/25
[Qemu-ppc] [for-2.11 PATCH 08/26] spapr_drc: add unrealize method to physical DRC class, Greg Kurz, 2017/07/25
[Qemu-ppc] [for-2.11 PATCH 09/26] spapr_drc: pass object ownership to parent/owner, Greg Kurz, 2017/07/25