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

RE: [PATCH v2] Fix failure cleanup in EvtchnFifoAcquire


  • To: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>, "win-pv-devel@xxxxxxxxxxxxxxxxxxxx" <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Durrant, Paul" <pdurrant@xxxxxxxxxxxx>
  • Date: Fri, 18 Jul 2025 10:16:05 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amazon.co.uk; dmarc=pass action=none header.from=amazon.co.uk; dkim=pass header.d=amazon.co.uk; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WaLy9IVShFr9zUktjWwNssTfzWeC474A2wYg0WYHlyo=; b=j23/YUCVgYKQzbZNVacO0gCv43iiVfXl8QPNWQc+ghXl3VmYFvZvzCtwcoKrwyVy23BhjZ5dI2RHNeXslVgUhxN8i5OIktwVZf6IQ8i1Yz7olnYSeWESrmBrScHsksP691KseWNJ7cbUtwmekqVouNxRzzOajlxFLsvwrdOyXVZsnx8Ol8ho/cSZrnxg+GMmIhwpT7JQP76+Xky0/jyKEsmNnefC1t3sWp1YBhrKuEjGd+Fnz3xpeb/6GJngN3FkTr7ybUOqkKnK5Xb8b/UK+m2sEbdrFzm1ER/oR7zdrFajxLQHL4/QMspXk1l5smXbZXf+jS6cUiTLJESjYkLZqA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=L0l2y3rn5UeHbFKc6l82JWoZ6rIzdCVLAUVR1iRLQQP0aKL/A2vQYJu50sq8dFTThBZm2pJOdrddFgCm9P5K1LsI0s9gmgrBkJEd1/v7IHfjnWOqv8s+BqeBUrHXT+TGiDvly1bDaUgIDfkiz1Ut8g3LC9Nt2aFtqoIWn6QUzkoUBMWXTZe/b47tRVlrlHk+z7JiZUQA7X3BYVWd7/9BgcWgeIrHW6pL+kuT6E9ep2UXFs13wTFeWR8jQDK6CHMeurNq7oeKNsdzdHSMzjRxzFf5XWgaE1zENNs9aUP1T0mEcg6fo4LUs1VcLlnINs0xW5wF6ntzjrU60BJdHd1Arg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amazon.co.uk;
  • Cc: Owen Smith <owen.smith@xxxxxxxxx>
  • Delivery-date: Fri, 18 Jul 2025 10:16:22 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
  • Thread-index: AQHb98qO3ZMDHqfNrUamuEX8SjeBh7Q3qlrg
  • Thread-topic: [PATCH v2] Fix failure cleanup in EvtchnFifoAcquire

> -----Original Message-----
> From: win-pv-devel <win-pv-devel-bounces@xxxxxxxxxxxxxxxxxxxx> On Behalf
> Of Tu Dinh
> Sent: Friday, July 18, 2025 10:59 AM
> To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>; Owen Smith <owen.smith@xxxxxxxxx>;
> Durrant, Paul <pdurrant@xxxxxxxxxxxx>
> Subject: [EXTERNAL] [PATCH v2] Fix failure cleanup in EvtchnFifoAcquire
> 
> CAUTION: This email originated from outside of the organization. Do not
> click links or open attachments unless you can confirm the sender and know
> the content is safe.
> 
> 
> 
> The current index is incremented before checking for failure:
> 
>     while (Index < ProcessorCount) {
>         Index++;
>         [...]
>         if (!NT_SUCCESS(status))
>             goto fail1;
>         Context->ControlBlockMdl[vcpu_id] = Mdl;
>     }
> 
> Make the main loop a normal for loop to avoid calling __FreePage on
> invalid PMDLs.
> 
> Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
> ---
>  src/xenbus/evtchn_fifo.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/src/xenbus/evtchn_fifo.c b/src/xenbus/evtchn_fifo.c
> index 1137dea..fd06ef4 100644
> --- a/src/xenbus/evtchn_fifo.c
> +++ b/src/xenbus/evtchn_fifo.c
> @@ -502,16 +502,13 @@ EvtchnFifoAcquire(
> 
>      ProcessorCount =
> KeQueryMaximumProcessorCountEx(ALL_PROCESSOR_GROUPS);
> 
> -    Index = 0;
> -    while (Index < ProcessorCount) {
> +    for (Index = 0; Index < ProcessorCount; Index++) {

Prevailing style uses while loops I think so stick with that for consistency, 
just move the increment down.

>          unsigned int        vcpu_id;
>          PFN_NUMBER          Pfn;
>          PHYSICAL_ADDRESS    Address;
> 
>          status = SystemProcessorVcpuId(Index, &vcpu_id);
> 
> -        Index++;
> -
>          if (status == STATUS_NOT_SUPPORTED)
>              continue;
> 
> --
> 2.50.1.windows.1
> 
> 
> 
> 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®.