[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 2/3] pci: Add missing drop of bus master AS refer
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PULL 2/3] pci: Add missing drop of bus master AS reference |
Date: |
Fri, 31 Mar 2017 01:41:07 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 29.03.2017 03:18, Michael S. Tsirkin wrote:
> From: Alexey Kardashevskiy <address@hidden>
>
> The recent introduction of a bus master container added
> memory_region_add_subregion() into the PCI device registering path but
> missed memory_region_del_subregion() in the unregistering path leaving
> a reference to the root memory region of the new container.
>
> This adds missing memory_region_del_subregion().
>
> Fixes: 3716d5902d743 ("pci: introduce a bus master container")
> Signed-off-by: Alexey Kardashevskiy <address@hidden>
> Reviewed-by: Michael S. Tsirkin <address@hidden>
> Signed-off-by: Michael S. Tsirkin <address@hidden>
> Reviewed-by: Paolo Bonzini <address@hidden>
> ---
> hw/pci/pci.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index e6b08e1..bd8043c 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -869,6 +869,8 @@ static void do_pci_unregister_device(PCIDevice *pci_dev)
> pci_dev->bus->devices[pci_dev->devfn] = NULL;
> pci_config_free(pci_dev);
>
> + memory_region_del_subregion(&pci_dev->bus_master_container_region,
> + &pci_dev->bus_master_enable_region);
> address_space_destroy(&pci_dev->bus_master_as);
> }
I have yet to investigate how and why, but this may result in a failed
assertion:
$ qemu-system-x86_64 -drive if=virtio
qemu-system-x86_64: ./memory.c:2078: memory_region_del_subregion:
Assertion `subregion->container == mr' failed.
[1] 15352 abort (core dumped) qemu-system-x86_64 -drive if=virtio
I guess the subregion has not yet been added in this case and therefore
should not be deleted...?
(Caught by iotest 051.)
Max
signature.asc
Description: OpenPGP digital signature