[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xenfilt: Complete enumeration for empty BusRelations


  • To: Jiaqing Zhao <Zhao.Jiaqing@xxxxxxx>, win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
  • Date: Tue, 24 Nov 2026 10:11:00 +0100
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
  • Cc: Owen Smith <owen.smith@xxxxxxxxxx>
  • Delivery-date: Tue, 24 Nov 2026 09:11:10 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 24/11/2026 09:15, Jiaqing Zhao wrote:
> A successful BusRelations query may return no PDOs if no device is
> present on that bus. Skipping FdoEnumerate() in that case leaves the
> XenFilt FDO marked as not enumerated, so the filter state never moves
> from XENFILT_FILTER_ENABLED to PENDING. On an HVM guest with a PV disk
> and a CD-ROM on secondary IDE channel (leaving the primary channel
> empty), this blocks XenVbd and the guest fails to boot.
> 
> Always call FdoEnumerate() so that tracked PDOs are reconciled and the
> FDO is marked enumerated even when the bus is empty.
> 
> Signed-off-by: Jiaqing Zhao <Zhao.Jiaqing@xxxxxxx>

Hello,

I received this patch, but it doesn't look like it has made it to 
win-pv-devel?

> ---
> Cc: Owen Smith <owen.smith@xxxxxxxxxx>
> Cc: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
> ---
>   src/xenfilt/fdo.c | 28 ++++++++++++++++------------
>   1 file changed, 16 insertions(+), 12 deletions(-)
> 
> diff --git a/src/xenfilt/fdo.c b/src/xenfilt/fdo.c
> index 04427bf..c8d98c6 100644
> --- a/src/xenfilt/fdo.c
> +++ b/src/xenfilt/fdo.c
> @@ -409,17 +409,20 @@ FdoEnumerate(
>       NTSTATUS                status;
>   
>       Count = Relations->Count;
> -    ASSERT(Count != 0);
> +    PhysicalDeviceObject = NULL;
> +    if (Count != 0) {
> +        PhysicalDeviceObject = __FdoAllocate(sizeof (PDEVICE_OBJECT) * 
> Count);
>   
> -    PhysicalDeviceObject = __FdoAllocate(sizeof (PDEVICE_OBJECT) * Count);
> -
> -    status = STATUS_NO_MEMORY;
> -    if (PhysicalDeviceObject == NULL)
> -        goto fail1;
> +        status = STATUS_NO_MEMORY;
> +        if (PhysicalDeviceObject == NULL)
> +            goto fail1;
>   
> -    RtlCopyMemory(PhysicalDeviceObject,
> -                  Relations->Objects,
> -                  sizeof (PDEVICE_OBJECT) * Count);
> +        RtlCopyMemory(PhysicalDeviceObject,
> +                      Relations->Objects,
> +                      sizeof (PDEVICE_OBJECT) * Count);
> +    } else {
> +        Info("%s: Enumerated empty BusRelations\n", __FdoGetName(Fdo));
> +    }
>   
>       // Remove any PDOs that do not appear in the device list
>       ListEntry = Fdo->List.Flink;
> @@ -498,7 +501,8 @@ FdoEnumerate(
>   
>       __FdoSetEnumerated(Fdo);
>   
> -    __FdoFree(PhysicalDeviceObject);
> +    if (PhysicalDeviceObject != NULL)
> +        __FdoFree(PhysicalDeviceObject);
>       return;
>   
>   fail1:
> @@ -942,10 +946,10 @@ FdoQueryDeviceRelations(
>   
>       Relations = (PDEVICE_RELATIONS)Irp->IoStatus.Information;
>   
> -    if (Relations->Count != 0)
> -        FdoEnumerate(Fdo, Relations);
> +    FdoEnumerate(Fdo, Relations);
>   
>       ExFreePool(Relations);
> +    Irp->IoStatus.Information = 0;
>   
>       State = DriverGetFilterState();
>       Count = 0;



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.