From: Eric Auger <eauger@redhat.com>
To: "Cédric Le Goater" <clg@redhat.com>,
qemu-devel@nongnu.org, "Stefan Hajnoczi" <stefanha@redhat.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
Matthew Rosato <mjrosato@linux.ibm.com>
Subject: Re: [PULL 00/21] vfio queue
Date: Fri, 6 Oct 2023 19:28:26 +0200 [thread overview]
Message-ID: <a0feb302-2490-8e3c-a54a-47bc8671f11e@redhat.com> (raw)
In-Reply-To: <1d87070c-2561-c6da-1380-9e3e13bcd844@redhat.com>
Hi Cédric,
On 10/6/23 19:08, Cédric Le Goater wrote:
> Hello Eric,
>
> On 10/6/23 14:25, Eric Auger wrote:
>> Hi Cédric,
>>
>> On 10/6/23 13:46, Eric Auger wrote:
>>> Hi Cédric,
>>>
>>> On 10/6/23 13:42, Eric Auger wrote:
>>>> Hi Cédric,
>>>>
>>>> On 10/6/23 12:33, Cédric Le Goater wrote:
>>>>> On 10/6/23 08:19, Cédric Le Goater wrote:
>>>>>> The following changes since commit
>>>>>> 2f3913f4b2ad74baeb5a6f1d36efbd9ecdf1057d:
>>>>>>
>>>>>> Merge tag 'for_upstream' of
>>>>>> https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging
>>>>>> (2023-10-05 09:01:01 -0400)
>>>>>>
>>>>>> are available in the Git repository at:
>>>>>>
>>>>>> https://github.com/legoater/qemu/ tags/pull-vfio-20231006
>>>>>>
>>>>>> for you to fetch changes up to
>>>>>> 6e86aaef9ac57066aa923211a164df95b7b3cdf7:
>>>>>>
>>>>>> vfio/common: Move legacy VFIO backend code into separate
>>>>>> container.c (2023-10-05 22:04:52 +0200)
>>>>>>
>>>>>> ----------------------------------------------------------------
>>>>>> vfio queue:
>>>>>>
>>>>>> * Fix for VFIO display when using Intel vGPUs
>>>>>> * Support for dynamic MSI-X
>>>>>> * Preliminary work for IOMMUFD support
>>>>>
>>>>> Stefan,
>>>>>
>>>>> I just did some tests on z with passthough devices (PCI and AP) and
>>>>> the series is not bisectable. QEMU crashes at patch :
>>>>>
>>>>> "vfio/pci: Introduce vfio_[attach/detach]_device".
>>>>>
>>>>> Also, with everything applied, the guest fails to start with :
>>>>>
>>>>> vfio: IRQ 0 not available (number of irqs 0)
>>>>>
>>>>> So, please hold on and sorry for the noise. I will start digging
>>>>> on my side.
>>>> I just tested with the head on vfio/pci: Introduce
>>>> vfio_[attach/detach]_device, with PCIe assignment on ARM and I fail to
>>>> reproduce the crash.
>>>>
>>>> Do you try hotplug or something simpler?
>>>
>>> also works for me with hotplug/hotunplug. Please let me know if I can
>>> help.
>>
>> I think this is related to the error handling.
>>
>> if you hotplug a vfio-device and if this encounters an error,
>> vfio_realize fails and you end at the 'error' label where the name of
>> the device is freed: g_free(vbasedev->name);
>>
>> However I see that the vfio_finalize is called (Zhengzhong warned me !!)
>> calls vfio_pci_put_device
>> which calls g_free(vdev->vbasedev.name) again.
>> please try adding
>> vdev->vbasedev.name = NULL after freeing the name in vfio_realize error:
>> so see if it fixes the crash.
>>
>> Then wrt irq stuff, I would be tempted to say it sounds unrelated to the
>> iommufd prereq series but well.
>>
>> Please let me know how you want me to fix that mess, sorry.
>
> So, the issue was a bit complex to dig because it only crashed
> with a s390 guest under libvirt. This is my all-in-one combo VM
> which has 2 PCI, 2 AP, 1 CCW passthrough devices and the issue
> is in AP I think.
>
> vfio_ap_realize lacks :
>
> @@ -188,6 +188,7 @@ static void vfio_ap_realize(DeviceState
> error_report_err(err);
> }
> + return;
Hum indeed! Thanks for fixing that.
> error:
> error_prepend(errp, VFIO_MSG_PREFIX, vbasedev->name);
> g_free(vbasedev->name);
>
>
> No error were to return and since everything was fine, the error
> path generated a lot of mess indeed !
>
> If you are ok with the above, I will squash the change in the
> related patch and send a v2.
Unfortunately this is not sufficient. There is another regression
(crash) on a double free of vbasedev->name as I reported before. I was
able to hit it on a failing hotplug. How do you want me to send the
fix? I can resend the whole series of just fixes on the related patches.
Thanks
Eric> Thanks,
>
> C.
>
>
>
>
>>
>> Eric
>>
>>
>>>
>>> Eric
>>>>
>>>> Thanks
>>>>
>>>> Eric
>>>>
>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> C.
>>>>>
>>>>>> ----------------------------------------------------------------
>>>>>> Alex Williamson (1):
>>>>>> vfio/display: Fix missing update to set backing fields
>>>>>>
>>>>>> Eric Auger (7):
>>>>>> scripts/update-linux-headers: Add iommufd.h
>>>>>> vfio/common: Propagate KVM_SET_DEVICE_ATTR error if any
>>>>>> vfio/common: Introduce
>>>>>> vfio_container_add|del_section_window()
>>>>>> vfio/pci: Introduce vfio_[attach/detach]_device
>>>>>> vfio/platform: Use vfio_[attach/detach]_device
>>>>>> vfio/ap: Use vfio_[attach/detach]_device
>>>>>> vfio/ccw: Use vfio_[attach/detach]_device
>>>>>>
>>>>>> Jing Liu (4):
>>>>>> vfio/pci: detect the support of dynamic MSI-X allocation
>>>>>> vfio/pci: enable vector on dynamic MSI-X allocation
>>>>>> vfio/pci: use an invalid fd to enable MSI-X
>>>>>> vfio/pci: enable MSI-X in interrupt restoring on dynamic
>>>>>> allocation
>>>>>>
>>>>>> Yi Liu (2):
>>>>>> vfio/common: Move IOMMU agnostic helpers to a separate file
>>>>>> vfio/common: Move legacy VFIO backend code into separate
>>>>>> container.c
>>>>>>
>>>>>> Zhenzhong Duan (7):
>>>>>> vfio/pci: rename vfio_put_device to vfio_pci_put_device
>>>>>> linux-headers: Add iommufd.h
>>>>>> vfio/common: Extract out vfio_kvm_device_[add/del]_fd
>>>>>> vfio/common: Move VFIO reset handler registration to a group
>>>>>> agnostic function
>>>>>> vfio/common: Introduce a per container device list
>>>>>> vfio/common: Store the parent container in VFIODevice
>>>>>> vfio/common: Introduce a global VFIODevice list
>>>>>>
>>>>>> hw/vfio/pci.h | 1 +
>>>>>> include/hw/vfio/vfio-common.h | 60 +-
>>>>>> linux-headers/linux/iommufd.h | 444 +++++++++
>>>>>> hw/vfio/ap.c | 69 +-
>>>>>> hw/vfio/ccw.c | 122 +--
>>>>>> hw/vfio/common.c | 1885
>>>>>> +++------------------------------------
>>>>>> hw/vfio/container.c | 1161 ++++++++++++++++++++++++
>>>>>> hw/vfio/display.c | 2 +
>>>>>> hw/vfio/helpers.c | 612 +++++++++++++
>>>>>> hw/vfio/pci.c | 194 ++--
>>>>>> hw/vfio/platform.c | 43 +-
>>>>>> hw/vfio/meson.build | 2 +
>>>>>> hw/vfio/trace-events | 6 +-
>>>>>> scripts/update-linux-headers.sh | 3 +-
>>>>>> 14 files changed, 2580 insertions(+), 2024 deletions(-)
>>>>>> create mode 100644 linux-headers/linux/iommufd.h
>>>>>> create mode 100644 hw/vfio/container.c
>>>>>> create mode 100644 hw/vfio/helpers.c
>>>>>>
>>>>>
>>
>
next prev parent reply other threads:[~2023-10-06 17:29 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-06 6:19 [PULL 00/21] vfio queue Cédric Le Goater
2023-10-06 6:19 ` [PULL 01/21] vfio/display: Fix missing update to set backing fields Cédric Le Goater
2023-10-06 6:19 ` [PULL 02/21] vfio/pci: rename vfio_put_device to vfio_pci_put_device Cédric Le Goater
2023-10-06 6:19 ` [PULL 03/21] vfio/pci: detect the support of dynamic MSI-X allocation Cédric Le Goater
2023-10-06 6:19 ` [PULL 04/21] vfio/pci: enable vector on " Cédric Le Goater
2023-10-06 6:19 ` [PULL 05/21] vfio/pci: use an invalid fd to enable MSI-X Cédric Le Goater
2023-10-06 6:19 ` [PULL 06/21] vfio/pci: enable MSI-X in interrupt restoring on dynamic allocation Cédric Le Goater
2023-10-06 6:19 ` [PULL 07/21] scripts/update-linux-headers: Add iommufd.h Cédric Le Goater
2023-10-06 6:19 ` [PULL 08/21] linux-headers: " Cédric Le Goater
2023-10-06 6:19 ` [PULL 09/21] vfio/common: Move IOMMU agnostic helpers to a separate file Cédric Le Goater
2023-10-06 6:19 ` [PULL 10/21] vfio/common: Propagate KVM_SET_DEVICE_ATTR error if any Cédric Le Goater
2023-10-06 6:19 ` [PULL 11/21] vfio/common: Introduce vfio_container_add|del_section_window() Cédric Le Goater
2023-10-06 6:19 ` [PULL 12/21] vfio/common: Extract out vfio_kvm_device_[add/del]_fd Cédric Le Goater
2023-10-06 6:19 ` [PULL 13/21] vfio/pci: Introduce vfio_[attach/detach]_device Cédric Le Goater
2023-10-06 6:19 ` [PULL 14/21] vfio/platform: Use vfio_[attach/detach]_device Cédric Le Goater
2023-10-06 6:19 ` [PULL 15/21] vfio/ap: " Cédric Le Goater
2023-10-06 6:20 ` [PULL 16/21] vfio/ccw: " Cédric Le Goater
2023-10-06 6:20 ` [PULL 17/21] vfio/common: Move VFIO reset handler registration to a group agnostic function Cédric Le Goater
2023-10-06 6:20 ` [PULL 18/21] vfio/common: Introduce a per container device list Cédric Le Goater
2023-10-06 6:20 ` [PULL 19/21] vfio/common: Store the parent container in VFIODevice Cédric Le Goater
2023-10-06 6:20 ` [PULL 20/21] vfio/common: Introduce a global VFIODevice list Cédric Le Goater
2023-10-06 6:20 ` [PULL 21/21] vfio/common: Move legacy VFIO backend code into separate container.c Cédric Le Goater
2023-10-06 10:33 ` [PULL 00/21] vfio queue Cédric Le Goater
2023-10-06 11:42 ` Eric Auger
2023-10-06 11:46 ` Eric Auger
2023-10-06 12:25 ` Eric Auger
2023-10-06 17:08 ` Cédric Le Goater
2023-10-06 17:28 ` Eric Auger [this message]
2023-10-07 10:14 ` Cédric Le Goater
2023-10-07 15:33 ` Michael Tokarev
2023-10-09 6:47 ` Cédric Le Goater
-- strict thread matches above, loose matches on Subject: below --
2025-03-11 18:13 Cédric Le Goater
2025-03-13 7:05 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a0feb302-2490-8e3c-a54a-47bc8671f11e@redhat.com \
--to=eauger@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=clg@redhat.com \
--cc=mjrosato@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).