From win-pv-devel-bounces@lists.xenproject.org Thu Nov 06 14:18:53 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 06 Nov 2025 14:18:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1157016.1485941 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vH0p9-0002WY-Kl; Thu, 06 Nov 2025 14:18:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1157016.1485941; Thu, 06 Nov 2025 14:18:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vH0p9-0002WR-II; Thu, 06 Nov 2025 14:18:51 +0000
Received: by outflank-mailman (input) for mailman id 1157016;
 Thu, 06 Nov 2025 14:18:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dKvG=5O=bounce.vates.tech=bounce-md_30504962.690cae46.v1-36cccf8097c84349b2dc724ca38c290c@srs-se1.protection.inumbo.net>)
 id 1vH0p8-0002WG-B1
 for win-pv-devel@lists.xenproject.org; Thu, 06 Nov 2025 14:18:50 +0000
Received: from mail179-26.suw41.mandrillapp.com
 (mail179-26.suw41.mandrillapp.com [198.2.179.26])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 82276098-bb1b-11f0-9d17-b5c5bf9af7f9;
 Thu, 06 Nov 2025 15:18:49 +0100 (CET)
Received: from pmta12.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail179-26.suw41.mandrillapp.com (Mailchimp) with ESMTP id
 4d2PSQ2DpfzKsmlpd
 for <win-pv-devel@lists.xenproject.org>; Thu,  6 Nov 2025 14:18:46 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 36cccf8097c84349b2dc724ca38c290c; Thu, 06 Nov 2025 14:18:46 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 82276098-bb1b-11f0-9d17-b5c5bf9af7f9
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1762438726; x=1762708726;
	bh=hIpXBBi9D8uujX57qlsYcjRZeICtlu5KOT29c0qDPLs=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=GryDEgN9RSFh+AmFLBirkupENhGiCoToZWYt9o2UADG4aCAumc6b6MuTTZvKh8ivv
	 ACy+dNRPEboRHc0Is5vobiFAa2KurycVuw6nQzIq4hwVLH+soHCGCMjgrzcpMARx9R
	 5/1OtmrNXeoLa485v+MwwsOHj2kniPveXeR4qHVDwljA5x2ERdXTV5Z8mZtGnatXwA
	 xvMgLX+2I0C0+mRFWNB4lcD2i+iczq0WhGG5+D0hQjg9BRxFqBZIv+y2ai45UlbKq0
	 bwUJEteACI7c5Iipps/aMrhSNPzJEox7OG9ymn9xod8w9PnmBYBuTh0Bl0yWDp1lS+
	 SlDTo3LgA183Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1762438726; x=1762699226; i=ngoc-tu.dinh@vates.tech;
	bh=hIpXBBi9D8uujX57qlsYcjRZeICtlu5KOT29c0qDPLs=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=oNj/vvBcf9nr1FhrFH9jOe/mw84Rw1UVd9pTC+dxXGER3gHbi5pE+uvryZUZgMewB
	 20T4/JJOaUjO9mJIctKFddEEuW8kZGTQeQvh7tPD7VcmcIYZpfLSK6NCsIHKzXH78n
	 EL5V6D4HQrDgUMAO1ckstMAafbDuqpry2iU04SkVk2u+GoULYMgG9rUZDt+P2LorLa
	 7mBYZjf/7ODpTjn+mRow9uOD5gBAocvD4ol4ORGDA39SCMpwTDz6uFiku0HdjL4g0l
	 jzXu5heJs+W4hs2tuwVws6PRxx93/cFZpb1CzvXmzGt4nVss3pt9qoU3lX5D2GaJhy
	 Kaz0kLSHV65WA==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?[PATCH=20v2=202/3]=20Limit=20retry=20in=20ControllerGetResponse?=
X-Mailer: git-send-email 2.51.0.windows.2
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1762438725845
To: win-pv-devel@lists.xenproject.org
Cc: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Message-Id: <20251106141835.2008-3-ngoc-tu.dinh@vates.tech>
In-Reply-To: <20251106141835.2008-1-ngoc-tu.dinh@vates.tech>
References: <20251106141835.2008-1-ngoc-tu.dinh@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.36cccf8097c84349b2dc724ca38c290c?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251106:md
Date: Thu, 06 Nov 2025 14:18:46 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

During unplug, NDIS may issue a hash reconfiguration. However, the
backend may disappear before the request has had a chance to complete.
This is observable by e.g. adding a delay at the beginning of
VifReceiverSetHashAlgorithm and unplugging. If this happens, Xenvif will
get stuck waiting forever in ControllerGetResponse, at DISPATCH_LEVEL to
boot.

Limit the total wait time from calling EvtchnWait to 5 seconds, and
return an error code to the caller if the wait has failed.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xenvif/controller.c | 36 +++++++++++++++++++++++++++++++-----
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/src/xenvif/controller.c b/src/xenvif/controller.c
index e032972..6a091d6 100644
--- a/src/xenvif/controller.c
+++ b/src/xenvif/controller.c
@@ -246,9 +246,11 @@ fail1:
 
 #define TIME_US(_us)        ((_us) * 10)
 #define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
+#define TIME_S(_s)          (TIME_MS((_s) * 1000))
 #define TIME_RELATIVE(_t)   (-(_t))
 
-#define XENVIF_CONTROLLER_POLL_PERIOD 100 // ms
+#define XENVIF_CONTROLLER_POLL_PERIOD   TIME_MS(100)
+#define XENVIF_CONTROLLER_MAX_WAIT      TIME_S(5)
 
 _IRQL_requires_(DISPATCH_LEVEL)
 static NTSTATUS
@@ -257,10 +259,15 @@ ControllerGetResponse(
     OUT PULONG                      Data OPTIONAL
     )
 {
-    LARGE_INTEGER                   Timeout;
+    LARGE_INTEGER                   PollTimeout;
+    LARGE_INTEGER                   MaxTimeout;
+    LARGE_INTEGER                   Start;
     NTSTATUS                        status;
 
-    Timeout.QuadPart = TIME_RELATIVE(TIME_MS(XENVIF_CONTROLLER_POLL_PERIOD));
+    PollTimeout.QuadPart = TIME_RELATIVE(XENVIF_CONTROLLER_POLL_PERIOD);
+    MaxTimeout.QuadPart = TIME_RELATIVE(XENVIF_CONTROLLER_MAX_WAIT);
+
+    KeQuerySystemTime(&Start);
 
     for (;;) {
         ULONG   Count;
@@ -279,9 +286,27 @@ ControllerGetResponse(
                                &Controller->EvtchnInterface,
                                Controller->Channel,
                                Count + 1,
-                               &Timeout);
-        if (status == STATUS_TIMEOUT)
+                               &PollTimeout);
+        if (status == STATUS_TIMEOUT) {
+            LARGE_INTEGER       Now;
+            LONGLONG            Delta;
+
+            KeQuerySystemTime(&Now);
+
+            // Relative timeout
+            Delta = Now.QuadPart - Start.QuadPart;
+            if (Delta > -MaxTimeout.QuadPart)
+                break;
+
             __ControllerSend(Controller);
+        }
+    }
+
+    // Use STATUS_TRANSACTION_TIMED_OUT as an error code since STATUS_TIMEOUT is
+    // a success code.
+    if (Controller->Response.id != Controller->Request.id) {
+        status = STATUS_TRANSACTION_TIMED_OUT;
+        goto done;
     }
 
     ASSERT3U(Controller->Response.type, ==, Controller->Request.type);
@@ -311,6 +336,7 @@ ControllerGetResponse(
     if (NT_SUCCESS(status) && Data != NULL)
         *Data = Controller->Response.data;
 
+done:
     RtlZeroMemory(&Controller->Request,
                   sizeof (struct xen_netif_ctrl_request));
     RtlZeroMemory(&Controller->Response,
-- 
2.51.0.windows.2



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 06 14:18:55 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 06 Nov 2025 14:18:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1157017.1485945 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vH0pD-0002Zl-MP; Thu, 06 Nov 2025 14:18:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1157017.1485945; Thu, 06 Nov 2025 14:18:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vH0pD-0002ZX-Je; Thu, 06 Nov 2025 14:18:55 +0000
Received: by outflank-mailman (input) for mailman id 1157017;
 Thu, 06 Nov 2025 14:18:53 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=690e=5O=bounce.vates.tech=bounce-md_30504962.690cae46.v1-941d9ae2332b408a8c5b7abc69f46aa3@srs-se1.protection.inumbo.net>)
 id 1vH0pB-0002Xc-PY
 for win-pv-devel@lists.xenproject.org; Thu, 06 Nov 2025 14:18:53 +0000
Received: from mail179-26.suw41.mandrillapp.com
 (mail179-26.suw41.mandrillapp.com [198.2.179.26])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 842e6106-bb1b-11f0-980a-7dc792cee155;
 Thu, 06 Nov 2025 15:18:51 +0100 (CET)
Received: from pmta12.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail179-26.suw41.mandrillapp.com (Mailchimp) with ESMTP id
 4d2PSQ2kvdzKsbJ3h
 for <win-pv-devel@lists.xenproject.org>; Thu,  6 Nov 2025 14:18:46 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 941d9ae2332b408a8c5b7abc69f46aa3; Thu, 06 Nov 2025 14:18:46 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 842e6106-bb1b-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1762438726; x=1762708726;
	bh=BYG0v0W1gyS+w9bdcSVfSFj4KxrNGHIuDL1I88WVPEw=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=190eDJHnfkKCz6q5n/FbqKMQV4LqvwA7WLhHahz7zxA3Cnh+5w8fzIyaBUjSCoHGC
	 MDlnfFgvp0JiVEh6jeMPf83g+7STRjQj+n3yKmgeKjBLcFDHNjaJ2vGqjPqlOZOnod
	 RYXVjvnVIW1GkFr2hktI41rrGzJkbcAD1IUXdUV9Zt3Sh/zHTSLXdiawQ1K18iT0oh
	 UdD2pYDYDnUebtrthJmdrMnELqK6+tH6+YQJh9BPucA7YVmt+y2jR90qUyHi9XIzt+
	 OBCu3YPf6iyz5zXYm3TezdsjGbn1gwyWZGOU7yBsq+reMAOF8MmjYNGWY4u/ndoS4M
	 8AhMfKIxB2W7w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1762438726; x=1762699226; i=ngoc-tu.dinh@vates.tech;
	bh=BYG0v0W1gyS+w9bdcSVfSFj4KxrNGHIuDL1I88WVPEw=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=BeOwTbjH1nRwN5vW84G5HkTjIN/n/qT7d+h3t/S8FZE8G27EqtaSNMDWESWy4SyKY
	 dDXtUlqoa7x6gj+tG2meM8DDPxcatKrCSIaugIbdPKr320yL80xBSsUxeegCren2TN
	 SpdbYk4ZuELcEz9jM960kUMKWHKoqACO+9q8sMEa5DEQh4b7aFsOONIYAYXMh7PGDU
	 KS4kcNKJ3P0R34RiKTFEmwdLWdHAtM+YotFAwWH67bDn1Pb2FNqEuPYdCZutEkRtkN
	 I8RCxqcWNTzMgfKCvzRCNyUv3DQA31xUEfA1HOJsnk4JYkuw0fpd/bAA9KYYBIqBVO
	 jJDo3gGNc8xmA==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?[PATCH=20v2=201/3]=20Revert=204e080f819b55=20"Skip=20hash=20update=20if=20front...?=
X-Mailer: git-send-email 2.51.0.windows.2
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1762438725632
To: win-pv-devel@lists.xenproject.org
Cc: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Message-Id: <20251106141835.2008-2-ngoc-tu.dinh@vates.tech>
In-Reply-To: <20251106141835.2008-1-ngoc-tu.dinh@vates.tech>
References: <20251106141835.2008-1-ngoc-tu.dinh@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.941d9ae2332b408a8c5b7abc69f46aa3?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251106:md
Date: Thu, 06 Nov 2025 14:18:46 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

...end is not enabled"

NDIS queries the supported hash types before the frontend is enabled.
Controller requests are not dependent on the frontend being enabled to
begin with.

Allow such requests to go through.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xenvif/frontend.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/xenvif/frontend.c b/src/xenvif/frontend.c
index f844a42..5311dea 100644
--- a/src/xenvif/frontend.c
+++ b/src/xenvif/frontend.c
@@ -1910,9 +1910,6 @@ __FrontendUpdateHash(
     ULONG                   Flags;
     NTSTATUS                status;
 
-    if (Frontend->State != FRONTEND_ENABLED)
-        goto done;
-
     Controller = __FrontendGetController(Frontend);
 
     switch (Hash->Algorithm) {
-- 
2.51.0.windows.2



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 06 14:18:55 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 06 Nov 2025 14:18:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1157018.1485951 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vH0pD-0002a5-Ql; Thu, 06 Nov 2025 14:18:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1157018.1485951; Thu, 06 Nov 2025 14:18:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vH0pD-0002Zp-LG; Thu, 06 Nov 2025 14:18:55 +0000
Received: by outflank-mailman (input) for mailman id 1157018;
 Thu, 06 Nov 2025 14:18:54 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=baQ+=5O=bounce.vates.tech=bounce-md_30504962.690cae46.v1-e985eaa0ccba4e009e2c8fae3d2fd1d5@srs-se1.protection.inumbo.net>)
 id 1vH0pC-0002Xc-Eu
 for win-pv-devel@lists.xenproject.org; Thu, 06 Nov 2025 14:18:54 +0000
Received: from mail179-26.suw41.mandrillapp.com
 (mail179-26.suw41.mandrillapp.com [198.2.179.26])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 824e6393-bb1b-11f0-980a-7dc792cee155;
 Thu, 06 Nov 2025 15:18:48 +0100 (CET)
Received: from pmta12.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail179-26.suw41.mandrillapp.com (Mailchimp) with ESMTP id
 4d2PSQ2Mt2zKsbJ3J
 for <win-pv-devel@lists.xenproject.org>; Thu,  6 Nov 2025 14:18:46 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 e985eaa0ccba4e009e2c8fae3d2fd1d5; Thu, 06 Nov 2025 14:18:46 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 824e6393-bb1b-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1762438726; x=1762708726;
	bh=EpXlqGCEXRtIx+owBSDxlnb2sVoO1g+UPjkEHD9ZYyA=;
	h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From;
	b=wALWUuFSQDIfI+eqw7eP9NvOHUIE33EPm+frLi81mMKS/XAI+0BNeFAQH1JiVYkJ2
	 z/nk2s0Y1AOD7IdcOz4Yqbk18jKJFv+21zle+2s/yDWVhGNZh1LUknkrtMzU+ogPmf
	 J6L63E480TPAAOwotxJiXJ78BmAUOhzDyGPuuTezyDxqy1iSqaqtmxnxbJvInRqu0d
	 gnRD6dlf8PTDCJmFFXCoSubsvsUH9aa3A3jh07Mbc5LWYT0phBEsxekiRShT9WD45F
	 PZbAKZeRP64NhZp3qN+o+W0BLM/kqRPTM82O0/X9U7q7A7ypilQv4LRtPbdvFj6QVg
	 ddDm+3kcXDkNw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1762438726; x=1762699226; i=ngoc-tu.dinh@vates.tech;
	bh=EpXlqGCEXRtIx+owBSDxlnb2sVoO1g+UPjkEHD9ZYyA=;
	h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From;
	b=GMBduq/NVhJ6210bx3Ifo3Yw33zfAO8N8S44Ghzlx1F/dHDlQzIwc8W2RfbMsUFnA
	 cml2STIMsgOMxnS8UcMHl86vt0m7fHEUNk9eu1NBVgg5t8yXE0MIzcWRA/48/LZ3iX
	 /B6zrXBwPRfKtOOJRI++fDBBqWtiBJGKTv1mwX2qwWgQR2kQnB0KrQYqUXZl/AqRAE
	 YtXn9UpqrE8iF59WgH0kgG7KPYCklBLgB9jI1eb/8+ck8/zmmSA/YSnDs3S5DwXtko
	 N5IBEowr6WVLejEIcafFZ5uoCnIA8mCRCGN/H9IfYEQkKv5AvhGESzzNLwfP6t/crs
	 KyeT9h3SfepbQ==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?[XENVIF=20PATCH=20v2=200/3]=20Fix=20controller=20timeouts?=
X-Mailer: git-send-email 2.51.0.windows.2
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1762438725282
To: win-pv-devel@lists.xenproject.org
Cc: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Message-Id: <20251106141835.2008-1-ngoc-tu.dinh@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.e985eaa0ccba4e009e2c8fae3d2fd1d5?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251106:md
Date: Thu, 06 Nov 2025 14:18:46 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

4e080f819b55 "Skip hash update if frontend is not enabled" broke RSS, since NDIS
queries the supported hash types before the frontend is enabled, and since
controller requests are not dependent on the frontend being enabled to begin
with.

Still, we need to handle situations where the backend no longer responds to
control requests (e.g. when it has disappeared following a forced unplug).

Revert the above patch in favor of the following unplug fixes:
* Limit the retry in ControllerGetResponse to 5 seconds instead of waiting
  forever, to fix the hang issue on forced unplug;
* Check for Controller->Enabled in ControllerPutRequest. This will not help in
  case the backend has disappeared, but should help in other cases of spurious
  control requests.

v2:
* Extend ControllerGetResponse timeout to 5 secs
* Add ControllerPutRequest check

Tu Dinh (3):
  Revert 4e080f819b55 "Skip hash update if front...
  Limit retry in ControllerGetResponse
  Check controller enable status in PutRequest

 src/xenvif/controller.c | 51 ++++++++++++++++++++++++++++++++++-------
 src/xenvif/frontend.c   |  3 ---
 2 files changed, 43 insertions(+), 11 deletions(-)

--
2.51.0.windows.2


--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 06 14:18:56 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 06 Nov 2025 14:18:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1157019.1485953 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vH0pE-0002cg-PG; Thu, 06 Nov 2025 14:18:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1157019.1485953; Thu, 06 Nov 2025 14:18:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vH0pE-0002cc-Mg; Thu, 06 Nov 2025 14:18:56 +0000
Received: by outflank-mailman (input) for mailman id 1157019;
 Thu, 06 Nov 2025 14:18:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=O6Yp=5O=bounce.vates.tech=bounce-md_30504962.690cae46.v1-c7f102950cd24bdea5394b52aba843d6@srs-se1.protection.inumbo.net>)
 id 1vH0pD-0002Xc-Ev
 for win-pv-devel@lists.xenproject.org; Thu, 06 Nov 2025 14:18:55 +0000
Received: from mail179-26.suw41.mandrillapp.com
 (mail179-26.suw41.mandrillapp.com [198.2.179.26])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 85b6e009-bb1b-11f0-980a-7dc792cee155;
 Thu, 06 Nov 2025 15:18:53 +0100 (CET)
Received: from pmta12.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail179-26.suw41.mandrillapp.com (Mailchimp) with ESMTP id
 4d2PSQ3ZbDzKsbKkr
 for <win-pv-devel@lists.xenproject.org>; Thu,  6 Nov 2025 14:18:46 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 c7f102950cd24bdea5394b52aba843d6; Thu, 06 Nov 2025 14:18:46 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 85b6e009-bb1b-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1762438726; x=1762708726;
	bh=uK7d5qesblPeiJ2qjKoS4rfjzC9PUSPxN6tBfSVaen8=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=GfnXbcMWnuwdzE0b9rztPTScX+9l3ARaAZYXzbV+DzcJU7MN8rfocZwzx77EqGS77
	 IdN2hOdID6pNFsgDtTYhvKlA2NtaHVTVjXWX9aIYUWi7LGDntBS8YvJ5hMCioNTepM
	 uGGj6mQmoENXddvdrB3YHPk3wViJqocbGJGyqvqhnwRVpjeUYLoksRJcjRkvccF2J5
	 wx4pvRbiy6yxzimdNovvn6IMsa01CbJZCwL4BBDeMsUx+89i/piP7O/Xoj14m3mRoP
	 hhk8399qaxtE71Z4rzSrY04ZLaXz1xiJL+t+LciKBQLD8ngTY/YdsL0NU1KaKTwjnz
	 D7gpTRdVOFmdw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1762438726; x=1762699226; i=ngoc-tu.dinh@vates.tech;
	bh=uK7d5qesblPeiJ2qjKoS4rfjzC9PUSPxN6tBfSVaen8=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=x6IueSZEmwxN5CGn/Wt7k3UM5nKPHTVy08urHEC9eReo4ZLjmWuNNwgHYkJViBFBP
	 uiOBrrQKpief+CSeGpJR2npu/f3DChtsLqzrel5dUeDx4h6l8fUgGuqHeI0kKNCgR7
	 3grmmZiN26kjaQNRLP+8FBbABuT6rULKXL7+3UZ/gFzfd9W6qEjUKoIU/II9W6KtFu
	 JIy3FYqC3lVE2oKJsoFTHtxIuF58yEYCif9h9gn8g17pIGJP3ElTH1aJ+P7jCQZjJ0
	 0BGmxEcjlwlPyT3gtE54dtFYbSJhHr8tyoq8BLhzgSSOa9SRqYDYWcnjkbSeBpZ548
	 uL0Rprg0NHosQ==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?[PATCH=20v2=203/3]=20Check=20controller=20enable=20status=20in=20PutRequest?=
X-Mailer: git-send-email 2.51.0.windows.2
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1762438726043
To: win-pv-devel@lists.xenproject.org
Cc: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Message-Id: <20251106141835.2008-4-ngoc-tu.dinh@vates.tech>
In-Reply-To: <20251106141835.2008-1-ngoc-tu.dinh@vates.tech>
References: <20251106141835.2008-1-ngoc-tu.dinh@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.c7f102950cd24bdea5394b52aba843d6?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251106:md
Date: Thu, 06 Nov 2025 14:18:46 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Add a Controller->Enabled flag to signify whether the controller
currently accepts requests.

Check this flag in ControllerPutRequest instead of Controller->Connected.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xenvif/controller.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/xenvif/controller.c b/src/xenvif/controller.c
index 6a091d6..ca854ef 100644
--- a/src/xenvif/controller.c
+++ b/src/xenvif/controller.c
@@ -72,6 +72,7 @@ struct _XENVIF_CONTROLLER {
     PXENBUS_EVTCHN_CHANNEL              Channel;
     ULONG                               Events;
     BOOLEAN                             Connected;
+    BOOLEAN                             Enabled;
     USHORT                              RequestId;
     struct xen_netif_ctrl_request       Request;
     struct xen_netif_ctrl_response      Response;
@@ -194,7 +195,7 @@ ControllerPutRequest(
     NTSTATUS                        status;
 
     status = STATUS_NOT_SUPPORTED;
-    if (!Controller->Connected)
+    if (!Controller->Enabled)
         goto fail1;
 
     status = STATUS_INSUFFICIENT_RESOURCES;
@@ -688,7 +689,11 @@ ControllerEnable(
     IN  PXENVIF_CONTROLLER      Controller
     )
 {
-    UNREFERENCED_PARAMETER(Controller);
+    __ControllerAcquireLock(Controller);
+
+    Controller->Enabled = TRUE;
+
+    __ControllerReleaseLock(Controller);
 
     Trace("<===>\n");
 }
@@ -698,7 +703,11 @@ ControllerDisable(
     IN  PXENVIF_CONTROLLER      Controller
     )
 {
-    UNREFERENCED_PARAMETER(Controller);
+    __ControllerAcquireLock(Controller);
+
+    Controller->Enabled = FALSE;
+
+    __ControllerReleaseLock(Controller);
 
     Trace("<===>\n");
 }
-- 
2.51.0.windows.2



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Fri Nov 07 09:11:13 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 07 Nov 2025 09:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1157442.1486208 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vHIUx-0003ET-AD; Fri, 07 Nov 2025 09:11:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1157442.1486208; Fri, 07 Nov 2025 09:11:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vHIUx-0003EM-7G; Fri, 07 Nov 2025 09:11:11 +0000
Received: by outflank-mailman (input) for mailman id 1157442;
 Fri, 07 Nov 2025 09:11:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7WPv=5P=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vHIUw-0003EG-NX
 for win-pv-devel@lists.xenproject.org; Fri, 07 Nov 2025 09:11:10 +0000
Received: from BL0PR03CU003.outbound.protection.outlook.com
 (mail-eastusazlp170120007.outbound.protection.outlook.com
 [2a01:111:f403:c101::7])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b2a77c52-bbb9-11f0-9d17-b5c5bf9af7f9;
 Fri, 07 Nov 2025 10:11:09 +0100 (CET)
Received: from SA1PR03MB7098.namprd03.prod.outlook.com (2603:10b6:806:338::6)
 by CO1PR03MB5827.namprd03.prod.outlook.com (2603:10b6:303:9a::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9298.12; Fri, 7 Nov
 2025 09:11:03 +0000
Received: from SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15]) by SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15%6]) with mapi id 15.20.9298.007; Fri, 7 Nov 2025
 09:11:01 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b2a77c52-bbb9-11f0-9d17-b5c5bf9af7f9
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=CGO6glVS05VFwkNgptekjNn0HjjtT2cY3uob5k8hEIjmPybzBpLfHnzBtNeEFi0vGVq5sp7/JW/+EqfwIXPK8abEYgu4CnqMnm0p0FfcapTbmPKGd6D0SUzKTrw8Uli/Ouma8yyg4E8zeYa/9YrdRRexdKBYpyvrrMH3vV2H3oMVE0V1DiI+5TSCdoBT5y4stb+wXGiMB+L2C7CN/CyglafXIo55GwHWuceGoy1XJ03DqygHr2B58LkzxBY++SdkBLKwlr4hR0wVtHlYkWWWOVZ1qRuUSAwkKPJN+0vOT87uzvhowYd7A+0jD4ndygesC5bFPyb2iLdqdnwX+7pmYw==
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=4RVT8y4YMUjfhoTDpcyjL6eWxy3THS+zDPHVNH3HyZA=;
 b=PrNALVjdblAl/J9o8dfqfHYeRHoEA35CFFB9p7ikodotnj+TloWuYgU3Nta7WFhkDqBljcdvqqRQBUSEP/bXZN7cuKvPVgnfzahy/tj2ZMG7KgGztvG+YP7+0jxcWAEJflOF9633QSlIm6hJ00XTaViNRMHA9SM8/BGCF3DASU4rdeSGvmwFtsOUw4HuM+umKeDAwqyP+1MzTXWVj5jlGq+RF3HEedsgHvpY7sJOAQq1+jatYPyNUPNye0aOtEtL7xMirQLEv7r6VMnaRTHAjqKlWeS0Yo5aNVe5yT7hKwOnDaLUBAOYc2rDKkkZEeBSNT5r7CgkaJVBtQCNetk7pg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4RVT8y4YMUjfhoTDpcyjL6eWxy3THS+zDPHVNH3HyZA=;
 b=POwaag+lojI+OUFWBY7wAJAvez8BtC70jeXTiWrc+8D4cKEjcFnakoLueL+hd0DZUfVTdzXI+R6yceP8F4za869v/S4iHAZVADC472fJZ+ZdzmmPc3Eby0Rqo+U15ZT9HsEUgN3uDChcymL0R/X2i2p25PZpfHr1B5P+c4ij/cE=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 2/3] Limit retry in ControllerGetResponse
Thread-Topic: [PATCH v2 2/3] Limit retry in ControllerGetResponse
Thread-Index: AQHcTyhPf4yajOGgv025SjSgwRoOp7Tm7gP8
Date: Fri, 7 Nov 2025 09:11:01 +0000
Message-ID:
 <SA1PR03MB7098A8A9E5ECB61C975B5198FEC3A@SA1PR03MB7098.namprd03.prod.outlook.com>
References: <20251106141835.2008-1-ngoc-tu.dinh@vates.tech>
 <20251106141835.2008-3-ngoc-tu.dinh@vates.tech>
In-Reply-To: <20251106141835.2008-3-ngoc-tu.dinh@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA1PR03MB7098:EE_|CO1PR03MB5827:EE_
x-ms-office365-filtering-correlation-id: 5b96af78-3cb7-48a8-cd34-08de1ddd9298
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|366016|1800799024|376014|38070700021;
x-microsoft-antispam-message-info:
 =?us-ascii?Q?B/pL8W4d+/Zpu+QV6k+KIq3Gp7GGZ+p4PDnwKZLv70j764VAEOllTB5I+Mib?=
 =?us-ascii?Q?SG/85ftKN6qiga6Dc2d3spDV+acRNgoLZ1pthoP7A3LWhiAIT2wtB5mievR7?=
 =?us-ascii?Q?IvrgLztpVWYonM/L3fbANi4rxhfKAqKIdnSXmwfFhrcrwur9qgGVY/BB4IKG?=
 =?us-ascii?Q?GWvJsJr9o9Ut5FQM9Qx86ZcKLxrYFfjuMVn3r9OY/vwKu6jy4udEifKq9gzX?=
 =?us-ascii?Q?0a14zCsEFORguZDNONdNU6fLxbA7YhPkQlfFTfSZePPxCImOuxTeH4J2cqbU?=
 =?us-ascii?Q?z0ew3ImNF5WCG7JxINxRMVZAOR2inuiis2BuvZi8xWfRAYY52GFE9+xZQfJe?=
 =?us-ascii?Q?wfjFK7XS5zheV660SjAWnBiEuEpB1ab1kX9m7VeY8S3kl7Z2vu/zdO+L9iMc?=
 =?us-ascii?Q?+UOAqqGZvs1QquOhajcEgzfrJcdXhPFcIbUdzs/9lG2qjuec2QnHEnXjukKc?=
 =?us-ascii?Q?8zhLTK+iQwDOyCRxtPf2PRgslDgshsFRItOXKBY9Ezy/1tN2RvLxBS2ZnoTk?=
 =?us-ascii?Q?XkcdVv1h7D3IZahRvD85pRh6GF8nPWrFPS0QEbcIxIh+gQsZn/8Y3md2y6g8?=
 =?us-ascii?Q?pAvPRTo78FjZ3DJYWTomWDMDGOZGrgt39cUoGqcCq0bJA3XuwqmRTkOJpmk9?=
 =?us-ascii?Q?ujIMycpX4E0S/NW2G/VUc98bd2bbgVZZwXT7DHEoLqAWdThnBiBjn8SNNDI8?=
 =?us-ascii?Q?NSH2EuKX9dZ9DM1XlyPDj2511eEtzDVp/peYdI+LgX+0JB6gIKNwn7kQReBX?=
 =?us-ascii?Q?0vYiU3frvQiInQMJX1Cv1ZP3YNbynj6QMk2OOv9cvKg31vPwcFzwdAV997xZ?=
 =?us-ascii?Q?Pz3AauXXM9PeP0sA+HgqrBc0lN9lQjQTEPE2jgnTelt8gAa9Y9nubepYtPRa?=
 =?us-ascii?Q?J0NVWJFGXHpruwpfPgV0Eb699YpNfweuN5H3p05r9vDaTjpf/eMDd0rLUsIl?=
 =?us-ascii?Q?9LO8wfqOXDOBmukz93QSxoto7A2Y17pnS0qCPF1gr9V4M0R5WsSwnKIH5al2?=
 =?us-ascii?Q?qw7sL0ztqbbyDebzEoWMis20qMbshSmcTMg/dyQbIprv7y/S1glXPwx01wOt?=
 =?us-ascii?Q?cNSEIGrbUYf7F9z62fQBwnITOdDq4M3Jg+eUb68SKtZTlaf1Y1yTBZTjdD6n?=
 =?us-ascii?Q?6x7x7APWdLQeGF1hx5afs7VwMY34ENcnTlsmGFU4pO3kyto9Ope2Bg5YDWI2?=
 =?us-ascii?Q?U8t159yan7JvPoPYmemMZUYJnM+dMhJjj4JuxnZUhuUqw/4me+o0T8e3yhT6?=
 =?us-ascii?Q?t+UGwMKYs3KhEe4tAPtIF08AM6tVnliOFtjlo5UHMIi56W/awLkSxv54xI4A?=
 =?us-ascii?Q?yK0YuG+CGNU61Oae7aLa+ofFki4sn8qQ9XYOrjlHNB9Xb4omF52JE38QLuja?=
 =?us-ascii?Q?nQ43NIH6JOve7+UD5nr2fTo+AwCpZMnYta+8cY5LSCROu7pKxCrfTOlQqCSI?=
 =?us-ascii?Q?H4RiVGADu8+8snI3ofoiHKXO2Xyi//18?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR03MB7098.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(38070700021);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?sk2jo2LVp8tgw9x6+ou2+dYNvxv0wNflYJUZAHOXlZlRK/uRjjM/5zTgP3It?=
 =?us-ascii?Q?n5wD7y2pwcRNEn09KR/T98pavlgMgaCoV0u9o97J7l7NB4eyoVHj4G8qNUGL?=
 =?us-ascii?Q?2563E0QA26I8RdyV5gEesnp+Cmk4jFohUdNumLDjMKL0nLu9tESkja2ucRMw?=
 =?us-ascii?Q?ksIOq79Ohx4X8prVTufTp249My1ZtgzsdCzUaKIEGzqHOfSiVnXpXVO+AnhK?=
 =?us-ascii?Q?pEnFNwAnuaazPpBIMILSQrxCxmwObdI63XkEhzMH1rk2aMRLcDBxVkd2SHFd?=
 =?us-ascii?Q?UJRflSW983o5YEQRtg9883trE7B0Mz6+0UcTlKGpgvtn8rJ7zprzyqyUpC6g?=
 =?us-ascii?Q?e9XFKtNX8Qe4WKqFfgKFIHRAk8iVXGSENsYhfTRAuCoqzJ61n2Kg9jO+PJEk?=
 =?us-ascii?Q?QMJI5wShMRotCdrnXd/hv8FyLISEHGWMC+RjPretAI+g8M8+7GFK3sHjZ88I?=
 =?us-ascii?Q?ojzhgXfGgvc4KS7vs1bQr5K5ZiksNbctjKywn5Zy3Emq2+nx0glX3vwb1fUz?=
 =?us-ascii?Q?yi1bzN/esItYv7Lx/DL9VZDpr1CfE071WD+8aMHjpCMT/tLun+z5zTixtU1t?=
 =?us-ascii?Q?AAWhCyt6NAOSRdA2+VV+OmhvBCi4awsOjNmKvEGToxS7XGt1QikdmhHXrBZW?=
 =?us-ascii?Q?xHCGD3ncD+AFKLGUxnMor/6kSrhKNDt+lK/TypwAO5pRlbYVnkA7UFeU/VFo?=
 =?us-ascii?Q?g+J0XPcs26d//6cH8psu1IuQpK44m0k6rjYqJTlWf75Qcq+COO65PQquua8c?=
 =?us-ascii?Q?IDYz1AsX2wVUvsdqi96jqMvqAgZFtzGaF5NuVj9bnbFZr5bpvQtTb2dkNnhA?=
 =?us-ascii?Q?1kvYqAt+dhvFQeK41TRf1D325gtirKsNKAL6okhJfXyyYbmCUQoHByUGAOm2?=
 =?us-ascii?Q?j9/0tpDd3fpgKMQ6SrHkKmiq2IOQJ4N6llmnjgxIJv1Dm53L2jUVLf8NuN1W?=
 =?us-ascii?Q?tpv1PBTebvrch7/O7jltxhghtDp3cZqewdbhD6p1KiGGL4ZqnlMyI+2h9Qnj?=
 =?us-ascii?Q?rp7TLb6yy1trqoxlE5WsxQ5MJPYj5Ag5Ua62feDZgrBywp/+UXqDGtlQXhuv?=
 =?us-ascii?Q?1CEv37JIzqFxvhJUXrqYFj8IwbRYPmmtIhRvNDV2MSkGDb6Yr2ELcHUY7Pc9?=
 =?us-ascii?Q?kiM5yy0C8fiWbOJjIQuvBWmSOwZRGGk1sDDHoekLajEWUBAJC4gGaZ/+lePk?=
 =?us-ascii?Q?SZQDfK2q1SE/h/jbTtK7WHZdJMzjGnQggfBH50eHzmu4WIKdLx0qR9TahAvE?=
 =?us-ascii?Q?3sU1sdHbAKxdAlCFZKGHWwDPFGQlDTSshj8Kd/xGL4TRxfeSnjRfj0oeWlVA?=
 =?us-ascii?Q?bqc/bcOOgYfK//TV+DwLXqOaliIS9q0W0VoKGUL4b++APXX3PV+dNz+yqHZ4?=
 =?us-ascii?Q?68xvkK2mCh3OEkcPcd8zOgS2YKDnyXCy61MD5iBd4quT2bl8/ZCeVuryrHRU?=
 =?us-ascii?Q?PAK4Y1W3boFuE3YILFJhe7sSpnlGP9RLjOL9rCkDTn+ogKlFHAAy+whflgzt?=
 =?us-ascii?Q?zftrV7XhMdNruTTJxWlLhJFlzWiwhIk7dxVFRwjB9Ohvr+mFOtBLYzbPDpbJ?=
 =?us-ascii?Q?JN3AyhL3XNgQa3o889ZZbgA6oMIzzQZZs9ca9ZIJ?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA1PR03MB7098.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 5b96af78-3cb7-48a8-cd34-08de1ddd9298
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2025 09:11:01.7567
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: bB1mLPauRQmBHqfZiKeM3w1VQ+2ETpUhVPiWB85fPa0GwMR3j4Y1XJN8igPX/saSxRMhDWgsQjv7a/kD80hg9Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR03MB5827


Would keeping a count of the number of STATUS_TIMEOUTs returned by Controll=
erGetResponse() and breaking out of the loop after 50 timeouts be simpler?
Or is it required to query the time to ensure a more accurate poll?

Owen

________________________________________
From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf of=
 Tu Dinh <ngoc-tu.dinh@vates.tech>
Sent: 06 November 2025 2:18 PM
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh
Subject: [PATCH v2 2/3] Limit retry in ControllerGetResponse

During unplug, NDIS may issue a hash reconfiguration. However, the
backend may disappear before the request has had a chance to complete.
This is observable by e.g. adding a delay at the beginning of
VifReceiverSetHashAlgorithm and unplugging. If this happens, Xenvif will
get stuck waiting forever in ControllerGetResponse, at DISPATCH_LEVEL to
boot.

Limit the total wait time from calling EvtchnWait to 5 seconds, and
return an error code to the caller if the wait has failed.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xenvif/controller.c | 36 +++++++++++++++++++++++++++++++-----
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/src/xenvif/controller.c b/src/xenvif/controller.c
index e032972..6a091d6 100644
--- a/src/xenvif/controller.c
+++ b/src/xenvif/controller.c
@@ -246,9 +246,11 @@ fail1:

 #define TIME_US(_us)        ((_us) * 10)
 #define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
+#define TIME_S(_s)          (TIME_MS((_s) * 1000))
 #define TIME_RELATIVE(_t)   (-(_t))

-#define XENVIF_CONTROLLER_POLL_PERIOD 100 // ms
+#define XENVIF_CONTROLLER_POLL_PERIOD   TIME_MS(100)
+#define XENVIF_CONTROLLER_MAX_WAIT      TIME_S(5)

 _IRQL_requires_(DISPATCH_LEVEL)
 static NTSTATUS
@@ -257,10 +259,15 @@ ControllerGetResponse(
     OUT PULONG                      Data OPTIONAL
     )
 {
-    LARGE_INTEGER                   Timeout;
+    LARGE_INTEGER                   PollTimeout;
+    LARGE_INTEGER                   MaxTimeout;
+    LARGE_INTEGER                   Start;
     NTSTATUS                        status;

-    Timeout.QuadPart =3D TIME_RELATIVE(TIME_MS(XENVIF_CONTROLLER_POLL_PERI=
OD));
+    PollTimeout.QuadPart =3D TIME_RELATIVE(XENVIF_CONTROLLER_POLL_PERIOD);
+    MaxTimeout.QuadPart =3D TIME_RELATIVE(XENVIF_CONTROLLER_MAX_WAIT);
+
+    KeQuerySystemTime(&Start);

     for (;;) {
         ULONG   Count;
@@ -279,9 +286,27 @@ ControllerGetResponse(
                                &Controller->EvtchnInterface,
                                Controller->Channel,
                                Count + 1,
-                               &Timeout);
-        if (status =3D=3D STATUS_TIMEOUT)
+                               &PollTimeout);
+        if (status =3D=3D STATUS_TIMEOUT) {
+            LARGE_INTEGER       Now;
+            LONGLONG            Delta;
+
+            KeQuerySystemTime(&Now);
+
+            // Relative timeout
+            Delta =3D Now.QuadPart - Start.QuadPart;
+            if (Delta > -MaxTimeout.QuadPart)
+                break;
+
             __ControllerSend(Controller);
+        }
+    }
+
+    // Use STATUS_TRANSACTION_TIMED_OUT as an error code since STATUS_TIME=
OUT is
+    // a success code.
+    if (Controller->Response.id !=3D Controller->Request.id) {
+        status =3D STATUS_TRANSACTION_TIMED_OUT;
+        goto done;
     }

     ASSERT3U(Controller->Response.type, =3D=3D, Controller->Request.type);
@@ -311,6 +336,7 @@ ControllerGetResponse(
     if (NT_SUCCESS(status) && Data !=3D NULL)
         *Data =3D Controller->Response.data;

+done:
     RtlZeroMemory(&Controller->Request,
                   sizeof (struct xen_netif_ctrl_request));
     RtlZeroMemory(&Controller->Response,
--
2.51.0.windows.2



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




From win-pv-devel-bounces@lists.xenproject.org Fri Nov 07 09:25:03 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 07 Nov 2025 09:25:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1157445.1486212 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vHIiM-0004TZ-A6; Fri, 07 Nov 2025 09:25:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1157445.1486212; Fri, 07 Nov 2025 09:25:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vHIiM-0004TS-7Q; Fri, 07 Nov 2025 09:25:02 +0000
Received: by outflank-mailman (input) for mailman id 1157445;
 Fri, 07 Nov 2025 09:25:01 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=p32f=5P=bounce.vates.tech=bounce-md_30504962.690dbae9.v1-ad12cbaac6fb4d7884dc7cefd8e5539d@srs-se1.protection.inumbo.net>)
 id 1vHIiK-0004T1-W2
 for win-pv-devel@lists.xenproject.org; Fri, 07 Nov 2025 09:25:01 +0000
Received: from mail179-26.suw41.mandrillapp.com
 (mail179-26.suw41.mandrillapp.com [198.2.179.26])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a0ea3932-bbbb-11f0-980a-7dc792cee155;
 Fri, 07 Nov 2025 10:24:58 +0100 (CET)
Received: from pmta12.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail179-26.suw41.mandrillapp.com (Mailchimp) with ESMTP id
 4d2ttx3wZTzKsbJD8
 for <win-pv-devel@lists.xenproject.org>; Fri,  7 Nov 2025 09:24:57 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 ad12cbaac6fb4d7884dc7cefd8e5539d; Fri, 07 Nov 2025 09:24:57 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a0ea3932-bbbb-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1762507497; x=1762777497;
	bh=j+totV5RnXCtvgh168YfbMRPyQ/EwtMnsImibhD98eA=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=zvjKzs8mzlgRmvwsXTl0L/JS51hUTJBnQ9enK7xU9x5BxXL3+aiYXyziURgcuNLcX
	 ozCyjJcMTqgsLT2nf3guxa+oUUFqMruKsUXoJmXuoGlXwgN/w4zDB6TGzopYXZ3JDw
	 gt5y3KZ4ZsCmhj7E9dhTxysJweCNogvechKFkLLtbkr5fdJtQFp/0lmHAY5bR7cr+4
	 v5yoYpBo4Dp6YEm5VG1KrV6J5H1MDLHZjG/hf8EVdDWDyeuomNngKWWxZHcEOGXY8D
	 O+lXa+PgxZZBiM9YUGxi11qYGjivp1mjmRuajItcMfdI8CcvWRputHux9xTrilC8zH
	 fWmxeuALXi27g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1762507497; x=1762767997; i=ngoc-tu.dinh@vates.tech;
	bh=j+totV5RnXCtvgh168YfbMRPyQ/EwtMnsImibhD98eA=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=trP5ELPuw7hdOBwAeHb5fb1ajVBf+Y4wFwf+fy97Y8hAKPOK8HbdWWk2Y2uOgySIU
	 hxwQ79G2AWwhaq0MmDa91pMXNdhMywhL/rQAO0avunhxwZ2QjL2rDvSknuBSQ9/xRD
	 7J/YHAD9cw6Z4bGqwqlB3P5v7JIdJtDV7OPVd/QvpBTkslEDhEv/ymiJIm+u+b+5LD
	 qU8HbLq7SWjKNyFRzjyAi3+4wbgKbDJejdEgx5u5ygF9ZcsNc8I1RYRbXK060pmD+q
	 ilyfknFqXbB6LRQPAcnVGoSHhOqXtZ5kxCn1SXiq/d3neH3X29rK4YbuzRrPcuiUsX
	 837qlJgmBnzig==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=20v2=202/3]=20Limit=20retry=20in=20ControllerGetResponse?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1762507496695
Message-Id: <3372b56c-48ca-4463-8343-7f5f7d2f73ce@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251106141835.2008-1-ngoc-tu.dinh@vates.tech> <20251106141835.2008-3-ngoc-tu.dinh@vates.tech> <SA1PR03MB7098A8A9E5ECB61C975B5198FEC3A@SA1PR03MB7098.namprd03.prod.outlook.com>
In-Reply-To: <SA1PR03MB7098A8A9E5ECB61C975B5198FEC3A@SA1PR03MB7098.namprd03.prod.outlook.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.ad12cbaac6fb4d7884dc7cefd8e5539d?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251107:md
Date: Fri, 07 Nov 2025 09:24:57 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 07/11/2025 10:11, Owen Smith wrote:
> 
> Would keeping a count of the number of STATUS_TIMEOUTs returned by ControllerGetResponse() and breaking out of the loop after 50 timeouts be simpler?
> Or is it required to query the time to ensure a more accurate poll?
> 
> Owen
> 

The timeout calculation is not required, I just thought it makes more 
sense to base the timeout calculation on actual time rather than 
multiplying the loops.

> ________________________________________
> From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf of Tu Dinh <ngoc-tu.dinh@vates.tech>
> Sent: 06 November 2025 2:18 PM
> To: win-pv-devel@lists.xenproject.org
> Cc: Tu Dinh
> Subject: [PATCH v2 2/3] Limit retry in ControllerGetResponse
> 
> During unplug, NDIS may issue a hash reconfiguration. However, the
> backend may disappear before the request has had a chance to complete.
> This is observable by e.g. adding a delay at the beginning of
> VifReceiverSetHashAlgorithm and unplugging. If this happens, Xenvif will
> get stuck waiting forever in ControllerGetResponse, at DISPATCH_LEVEL to
> boot.
> 
> Limit the total wait time from calling EvtchnWait to 5 seconds, and
> return an error code to the caller if the wait has failed.
> 
> Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
> ---
>   src/xenvif/controller.c | 36 +++++++++++++++++++++++++++++++-----
>   1 file changed, 31 insertions(+), 5 deletions(-)
> 
> diff --git a/src/xenvif/controller.c b/src/xenvif/controller.c
> index e032972..6a091d6 100644
> --- a/src/xenvif/controller.c
> +++ b/src/xenvif/controller.c
> @@ -246,9 +246,11 @@ fail1:
> 
>   #define TIME_US(_us)        ((_us) * 10)
>   #define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
> +#define TIME_S(_s)          (TIME_MS((_s) * 1000))
>   #define TIME_RELATIVE(_t)   (-(_t))
> 
> -#define XENVIF_CONTROLLER_POLL_PERIOD 100 // ms
> +#define XENVIF_CONTROLLER_POLL_PERIOD   TIME_MS(100)
> +#define XENVIF_CONTROLLER_MAX_WAIT      TIME_S(5)
> 
>   _IRQL_requires_(DISPATCH_LEVEL)
>   static NTSTATUS
> @@ -257,10 +259,15 @@ ControllerGetResponse(
>       OUT PULONG                      Data OPTIONAL
>       )
>   {
> -    LARGE_INTEGER                   Timeout;
> +    LARGE_INTEGER                   PollTimeout;
> +    LARGE_INTEGER                   MaxTimeout;
> +    LARGE_INTEGER                   Start;
>       NTSTATUS                        status;
> 
> -    Timeout.QuadPart = TIME_RELATIVE(TIME_MS(XENVIF_CONTROLLER_POLL_PERIOD));
> +    PollTimeout.QuadPart = TIME_RELATIVE(XENVIF_CONTROLLER_POLL_PERIOD);
> +    MaxTimeout.QuadPart = TIME_RELATIVE(XENVIF_CONTROLLER_MAX_WAIT);
> +
> +    KeQuerySystemTime(&Start);
> 
>       for (;;) {
>           ULONG   Count;
> @@ -279,9 +286,27 @@ ControllerGetResponse(
>                                  &Controller->EvtchnInterface,
>                                  Controller->Channel,
>                                  Count + 1,
> -                               &Timeout);
> -        if (status == STATUS_TIMEOUT)
> +                               &PollTimeout);
> +        if (status == STATUS_TIMEOUT) {
> +            LARGE_INTEGER       Now;
> +            LONGLONG            Delta;
> +
> +            KeQuerySystemTime(&Now);
> +
> +            // Relative timeout
> +            Delta = Now.QuadPart - Start.QuadPart;
> +            if (Delta > -MaxTimeout.QuadPart)
> +                break;
> +
>               __ControllerSend(Controller);
> +        }
> +    }
> +
> +    // Use STATUS_TRANSACTION_TIMED_OUT as an error code since STATUS_TIMEOUT is
> +    // a success code.
> +    if (Controller->Response.id != Controller->Request.id) {
> +        status = STATUS_TRANSACTION_TIMED_OUT;
> +        goto done;
>       }
> 
>       ASSERT3U(Controller->Response.type, ==, Controller->Request.type);
> @@ -311,6 +336,7 @@ ControllerGetResponse(
>       if (NT_SUCCESS(status) && Data != NULL)
>           *Data = Controller->Response.data;
> 
> +done:
>       RtlZeroMemory(&Controller->Request,
>                     sizeof (struct xen_netif_ctrl_request));
>       RtlZeroMemory(&Controller->Response,
> --
> 2.51.0.windows.2
> 
> 
> 
> --
> Ngoc Tu Dinh | Vates XCP-ng Developer
> 
> XCP-ng & Xen Orchestra - Vates solutions
> 
> web: https://vates.tech
> 
> 
> 



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Fri Nov 07 10:42:31 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 07 Nov 2025 10:42:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1157490.1486245 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vHJvJ-0006YY-2Y; Fri, 07 Nov 2025 10:42:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1157490.1486245; Fri, 07 Nov 2025 10:42:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vHJvI-0006YR-W9; Fri, 07 Nov 2025 10:42:28 +0000
Received: by outflank-mailman (input) for mailman id 1157490;
 Fri, 07 Nov 2025 10:42:28 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7WPv=5P=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vHJvI-0006YC-0B
 for win-pv-devel@lists.xenproject.org; Fri, 07 Nov 2025 10:42:28 +0000
Received: from CH5PR02CU005.outbound.protection.outlook.com
 (mail-northcentralusazlp170120005.outbound.protection.outlook.com
 [2a01:111:f403:c105::5])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7339acf3-bbc6-11f0-980a-7dc792cee155;
 Fri, 07 Nov 2025 11:42:26 +0100 (CET)
Received: from SA1PR03MB7098.namprd03.prod.outlook.com (2603:10b6:806:338::6)
 by SA1PR03MB6372.namprd03.prod.outlook.com (2603:10b6:806:1b7::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9298.12; Fri, 7 Nov
 2025 10:42:22 +0000
Received: from SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15]) by SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15%6]) with mapi id 15.20.9298.007; Fri, 7 Nov 2025
 10:42:22 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7339acf3-bbc6-11f0-980a-7dc792cee155
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=NXCFwA7kN42ffLan5ofYd/HKcyDIYHSZxrXBJEz1oDviHw1J/72NSpFd3kHHOxTpj/S20qkm7zQl6k7N/4CI/WZ+MEQvR/CG1y4wQGAD42/PXIQLfrDmEORUtC5eUfmFoQ4hPusa+1asoZwG6AxAMLoHgmNKtWa8V+ZHOY10O7/cyesSrrKP09ILoeNnKsDBWri5uwUp3GFhzngmumJvA9zvP05C37kYvgo4SS6fk9dozAn3fb89ZK9LhkyW0khZ6YcCv1idO8sw4DOpaFD+HOCdKIlu7PVeN024k+BYqSnFE8K+psUpsilZku0gpOnrQKvPi9Umqiw+rXepXIUe4Q==
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=+hV/qltB9lOINDj/82iFbiPHFfDdm4xlZthkLIpgh4Q=;
 b=HoJdw0M98mzNuHhncm+2Nq+MmXWc76zMRqfHKSlNMAOfjzoDYpbhHyAuolI0lpUS/hdeT1xgt8T7a9t53EgU34PaQBQnBOL8C2fMRN6pxVC6rvyfsnxht2SndevvVBLfcxSgJaFQpPSeTKQQulJNvP/5W9mPMlpnrMtuEaVz7n1cMW5mUBZY523PjUopKOL8scr7H5P3XDQIqcWWJcvkDYnu2wIMQUl8wQdPmPegfdOpbBZP6rRXPcDjqfkYzFx5yookRRTDH2kO6ajEe9MS/evlQBio8PMgg1HnMAHfVuFDXgDg32xkGQXVtbWBs14M1xzZwLP/hKy2rqkR244fKQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+hV/qltB9lOINDj/82iFbiPHFfDdm4xlZthkLIpgh4Q=;
 b=s/y409s+3OntJpMMDEMUqWXeDKq/2B3SbTznZ71BiaPrEYse+VHYqtF1hHwnqK7VAx65aZWuw390YrpSPVeaXrjq1TkOK/tQ6ok76G0pkqbRkVTP4NiLOz0qdDEdftffFFLj401apIULslbgJmL4NWqFI+V8XbCzSq+ZIomM2gs=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 2/3] Limit retry in ControllerGetResponse
Thread-Topic: [PATCH v2 2/3] Limit retry in ControllerGetResponse
Thread-Index: AQHcTyhPf4yajOGgv025SjSgwRoOp7Tm7gP8gAAEcICAABVgMg==
Date: Fri, 7 Nov 2025 10:42:22 +0000
Message-ID:
 <SA1PR03MB709884D1EBC472E732A2C053FEC3A@SA1PR03MB7098.namprd03.prod.outlook.com>
References: <20251106141835.2008-1-ngoc-tu.dinh@vates.tech>
 <20251106141835.2008-3-ngoc-tu.dinh@vates.tech>
 <SA1PR03MB7098A8A9E5ECB61C975B5198FEC3A@SA1PR03MB7098.namprd03.prod.outlook.com>
 <3372b56c-48ca-4463-8343-7f5f7d2f73ce@vates.tech>
In-Reply-To: <3372b56c-48ca-4463-8343-7f5f7d2f73ce@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA1PR03MB7098:EE_|SA1PR03MB6372:EE_
x-ms-office365-filtering-correlation-id: 39cda4a8-863e-4a8a-6780-08de1dea551f
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|376014|366016|38070700021|13003099007;
x-microsoft-antispam-message-info:
 =?us-ascii?Q?be9c0l7c4dpnMidVyUqEunnRKczrbKyvHKPBHIQ6J7OLmSij/W7F86N4w1zr?=
 =?us-ascii?Q?NkGRUe5H/29S/nHBNvzQQ5rZS9asu3+Caaywlc/gzMnGw6R+d4z1yEzHN+lq?=
 =?us-ascii?Q?RqrsLYOF4lEzvq/lAxkbb9GZwnzPQOMH5np5NiAUqV5YLfJKs48kugy3kOjS?=
 =?us-ascii?Q?m8Fg8Svp74eaR5sR3ir+Kwx/7xDUN52Jyd3x/ttVJogKyPAnISaZuN7Iiz3b?=
 =?us-ascii?Q?5aJe7T5IL2ef7+N31njYy29EtXlR6bwuXQhULFcj2WCTnkjvcf60QDVKqUCH?=
 =?us-ascii?Q?AUNtt/n9mCTQQhkb9MhiGuUH6Ush9uWrE2OsB2XVGwdVr9EFX373dVofwEeu?=
 =?us-ascii?Q?/H4o+OOefcJlpwPUZUBWXNdnIzaR8aY5jtkcInfHpO2mIzKphZd2dIa/xtCp?=
 =?us-ascii?Q?SABUtG+kn4GlFIOjjgv05oKpbp+hMefbXHeGUbVIv8DuzjORFA8Gc5JFpJff?=
 =?us-ascii?Q?pLd391GyOik9zR42ypg/sYjffI1NdJS7UVoyQxTMgFsnC5izlw+Uo3D4bjJE?=
 =?us-ascii?Q?578WivBBMSts7bYqsfQ3MR3QgcAPAgUExhN6Xiaz2Mj+3F8Qn/XECBTzVmlq?=
 =?us-ascii?Q?qW57eyCIG6W6D2BAs9rJGi1XqrENelmnbgeNy33DwXpMrw8OLz7KHLq1w0q0?=
 =?us-ascii?Q?MlXqPi9mFXNh9yW3G1A5GQPxhGVUX/rI0a9M9gSWefJTh5nem8RfifbD4LXN?=
 =?us-ascii?Q?VlL46Tzoo9lFU8qm0/aUTEQUcHvEfJEATuPjBH+JF9eJHzQi2B8dvdotsFKV?=
 =?us-ascii?Q?J+gmzuihgTn60/Cl0AY+sm0gTrNVlGvuMm/jTq/3BOg4LQDYq28FwcCcHjY4?=
 =?us-ascii?Q?iKRlqbapFoJynkXZdYXYAFZ8dsh36F9TMwy003x/lWDnoXL6hzLdYdzMiz1S?=
 =?us-ascii?Q?hxxMhF42dy+3VBxYYP5OgbYINTSXPhkfuZUQgjIzptD+ocuWgQ2FqXSe+Fi9?=
 =?us-ascii?Q?/vHFc+OERcmtABG9wZabhhlegXTFJKATfdW1byKMA2Yy4gFuE8q7hgw0VyqD?=
 =?us-ascii?Q?tk/epvZ0RO6COUHeJHMrwnqZ3x0CQA1nryF9E5hVwPs/RzlpB7FT6gRnmbka?=
 =?us-ascii?Q?MB9tXFwdyD5Umk5Qr2iamrwrmsb1kMU3jp/jkaU61NQR633MFWnFrcuhFMdp?=
 =?us-ascii?Q?iWQ8B8SEaUXefBiG58B63ggvJKIVIXPl1Kn4XIxbn18deL8x6NC5zZph7yTb?=
 =?us-ascii?Q?Av8dEp6updovtbQRZesePEhaElTVsneV4BYau/z63tja88p0f17Y7zp+oIc3?=
 =?us-ascii?Q?sOYfZ7373VeTYiNHE/NVBb78WYPLL0RANQkNVY65YbE4xg1vDOZkPWJsuwWd?=
 =?us-ascii?Q?h4n12db7bCohyUJDbJXkrQzRi+hOlndtwlBeLfi+wPSQAJX7zELsWSkoBUVv?=
 =?us-ascii?Q?PSJJhqvn3VwLWLTQ/U1dhhEQeiXjQXfJw5j6aHsYGu2h1Blm2z5oftXQCnzU?=
 =?us-ascii?Q?RoVd2DhL+Z+u4m4cDrSO85G237WRGgMp?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR03MB7098.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(38070700021)(13003099007);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?Wd9gqpF5OMtpbCYmqddfqcKHlnhv8IGx8t3QLh/s+0DjtaO8kYZA9SiYXubP?=
 =?us-ascii?Q?g/UOYO1wjZiPkCyE7rnGhH8d5AbqZsmfV3yaPqmpPgrf2/UGZ98zToSqiT2O?=
 =?us-ascii?Q?X35tNA8eW93cpDoR8sqBGjFGy5bSzmnzfILtVSGVnZgjvdbJXMifX9Jekj6T?=
 =?us-ascii?Q?gRotBs3hyR+mKSzMehdWkdn9sOaVL2LdinOQICXrCMQmBAORHVeU8KuKmkFn?=
 =?us-ascii?Q?V6WDrYiyX1HDgWLr/6xohV33FlM9zouxRSKICGx/4Q3aRjzFmaAviAU48ol5?=
 =?us-ascii?Q?IG3zx5lQiHOlYJz5Tp5Xw4ATAbPvyA3E8n1xFFqKmQncrTT02j7Hba/6cBlS?=
 =?us-ascii?Q?VUpx1AJ5Da+Bf1Zjy28ndovP0tVcnh6fJ+Nxsg70KKurnO/PhTfgXEG4p9xK?=
 =?us-ascii?Q?xdwgLOUokPHKd/UWB/Amd/rP8kC4URqCH2XJ7Rk8lQj05ygkt8ZRzwgbRZ38?=
 =?us-ascii?Q?YBnjLq/KnJGu7AYkArN31z9xy0Aei8ono+GmCixff2vEScbvzNmPgSmmZOr7?=
 =?us-ascii?Q?7J2xPzWpYojN6WyW/611lE7GntvOrZHJdhvx7p1dn+D+WKHvknCxWBBDcGS2?=
 =?us-ascii?Q?A83nEPUHfcPrhfURtReC2b5UkY23/97s3DvOgtxLbcgSP6fO0kEA7D5sZkY/?=
 =?us-ascii?Q?GQEW3je9T2XsNX2qJcxQESuU0D6AfB4ZuNGLY/1DRZwijvsHq+MhX9+YUqoQ?=
 =?us-ascii?Q?wU8NFc5C4jKV9csZDSv6bS62MLzRx8oDmRmQEGIJttKUWuleEyK4um4jRerd?=
 =?us-ascii?Q?9QoxaUT595fYeuWZX2WbqIULYWFz3Gveznj96515n3vxlsXldHAPscizCnIP?=
 =?us-ascii?Q?fZLUoZKaRNoPwVY8KdSEBcEA8Iq56lzcZqzkJ6ca1w8QaSHoLNcpaBG+AW6i?=
 =?us-ascii?Q?mSI4HinIcMcw9OgyGIcp7wmok+9NV/ZurIXGP/4de9A2uiyytpuc3HxuEzdD?=
 =?us-ascii?Q?kZ+hM+jPgwq6uasZXpAI3kR9SGvhhJZm0NkD26ru4FixLnx0XLSH0BjPCyIz?=
 =?us-ascii?Q?knsu8NYZfqzkQHZ8gMeTZi30GjIdcF0yXkWIs94u4cDcapJF/sVDn3/iIY6w?=
 =?us-ascii?Q?MKp6f4LUz40ugbBLphiUaj600vWFRGrFrOUuQywKeEiEl0upC9PT3VKhmril?=
 =?us-ascii?Q?oR3bBqyuHaxsvHbe/I1yw6eFrPr83VWQwSWwmdDYC0v0/qsqRBvvxF1mjO6Q?=
 =?us-ascii?Q?yCeNUJ/OSojC9mHwAmzJm0z/xrOTp50jovLXSTEVSXcWYoM8MSuW0boIXAwy?=
 =?us-ascii?Q?z9301/9E7gkCNSSjcZa4+oezzoHAXxInFVqtnASkmS45AIMNWiziVvY6vKzi?=
 =?us-ascii?Q?R1jAXYIJb6y1fWaGUCw+7rUly03VR4zpVPbZLAbE0lVT7h5jdJxfp7iAyHB7?=
 =?us-ascii?Q?VRu9LI+RUVOKwTmvkNDthxXLL9IrG9lFqZ3W9XtzjbUEDECvhB5gjAUQTzJW?=
 =?us-ascii?Q?2eVxuLeRSNsFQ+WDbpGB4YgnCmG/Dm4zxcBIqkXnA7EwfobvYcvVq2EWvrER?=
 =?us-ascii?Q?4K5iA3QTvmBtgdzBiTOOeV1kjJ9AGYoKYinLbxA2jh/fwgenynWr0TTtZmdR?=
 =?us-ascii?Q?rrhMGy5TdxmvCU92GzAcYtsR2bjGMR8/ehq729/q?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA1PR03MB7098.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 39cda4a8-863e-4a8a-6780-08de1dea551f
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2025 10:42:22.0281
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: eDZejAdPXMxqKA0FOUDXABJQ2iZ1zvFca8HekIbUwA8J/1GP3/QFd6bY+16HiTbjf+6NhMSOmkT/yHP38y3NPA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6372

Ok,

Reviewed-by: Owen Smith <owen.smith@citrix.com>

________________________________________
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
Sent: 07 November 2025 9:24 AM
To: Owen Smith; win-pv-devel@lists.xenproject.org
Subject: Re: [PATCH v2 2/3] Limit retry in ControllerGetResponse

On 07/11/2025 10:11, Owen Smith wrote:
>
> Would keeping a count of the number of STATUS_TIMEOUTs returned by Contro=
llerGetResponse() and breaking out of the loop after 50 timeouts be simpler=
?
> Or is it required to query the time to ensure a more accurate poll?
>
> Owen
>

The timeout calculation is not required, I just thought it makes more
sense to base the timeout calculation on actual time rather than
multiplying the loops.

> ________________________________________
> From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf =
of Tu Dinh <ngoc-tu.dinh@vates.tech>
> Sent: 06 November 2025 2:18 PM
> To: win-pv-devel@lists.xenproject.org
> Cc: Tu Dinh
> Subject: [PATCH v2 2/3] Limit retry in ControllerGetResponse
>
> During unplug, NDIS may issue a hash reconfiguration. However, the
> backend may disappear before the request has had a chance to complete.
> This is observable by e.g. adding a delay at the beginning of
> VifReceiverSetHashAlgorithm and unplugging. If this happens, Xenvif will
> get stuck waiting forever in ControllerGetResponse, at DISPATCH_LEVEL to
> boot.
>
> Limit the total wait time from calling EvtchnWait to 5 seconds, and
> return an error code to the caller if the wait has failed.
>
> Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
> ---
>   src/xenvif/controller.c | 36 +++++++++++++++++++++++++++++++-----
>   1 file changed, 31 insertions(+), 5 deletions(-)
>
> diff --git a/src/xenvif/controller.c b/src/xenvif/controller.c
> index e032972..6a091d6 100644
> --- a/src/xenvif/controller.c
> +++ b/src/xenvif/controller.c
> @@ -246,9 +246,11 @@ fail1:
>
>   #define TIME_US(_us)        ((_us) * 10)
>   #define TIME_MS(_ms)        (TIME_US((_ms) * 1000))
> +#define TIME_S(_s)          (TIME_MS((_s) * 1000))
>   #define TIME_RELATIVE(_t)   (-(_t))
>
> -#define XENVIF_CONTROLLER_POLL_PERIOD 100 // ms
> +#define XENVIF_CONTROLLER_POLL_PERIOD   TIME_MS(100)
> +#define XENVIF_CONTROLLER_MAX_WAIT      TIME_S(5)
>
>   _IRQL_requires_(DISPATCH_LEVEL)
>   static NTSTATUS
> @@ -257,10 +259,15 @@ ControllerGetResponse(
>       OUT PULONG                      Data OPTIONAL
>       )
>   {
> -    LARGE_INTEGER                   Timeout;
> +    LARGE_INTEGER                   PollTimeout;
> +    LARGE_INTEGER                   MaxTimeout;
> +    LARGE_INTEGER                   Start;
>       NTSTATUS                        status;
>
> -    Timeout.QuadPart =3D TIME_RELATIVE(TIME_MS(XENVIF_CONTROLLER_POLL_PE=
RIOD));
> +    PollTimeout.QuadPart =3D TIME_RELATIVE(XENVIF_CONTROLLER_POLL_PERIOD=
);
> +    MaxTimeout.QuadPart =3D TIME_RELATIVE(XENVIF_CONTROLLER_MAX_WAIT);
> +
> +    KeQuerySystemTime(&Start);
>
>       for (;;) {
>           ULONG   Count;
> @@ -279,9 +286,27 @@ ControllerGetResponse(
>                                  &Controller->EvtchnInterface,
>                                  Controller->Channel,
>                                  Count + 1,
> -                               &Timeout);
> -        if (status =3D=3D STATUS_TIMEOUT)
> +                               &PollTimeout);
> +        if (status =3D=3D STATUS_TIMEOUT) {
> +            LARGE_INTEGER       Now;
> +            LONGLONG            Delta;
> +
> +            KeQuerySystemTime(&Now);
> +
> +            // Relative timeout
> +            Delta =3D Now.QuadPart - Start.QuadPart;
> +            if (Delta > -MaxTimeout.QuadPart)
> +                break;
> +
>               __ControllerSend(Controller);
> +        }
> +    }
> +
> +    // Use STATUS_TRANSACTION_TIMED_OUT as an error code since STATUS_TI=
MEOUT is
> +    // a success code.
> +    if (Controller->Response.id !=3D Controller->Request.id) {
> +        status =3D STATUS_TRANSACTION_TIMED_OUT;
> +        goto done;
>       }
>
>       ASSERT3U(Controller->Response.type, =3D=3D, Controller->Request.typ=
e);
> @@ -311,6 +336,7 @@ ControllerGetResponse(
>       if (NT_SUCCESS(status) && Data !=3D NULL)
>           *Data =3D Controller->Response.data;
>
> +done:
>       RtlZeroMemory(&Controller->Request,
>                     sizeof (struct xen_netif_ctrl_request));
>       RtlZeroMemory(&Controller->Response,
> --
> 2.51.0.windows.2
>
>
>
> --
> Ngoc Tu Dinh | Vates XCP-ng Developer
>
> XCP-ng & Xen Orchestra - Vates solutions
>
> web: https://vates.tech
>
>
>



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Fri Nov 07 10:42:39 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 07 Nov 2025 10:42:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1157491.1486250 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vHJvT-0006aP-4f; Fri, 07 Nov 2025 10:42:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1157491.1486250; Fri, 07 Nov 2025 10:42:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vHJvT-0006aI-1c; Fri, 07 Nov 2025 10:42:39 +0000
Received: by outflank-mailman (input) for mailman id 1157491;
 Fri, 07 Nov 2025 10:42:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7WPv=5P=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vHJvR-0006a6-5j
 for win-pv-devel@lists.xenproject.org; Fri, 07 Nov 2025 10:42:37 +0000
Received: from CH4PR04CU002.outbound.protection.outlook.com
 (mail-northcentralusazlp170130007.outbound.protection.outlook.com
 [2a01:111:f403:c105::7])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7848d2ab-bbc6-11f0-9d17-b5c5bf9af7f9;
 Fri, 07 Nov 2025 11:42:35 +0100 (CET)
Received: from SA1PR03MB7098.namprd03.prod.outlook.com (2603:10b6:806:338::6)
 by SA1PR03MB6372.namprd03.prod.outlook.com (2603:10b6:806:1b7::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9298.12; Fri, 7 Nov
 2025 10:42:32 +0000
Received: from SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15]) by SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15%6]) with mapi id 15.20.9298.007; Fri, 7 Nov 2025
 10:42:32 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7848d2ab-bbc6-11f0-9d17-b5c5bf9af7f9
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=rdDYLDn3TiLxSuiIqzD4QeiaZtl9HS54ACfnzAe31AXgN+Ay8Q2FUNAzt7QV2WYOtzjgCr6boZY1HfwJgd7oPqljGVkUbR7yLhW8E+yjcqKcOWWaMjPFdDwlAnpGVJZIwS0ACBJVwoy+loIgoiR/hfcYJ16JdQqtS0WnGw+oP+0MB9DEd+pbDXXf7Xop5C8eEY8lBlCdNCT9X1DfIM8CgFFFGUkvZhoBdR2YUuLdqcu4BcfaqVKpjzC052QHlbFyj1AkiBOsnrR4LWTfyuQsOJ8ohdRc1wxTG5WaS19l7wT8Z0D3Stt3qOGwerC0HRFD1O1kOv3IuFtBvZBp9lZ/nw==
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=d7a7EX7e1ayF2VBXCr3P+zBF8PjPwnHjzYYpiFuGysw=;
 b=kx4tSe3QyTkaNgJxley/V8Vj+MTyyimNt1Nb3OwERa8Ez2l7Wg3Ey9QJ981vrdH08mo6BVqcMsafmgOzDpa58/K4e1D+VXFGxrTVjQWN3k227E4YmcdYy89strapt19S58PZhkV4DqFrDKGSCR2x1k/bHioel+eii21S4qn8rPTMWQHYIpHgIjkfK0eUQ8D82gLEPEyOFog8AYZjgXN6T7LgOItuKmGQT28my+5kYkOSC9jow20oPV7bPYDisBfrQEKLUnKKAmga68ycDAU8nkgSWVvmPmUfbM+25NPQe42nntKDstrdS5AXjshFLCUD3yywv76PLBdXzTrwMQ94gw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=d7a7EX7e1ayF2VBXCr3P+zBF8PjPwnHjzYYpiFuGysw=;
 b=oCrSfjcRD783SNZ0x+hapctcljHKW9a6IINDSVp4uINzAnJadWWD8Itr1mWE8aqN5DwuQCl3bs8FtmpzREWEzWZcXCQR8vU8pCen6GFBH1EXnIw+K3rKn5c09n19V+xfeCYS7Z8HfiqxrawJlDAzZ4FhbcAj0eKfZm9ji7B0a70=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 3/3] Check controller enable status in PutRequest
Thread-Topic: [PATCH v2 3/3] Check controller enable status in PutRequest
Thread-Index: AQHcTyhRhWZANU2EpkiXk97h/U2+HLTnCBvO
Date: Fri, 7 Nov 2025 10:42:32 +0000
Message-ID:
 <SA1PR03MB7098CCF878ED785F769F0E3BFEC3A@SA1PR03MB7098.namprd03.prod.outlook.com>
References: <20251106141835.2008-1-ngoc-tu.dinh@vates.tech>
 <20251106141835.2008-4-ngoc-tu.dinh@vates.tech>
In-Reply-To: <20251106141835.2008-4-ngoc-tu.dinh@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA1PR03MB7098:EE_|SA1PR03MB6372:EE_
x-ms-office365-filtering-correlation-id: 462f0941-c184-46fa-4f0d-08de1dea5b1f
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|376014|366016|38070700021;
x-microsoft-antispam-message-info:
 =?us-ascii?Q?o8qvxqbWbyzSfdw7PmvBJdYhTHV1befEQh8N5Mpe8GrKn09TBJw2aW/MygLY?=
 =?us-ascii?Q?gJ4RC+htT4w5cCygIpB5qFUaDCsfJxcHprj2TC3UkPJaYVOTbxk2brMNTTgT?=
 =?us-ascii?Q?aNwwevj/VbdiK6eEVgdUOQDJFXrketInaQmqeZkpLY8Yo+HTkmXPw2majeuI?=
 =?us-ascii?Q?xM2hQPJ6ZdmpsMdudNGQBGTmqcOe/ehjYacaS/h3DyPcnAJNqSWHiTyIFtH2?=
 =?us-ascii?Q?H343aeq3RwNBQY1t+TX1o0E9CYt3ZichrHzV/fJEIaLFqVAloBeTTYiMatv2?=
 =?us-ascii?Q?NG4Jkz0Qbdk+Z09SEpcuxUILlXQ9aiheyu7VdrkAiVwGDBq0g+FAhT3c9yg0?=
 =?us-ascii?Q?6oZwv9Zow6++/ccSIs3jVKRkj2oiR7xGbVbGB7nDs9BwrKIdnZZRgwkHImRk?=
 =?us-ascii?Q?NPb/dl5X41ggqc1Dm4cW80or6ET2rCBD8qsqZD9RzXUvArjwZHGgyFXkYTyt?=
 =?us-ascii?Q?c1h4HuDgOe0PEGLSSxwEQncWMt5sOGnYMy5z0DAgIbiDbKSY1Aqa+AIcBBIU?=
 =?us-ascii?Q?/SiUIt8C+iihDkl584i0dCaFokQplEG1BTB6xbA73SOuqsHMrT3gaid46pIi?=
 =?us-ascii?Q?+Gke1QMKswcKSIG7kQRJNZLbEgyMkWmqwaOqyuXEpDzpSeNgHwRir2ct1lNX?=
 =?us-ascii?Q?X7khC2Nvxge3t1zfxbjb/JG5Un3mQBN4CO7sSpNzKLWU9OgHxSMOFVRUTk2b?=
 =?us-ascii?Q?Bonet7yZoyFHdJE2WsDps6We3RVSUHohBiPV193yWarP9h8oNl0uHrBt/Pfb?=
 =?us-ascii?Q?bKtIFap7sNflOTkmotRuOr9LcNU4buMah9u8zvLSGJWOUrlPQhFvatgro9g7?=
 =?us-ascii?Q?51X5ef3WfQFicF2G9WQq9YIt16uyxCHTK9RGyPd6x/IoDeSY1+pHeeJEfNB7?=
 =?us-ascii?Q?VrqMAO01bRu9XHsDdmVtvNedyXxhGDf7/JFPqM9Xvl/1CLHPKBsKx3mQP+uv?=
 =?us-ascii?Q?aDKq269o7qgDfaXAtuhY+nm5SLe7MQl2M385GZLVuaOgruLR3SrryHDiBtfK?=
 =?us-ascii?Q?Ylyzppy5nBwWYyJzsf5JAW9VBRxrvBoH8D9jlJYwps4W/x5pPCqz5l81z4NP?=
 =?us-ascii?Q?+Da6j+N7YkWnjIEJu7G0V+7KREIXShTQ1uqkWHjavqepxdxqQRoSMN3VBVwE?=
 =?us-ascii?Q?g9LuyCXNJIjYarf7AeXninTpJ7a45rBGvaYLxEA8klZQs/BvEVnSBpfb+E0E?=
 =?us-ascii?Q?gcllKXP81WVDeNXwUJZZEbVe2Av/PdgeWQqJekYN3jo8a/fFRKGJ0EQF0Ely?=
 =?us-ascii?Q?cGvmvVBNOhmOc3eKGawMUclCUi0QD0Tafzco0qo/nt+W93dN+yUSzZVZNkYX?=
 =?us-ascii?Q?J3XXgB+UsLnXeSa6eDva/+/3p8xZF9pIsQr1oBoMyayShwVhpnQIcHRHpunE?=
 =?us-ascii?Q?Ob21nBYVOtvkqAo6zWhqVyeUJMGkqEaFxd/LYkDjH84C9vVW2Hm8hRX6/u/5?=
 =?us-ascii?Q?0yT1JlUFOu2h9q7UddT/S5cu4880E1kj?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR03MB7098.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(38070700021);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?xcBGBDZluFCw+PZprwzChs3DLWkNLgwhM733oTdC/FSbFljcu+3hycX2LWOm?=
 =?us-ascii?Q?XOM3tkrkVTv6N8LNpcZtjEG7OnzhUqdmFJvhLEIwMhpFnOwkHsjxjOtomx9A?=
 =?us-ascii?Q?7A18O5FmUf3EMkQyCIhSixjwSH4rSWAQlvnF1HVXdJNKx5X+sO9umr3fQCdh?=
 =?us-ascii?Q?9CI80EfPlvyjTP2H/1cvBHVbqYZsKzLhBlYtvooTbfCl0wq5owgQX/ECufVg?=
 =?us-ascii?Q?Qn9dY2bDTfM7BSDESwunwFywefKN7/6ozJ0NFqu+pbwGFgRqzfT5SAjQAlHw?=
 =?us-ascii?Q?iBupTA7p7FPDkQNxsb3P8pYK5H+FdPKi0UKT3FXwcUNyZsL5yWyPOYmFDKAm?=
 =?us-ascii?Q?s1CUxHTrGyx7fAoiDwdnbeIHxRN4NeGiiL4b0AFKIrM9MUkVedJ1LbE5ljne?=
 =?us-ascii?Q?g19EGD1Fu88wAt8DiSU2Sw36CBlQ5QIxr3Qjj3+tVNwVJc6ZXNoBk579DYkR?=
 =?us-ascii?Q?vzOf3B7Hi5jqfW0i0TX3z0NN/JUoV97g9ngn90KF52Ab4XnrBypN1pnwF4yM?=
 =?us-ascii?Q?oXnn749aBWshzhhcxg+PhNQGSRRgwuRc9HBBzn793apS3nszXn3v8YxzedvI?=
 =?us-ascii?Q?dVahLwUFXq+9C0oibWimtMEjwM4i6ihIzpqIZQYf8FhiOvnerv8Iyvzmfly2?=
 =?us-ascii?Q?H8OluovMQOtOBJ1xApADZb2UH+mfRrQ82off2Xw3bw4qQSjOvCCro4n9z3Oa?=
 =?us-ascii?Q?X+wkImM3CEfK2cCvUfuXg2gbTdI8nBGVT/P7PYwzbzKu0/Z3P8F3yCe0sVWa?=
 =?us-ascii?Q?Jp+kgqIhmllMSvlcS4DOjV/Fm/zZZI68qckCXrw575tCJpsNed7ESSPCCh23?=
 =?us-ascii?Q?KCTeg/+RB3zEzZyGp3OK19YhfuDGgjmfH6FPgNML4dSiU+wISeHwgYkbSzIN?=
 =?us-ascii?Q?m6tfSsBmNajA1LCt0qGxz08i8tAaVVCY7O0Le9LiILmfWUeL7gOngQAS8LWO?=
 =?us-ascii?Q?lri38PL+S72CP2PPwh8RjmZK3W51zC1yX/XTD46IkyQ6bAq9R+S6ju0+8ydA?=
 =?us-ascii?Q?kcrivY+5XuYIoLZS+8YFf/ZwaLqwTGViEvy5F3+bQsIw6kP0HqHbEh9tfnbr?=
 =?us-ascii?Q?3LbzhbBQ/YeasAUeeUOU9wgifH1BuTWnDFiCzWlyty0fT/o4g0nmaEYKRqEF?=
 =?us-ascii?Q?NAxySgG3IsLS2sMGOaxeVxFxNgRV7VtdSDoSx6DFGAvhJCfFKY2YmUL2Yj/8?=
 =?us-ascii?Q?0o1NJxeO8FndmGveI1V0MrnATgVhz/1gqsY8+sS0Vqil6+JCskYQ5N2HGIqF?=
 =?us-ascii?Q?698zJeiCB59bqRqZlFySMnjphYxwcvHJZW2l2XZDVHnCPpfU3p1e0ibeG9gB?=
 =?us-ascii?Q?EMqHLZDuJkvMnaxFuUpwP40zl3Bw0TuRu4y1QsNWdcu11XArPNDpHkOtW5PD?=
 =?us-ascii?Q?o+CLWcD53vueAHVLNParBtAxd0eVAYn+EAU2WrUUMD03O5OVN5JmkzccSjc6?=
 =?us-ascii?Q?W9ys3ydSC3QM4q20KpHys9LgXopf0/DwrXe2Kq8DwOa9jEUNyOT8e9Jizxaw?=
 =?us-ascii?Q?aL6hysJDrgf7El363U6vXojGPhnYj9DlLsdiBArBk01+hy9/BZH+L6CgF58f?=
 =?us-ascii?Q?Zi6kEc2PX2v0t5DhxJO3kLZ5SgusXBq0LWOItrRm?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA1PR03MB7098.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 462f0941-c184-46fa-4f0d-08de1dea5b1f
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2025 10:42:32.1149
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: W1YK4Dc35Gcot/KolIVzlWnr5DczF7NLoh2jDfw33OsFwBTB/4yIHD4TiZHkBmmzPDOMzEW82PApzMseuePV8g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6372

Reviewed-by: Owen Smith <owen.smith@citrix.com>

________________________________________
From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf of=
 Tu Dinh <ngoc-tu.dinh@vates.tech>
Sent: 06 November 2025 2:18 PM
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh
Subject: [PATCH v2 3/3] Check controller enable status in PutRequest

Add a Controller->Enabled flag to signify whether the controller
currently accepts requests.

Check this flag in ControllerPutRequest instead of Controller->Connected.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xenvif/controller.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/xenvif/controller.c b/src/xenvif/controller.c
index 6a091d6..ca854ef 100644
--- a/src/xenvif/controller.c
+++ b/src/xenvif/controller.c
@@ -72,6 +72,7 @@ struct _XENVIF_CONTROLLER {
     PXENBUS_EVTCHN_CHANNEL              Channel;
     ULONG                               Events;
     BOOLEAN                             Connected;
+    BOOLEAN                             Enabled;
     USHORT                              RequestId;
     struct xen_netif_ctrl_request       Request;
     struct xen_netif_ctrl_response      Response;
@@ -194,7 +195,7 @@ ControllerPutRequest(
     NTSTATUS                        status;

     status =3D STATUS_NOT_SUPPORTED;
-    if (!Controller->Connected)
+    if (!Controller->Enabled)
         goto fail1;

     status =3D STATUS_INSUFFICIENT_RESOURCES;
@@ -688,7 +689,11 @@ ControllerEnable(
     IN  PXENVIF_CONTROLLER      Controller
     )
 {
-    UNREFERENCED_PARAMETER(Controller);
+    __ControllerAcquireLock(Controller);
+
+    Controller->Enabled =3D TRUE;
+
+    __ControllerReleaseLock(Controller);

     Trace("<=3D=3D=3D>\n");
 }
@@ -698,7 +703,11 @@ ControllerDisable(
     IN  PXENVIF_CONTROLLER      Controller
     )
 {
-    UNREFERENCED_PARAMETER(Controller);
+    __ControllerAcquireLock(Controller);
+
+    Controller->Enabled =3D FALSE;
+
+    __ControllerReleaseLock(Controller);

     Trace("<=3D=3D=3D>\n");
 }
--
2.51.0.windows.2



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




From win-pv-devel-bounces@lists.xenproject.org Fri Nov 07 10:42:42 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Fri, 07 Nov 2025 10:42:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1157492.1486254 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vHJvW-0006cr-6o; Fri, 07 Nov 2025 10:42:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1157492.1486254; Fri, 07 Nov 2025 10:42:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vHJvW-0006ck-3h; Fri, 07 Nov 2025 10:42:42 +0000
Received: by outflank-mailman (input) for mailman id 1157492;
 Fri, 07 Nov 2025 10:42:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7WPv=5P=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vHJvU-0006a6-Am
 for win-pv-devel@lists.xenproject.org; Fri, 07 Nov 2025 10:42:40 +0000
Received: from CH4PR04CU002.outbound.protection.outlook.com
 (mail-northcentralusazlp170130007.outbound.protection.outlook.com
 [2a01:111:f403:c105::7])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7b05e9d7-bbc6-11f0-9d17-b5c5bf9af7f9;
 Fri, 07 Nov 2025 11:42:39 +0100 (CET)
Received: from SA1PR03MB7098.namprd03.prod.outlook.com (2603:10b6:806:338::6)
 by CH8PR03MB8276.namprd03.prod.outlook.com (2603:10b6:610:2c1::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9298.13; Fri, 7 Nov
 2025 10:42:37 +0000
Received: from SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15]) by SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15%6]) with mapi id 15.20.9298.007; Fri, 7 Nov 2025
 10:42:37 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7b05e9d7-bbc6-11f0-9d17-b5c5bf9af7f9
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=XyrXLp5uuNzGpdwlVPrdaHkm/6MJnRkxE/MNV1xNg4VMlsIZ1EJdvR3zZuOZ218mmJUR/p5n9LOW1pbJCHNmgl6HbHhfi8XTF2QeExaQS5OWNEmLhyY6LYlEtbT318WN0xgPOEpvm1a105OECYJL3OgiCR9Zlo/kEXnYz77AO3rFgsPLaAas4sT4g6rR4CqCoFcuRf7JOO+LJuD1uEb8iThigBCHDk8ESs9jY/q3P4jX4dTewJdI7WgcB4RN41ApIrm/3aTSCSPBB7J4i/m0pMJpJxUCAdT31zblEBCRv6CfJVo3MoHmAgTwKdz3F2q95uCdL9Gs1V/OTUUfK0Uavw==
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=cV5zxiWvdAAA/l1apzFgZtva8mlUj9nUSymRGVHWXlc=;
 b=dps6MLeDWszYqxdjny5oTPEm8JLLvUxSWzxZumWV+uJfhQ9F1Jrh4fF03pNcNOiGNFXCxmsyqsgDowYrnB/LDH1WJdi3Kf3k65iM9820DzlYQBl21Mjug2YTAu3NJDMDzkURC9n7hK5hgAoha4yk5m6lglfcqaX1plshNRuwL+B3+7ZRhcfdWSLj4cUFn7J663w3TNFUvppjz2Kvmj1xGyQ7Xdb3VaZf/X6bmcxBSDjkmXCe35nFEI8kQJf4yT4jtJWUoOXJg1EAkSISXH1e4Aq11QAPHGhHzTSc60/vHARLaBaBcGtoszaL/bt02UAJZe8pWQ0KOx/De7Ejz8az9g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=cV5zxiWvdAAA/l1apzFgZtva8mlUj9nUSymRGVHWXlc=;
 b=gMuLc8CN5uoktoLNodTL+2SQfrmoYb5FOTuv2iDYy+9MSzYHOGG3KKzOw4RaTfCUjV/yQ+lY65/VV0vTaw2spP91hflGN2e09MHBEIDChLPU4l2A5PQxyeWl0wfY4dXPoCkHSU3BUoQIg0obvi3P2lR74o0qcoHOm4Ldv+Iy08M=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 1/3] Revert 4e080f819b55 "Skip hash update if front...
Thread-Topic: [PATCH v2 1/3] Revert 4e080f819b55 "Skip hash update if front...
Thread-Index: AQHcTyhO19ZVmQYnrkGvhe7nGOlEjLTnCCPI
Date: Fri, 7 Nov 2025 10:42:36 +0000
Message-ID:
 <SA1PR03MB7098BCDC471A58F4A1E6047BFEC3A@SA1PR03MB7098.namprd03.prod.outlook.com>
References: <20251106141835.2008-1-ngoc-tu.dinh@vates.tech>
 <20251106141835.2008-2-ngoc-tu.dinh@vates.tech>
In-Reply-To: <20251106141835.2008-2-ngoc-tu.dinh@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA1PR03MB7098:EE_|CH8PR03MB8276:EE_
x-ms-office365-filtering-correlation-id: a1b7e369-f528-4ce7-1923-08de1dea5e05
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|366016|1800799024|376014|38070700021;
x-microsoft-antispam-message-info:
 =?us-ascii?Q?ZWV9oMd1vxdU5Ady7ufb204tPZfFl+xSv9i14aAdR/ivD3bRZTnivB4WCKip?=
 =?us-ascii?Q?FkFcUu2Td2Mvi/yyXi3tQwSrZdVET0PqaVHr3edTUrp3laqJNTvc6EgFPZg8?=
 =?us-ascii?Q?VbAcQ1xolDxUPU8aGebRoNEUTr/lyuq4lQXAKzlaIlfupoS+FL1criMPlxEv?=
 =?us-ascii?Q?Z1UKb5/qK3F5DySM9mDHpRl6lLufD3C2wxulw8KVLgr8uUFKsKP9vFHB9EwH?=
 =?us-ascii?Q?RWpIYe0Ifxtc3W3F1UT8RXJx8eiiTDsiKTkp7hLVSQTT5zLis4Jb+zjBKsGq?=
 =?us-ascii?Q?KX5Q2aZf07Iaehu2GJmbMbCJtQ2aJBmj3N7ldWmX4YJQUxVXRmRKH7PIbu7M?=
 =?us-ascii?Q?NWaY/RaJLZhhMvDMYu7f/GRPjKpYpuSacug44nJzKujiAbS5eQ8Mn+wHTxVs?=
 =?us-ascii?Q?VOjPGWWX3jLrOIHYq862LXXNSVU8D3P3gnXFecHccKk2QC19pK8J7C/RvDHY?=
 =?us-ascii?Q?G+WZ6ETBUHz74ufxNYgdq6doTG7HYzjbyuXx4PSH9vqOhHTQoZXME/HR9HC8?=
 =?us-ascii?Q?lyi5j3Mr51YB5WXzqsn0RcVD2uQAa3eIznxjfFx32CJwa6bdHYXRs41TJQ7i?=
 =?us-ascii?Q?S6mhSujMwoo3n67nSexznON7TM0aqSbLTyOQxNeawjTX5rONTVxW/fYzVuY3?=
 =?us-ascii?Q?jpXrFP9BKY4775jIBJCTpzNTUp+hjW6vwJPK9DjoBMYrp62+dfpxZyOOodKX?=
 =?us-ascii?Q?2y29KT0gThd/07mrCjCnxXBaX3h+uGKVZnBFEsyZPH/9Y3apy/EEmPshWfwH?=
 =?us-ascii?Q?9zrLQYhMP6Et7a+3r9kmHG16W6HkCcU9EeIyEu5uIaiGDyIaSFm6NcMrNJg3?=
 =?us-ascii?Q?Mj+65yhXndxkF2d6Ohp9MUrIJKXJc3OV38Dgq0GrcxchFbi+Hn4arwdfZCb0?=
 =?us-ascii?Q?ZJ9GxONo1M0jPvXKsuEUGDS2t6dzLFW15VJ8WS/qXY+Kfr4fHIUVSeH9gooa?=
 =?us-ascii?Q?LkEf0JjZjkEj0wraXGzeVebWuuE8zU8JW7LnSbeq4iNn+txNrvkr40/otz/O?=
 =?us-ascii?Q?ebwZzZJ6NwvwiFvuGqC/ri5t4R4T/y3xG2LhQUhBMLRhi1BfKBdqpv5gGrSM?=
 =?us-ascii?Q?6lwj8StlE6cA1g0o3Wg7fIzu7MuFUJNv1xhxR/fRmQHK7tV7SKVzsCqpuBW4?=
 =?us-ascii?Q?jx6XkKg64DFE0LQZGb3PXps0TGDATbbM7WH3aWaYd+b25cyns9LQ0o7RQHi5?=
 =?us-ascii?Q?ucWYgKDU4rYGSemATUtQpovuFlogS+82WvlKiaHVem4sd9sxmZt86EFLgEU4?=
 =?us-ascii?Q?g5fG4zU22PQOxUJsma/PEDVh3/50GhSwYUQsqA1MEXbqsYNGrtT1JsNAUH69?=
 =?us-ascii?Q?xaaW5qaWUPn0kmg3Fky37mF+eynJ/vRCGa0FMzZ34LlZilShbGqWgU5GDfgg?=
 =?us-ascii?Q?vkY81AbBx+1J25L3NQtOrwnrfoEQspoqaEXVNh1PaWmvg5zYZ32Vx5PJ4L1y?=
 =?us-ascii?Q?HYtdQgQPkHeKylqc4+aGImnbiEIaTFEr?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR03MB7098.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(38070700021);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?w40oDioMMSgoJ93UYC6Pan57qMY6cn8lNDg5HmOU9hFNwtxhcnd97hc2c9Cu?=
 =?us-ascii?Q?8u6wALLdqrPtt5dTIQX0sDuNOPu16hGBe9kkVPsJ0tB8PgrMk6ue21maYRxC?=
 =?us-ascii?Q?OzHEo3N3CQbZX5GymL9ea7a+lQTe6nxFR0ShBORe0uw8vybDkrT7q37UL51W?=
 =?us-ascii?Q?IrT/pskTL5VCz71qsUgIYxxFpyZrucMI9S6y3+FHFHZUiYNhAv6d0gE0OBXo?=
 =?us-ascii?Q?QogZDho9rFSpXWn5qLt29BC9Vgcbb4dw21NGGbecoHrGo/4HTMOT8WnY2Vul?=
 =?us-ascii?Q?2mpEckAydeFq5oIy12folK6aLD/od4XIEBcpnEVKs3D62FAvPRpLKedb6R+V?=
 =?us-ascii?Q?dl1jV1RDP0czgClfdrhlwfeQ+V9OJBK5KCwAF79kPF/ZRCeUa5+FtqN1x2W/?=
 =?us-ascii?Q?aVLtkLj99wJ0yYTg7iAMxJsfmOTlVyTuzjcPr7ol4rebqf5kvjqkOqx3O40/?=
 =?us-ascii?Q?ZbGnZnixXt3Cy89lXSeha1sjPiOK/uD4UE319QpBr5a9sc+MMuDQiSdmWJVG?=
 =?us-ascii?Q?vF5kgW394xZgFu6XaW9FN83MT9n/Rij9TvU9bM1ZKqFZUiVKVKla5hX3nScg?=
 =?us-ascii?Q?CKN2tL/kYZnBr1z742kLv0GCGonAOxtHvf6BCvuVPlXXDEeg/3BCrQd9dIRV?=
 =?us-ascii?Q?gTlppOH1TTLxVyOrXcrT28/qzhMguOXpmfNIZ8Rq4hzk8q0YglQ8DqleNxSf?=
 =?us-ascii?Q?VAW1RQjqEuGLlvgU+LrD4Ro4Tw9OBFoABosvp21IcQoOo1+tIoQP7x2evSkQ?=
 =?us-ascii?Q?YMxz2aSWxVSiomkpfEAuzVEI++TciMN0bfKiJ5ZXts4WI7S8YomeHRXxFqel?=
 =?us-ascii?Q?ul1LtnjLQdetgIpfjvWw5aYRvncxAOsU+sKhm/KV3LbI5UYphGqfoil/r5TG?=
 =?us-ascii?Q?JkJR0yyiTMEs1f6ePbJLSoNI/gBP2cLulcMYYn8GGVNfp02zD/utOl1VmJjb?=
 =?us-ascii?Q?C9v2MIoF8y5jp8eyHVqsOVJipKyd4lwyzWM3nrlvEoVNqN5Tr+n64dZdtz+m?=
 =?us-ascii?Q?TPFlHrtofZcyp+0e8p46o6UWncrzYGUgD5HSqiA7OWkeAY28dTepUNdXcoEo?=
 =?us-ascii?Q?td35Ko25J5qMmjZWe9ueopM9Ub0aJXeA1jKsiCTNQVlx9h4tXunXTofAyv5t?=
 =?us-ascii?Q?2hf4sW0xtqVFxCVJe4eGyHsiHmpKpiyBQTxTYpLXP1PeNgeZX/6xc0GMGR2H?=
 =?us-ascii?Q?OWhidzWOD6X+sgcSWTHWwalxLxRPqVNyJhptGd+KD1FThP8Lo33Ca4StXmyF?=
 =?us-ascii?Q?3LfD4+kND3fwWUFGziCLBd5+jjn8CmBESX9bqEYbiM66Ukx77oQ5N1r7T2+D?=
 =?us-ascii?Q?bowRYqjuyGCENzM4kUNmSGyuK4zsJm5h4pKHhZUHovlS3tTjUQBMEX0yjfi7?=
 =?us-ascii?Q?34JyGUQ8ZabG92u17qZaG5LpQejdm1nTbc8Jx1OPut4Rp/scBanpekexkaNN?=
 =?us-ascii?Q?LV7TwQd+2oL+W0xUgT2AfCoiNSKB3+x9V9gEuWTaAWaKyRwQhasns9WOZKbj?=
 =?us-ascii?Q?MZikG1xwQts4SAxmAd31rpcfQyHGP9dekI1iB9GQ/VGEyXRKNtNGMevwoKXj?=
 =?us-ascii?Q?KIqr00K3EfEF/+XOnI+iUBAKhHPkp2x5JQH+Lbav?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA1PR03MB7098.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a1b7e369-f528-4ce7-1923-08de1dea5e05
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2025 10:42:36.9983
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: EuYOzl8wlA/oazHO5xMcvA8+RBr4em445XWHKxtnJKjsI8kBilMi4q1rUct4XtjZsFIsGnD7OgcfsdWfT+3beg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH8PR03MB8276

Reviewed-by: Owen Smith <owen.smith@citrix.com>

________________________________________
From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf of=
 Tu Dinh <ngoc-tu.dinh@vates.tech>
Sent: 06 November 2025 2:18 PM
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh
Subject: [PATCH v2 1/3] Revert 4e080f819b55 "Skip hash update if front...

...end is not enabled"

NDIS queries the supported hash types before the frontend is enabled.
Controller requests are not dependent on the frontend being enabled to
begin with.

Allow such requests to go through.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xenvif/frontend.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/xenvif/frontend.c b/src/xenvif/frontend.c
index f844a42..5311dea 100644
--- a/src/xenvif/frontend.c
+++ b/src/xenvif/frontend.c
@@ -1910,9 +1910,6 @@ __FrontendUpdateHash(
     ULONG                   Flags;
     NTSTATUS                status;

-    if (Frontend->State !=3D FRONTEND_ENABLED)
-        goto done;
-
     Controller =3D __FrontendGetController(Frontend);

     switch (Hash->Algorithm) {
--
2.51.0.windows.2



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




From win-pv-devel-bounces@lists.xenproject.org Mon Nov 10 19:13:59 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 10 Nov 2025 19:13:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1158690.1487065 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIXKu-0004Q3-Rz; Mon, 10 Nov 2025 19:13:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1158690.1487065; Mon, 10 Nov 2025 19:13:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIXKu-0004Pv-OO; Mon, 10 Nov 2025 19:13:56 +0000
Received: by outflank-mailman (input) for mailman id 1158690;
 Mon, 10 Nov 2025 19:13:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=bmG7=5S=bounce.vates.tech=bounce-md_30504962.6912396d.v1-0a65a5d84dc5417aa226aca38f0b19b3@srs-se1.protection.inumbo.net>)
 id 1vIXKt-0004Pp-6D
 for win-pv-devel@lists.xenproject.org; Mon, 10 Nov 2025 19:13:55 +0000
Received: from mail136-17.atl41.mandrillapp.com
 (mail136-17.atl41.mandrillapp.com [198.2.136.17])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 64281b35-be69-11f0-9d18-b5c5bf9af7f9;
 Mon, 10 Nov 2025 20:13:53 +0100 (CET)
Received: from pmta11.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail136-17.atl41.mandrillapp.com (Mailchimp) with ESMTP id
 4d4zq14fn0zPm0WDl
 for <win-pv-devel@lists.xenproject.org>; Mon, 10 Nov 2025 19:13:49 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 0a65a5d84dc5417aa226aca38f0b19b3; Mon, 10 Nov 2025 19:13:49 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 64281b35-be69-11f0-9d18-b5c5bf9af7f9
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1762802029; x=1763072029;
	bh=rWh/EQ8eK2yFq8l5f8b5kXItg73QquCaTDQWNMDFi+g=;
	h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From;
	b=Va4D1iSehco2dL6LLUCRe8wHovMwuTZmmYnTf/09lxMfJ5LpXrprcgiH0x6SXQaiQ
	 XXL3zzSRyXVQJ9Il5oatuycUcJT/0LgTqJoKYyw4B7FoB3K6NTtK78vVf3W2w+JCP9
	 u/UyN50v/TBHDBzhYBRCTdPBYsAnaJM12pEE0pqq+BaPj4dNeEZjbzf+Vi6UKipxTS
	 z0xrUO6X0DlfhssZ6jeWPXFr6ciLUhwrWTQeUVV5Ysz5mMa71Kwti4yggFPz/cAJk6
	 odqiJ00dA+dos0BwTmvYWW6OFijVoE3pPP+bdMRJQUn4frg0JilAdMn2IdrbcDxB+D
	 o93rapQrt4jAg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1762802029; x=1763062529; i=ngoc-tu.dinh@vates.tech;
	bh=rWh/EQ8eK2yFq8l5f8b5kXItg73QquCaTDQWNMDFi+g=;
	h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From;
	b=rYLvp1rYsh4LZzyV+r+63c7Ng1Qd0iI8nIav0wjzf+Eh+UHB7BBl25sqy7UOyvCRp
	 ykqLW5i6KPgkSDNIRkTHmiW14hswu62qIBD047zrtacjs5GRu+72MIreoOC0SsnM+/
	 Qah+D2b/vIcGO0I8Mz0EBT7ctxAMmyj3uKMc1FDaw+nZbuz4Y2w1cIwzSpW9JQg8Ae
	 a1mchyYzxUN5ZbodLloXAe+GcqJTiFqZKe4LSwUTTK1nFZQdWug0oyZlZBBeqKNv8Z
	 047AzIC+l20ExLkybZb8gb8VfvnszU8dyk3fxpF+hKd/vzTjnC/Ty4vWiUD1AHBDLy
	 wycclwby+OfsQ==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?[PATCH]=20Correct=20system=20time=20calculation?=
X-Mailer: git-send-email 2.51.0.windows.2
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1762802028883
To: win-pv-devel@lists.xenproject.org
Cc: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Message-Id: <20251110191346.1847-1-ngoc-tu.dinh@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.0a65a5d84dc5417aa226aca38f0b19b3?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251110:md
Date: Mon, 10 Nov 2025 19:13:49 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

SharedInfoGetTime uses the naive formula ((Tsc << TscShift) *
TscSystemMul) >> 32 to calculate the current system time. However, there
are two issues: firstly, TscShift may be negative (to indicate a right
shift); and secondly, multiplying the shifted Tsc with TscSystemMul will
throw away the result's upper 64 bits.

Adjust for negative shift amounts and use UnsignedMultiplyExtract128 to
correctly perform the multiplication.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xenbus/shared_info.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/xenbus/shared_info.c b/src/xenbus/shared_info.c
index 06e0aec..fe29470 100644
--- a/src/xenbus/shared_info.c
+++ b/src/xenbus/shared_info.c
@@ -356,6 +356,7 @@ SharedInfoGetTime(
     ULONGLONG                       NanoSeconds;
     ULONGLONG                       Timestamp;
     ULONGLONG                       Tsc;
+    ULONGLONG                       Age;
     ULONGLONG                       SystemTime;
     ULONG                           TscSystemMul;
     CHAR                            TscShift;
@@ -404,10 +405,15 @@ SharedInfoGetTime(
     KeLowerIrql(Irql);
 
     // Number of elapsed ticks since timestamp was captured
-    Tsc -= Timestamp;
+    Age = Tsc - Timestamp;
+    if (TscShift < 0)
+        Age >>= -TscShift;
+    else
+        Age <<= TscShift;
+    Age = UnsignedMultiplyExtract128(Age, TscSystemMul, 32);
 
     // Time in nanoseconds since boot
-    SystemTime += ((Tsc << TscShift) * TscSystemMul) >> 32;
+    SystemTime += Age;
 
     Trace("WALLCLOCK TIME AT BOOT: Seconds = %llu NanoSeconds = %llu\n",
           Seconds,
-- 
2.51.0.windows.2



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Tue Nov 11 08:34:31 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 11 Nov 2025 08:34:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1158820.1487231 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjpe-00078x-6s; Tue, 11 Nov 2025 08:34:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1158820.1487231; Tue, 11 Nov 2025 08:34:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjpe-00078q-4A; Tue, 11 Nov 2025 08:34:30 +0000
Received: by outflank-mailman (input) for mailman id 1158820;
 Tue, 11 Nov 2025 08:34:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=es58=5T=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vIjpc-00077S-Ji
 for win-pv-devel@lists.xenproject.org; Tue, 11 Nov 2025 08:34:28 +0000
Received: from na1pdmzitismtp02.tibco.com (unknown [160.101.131.9])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3c1d3009-bed9-11f0-9d18-b5c5bf9af7f9;
 Tue, 11 Nov 2025 09:34:28 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id D56E280C8CA2;
 Tue, 11 Nov 2025 03:33:04 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3c1d3009-bed9-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [PATCH 2/7] Add support for CodeQL 2.20.1
Date: Tue, 11 Nov 2025 08:34:12 +0000
Message-ID: <20251111083418.1657-3-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251111083418.1657-1-owen.smith@citrix.com>
References: <20251111083418.1657-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Owen Smith <owen.smith@cloud.com>

CodeQL 2.20.1 uses a different query file to previous versions, and relies
on using different query packs, which need to be present on the system.

Adds CODEQL_QUERY_FILE environment variable to force a specific query file, if set.

Also adds "--threads=0" parameter, to use alll available CPUs.

https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/static-tools-and-codeql

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 msbuild.ps1 | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index 83b6928..9484a8d 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -110,7 +110,8 @@ Function Run-CodeQL {
 		[string]$Name,
 		[string]$Configuration,
 		[string]$Platform,
-		[string]$SearchPath
+		[string]$SearchPath,
+		[string]$QueryFile
 	)
 
 	$projpath = Resolve-Path (Join-Path $SolutionPath $Name)
@@ -154,8 +155,10 @@ Function Run-CodeQL {
 	$c += " database"
 	$c += " analyze "
 	$c += $database
-	$c += " windows_driver_recommended.qls"
+	$c += " "
+	$c += $QueryFile
 	$c += " --format=sarifv2.1.0"
+	$c += " --threads=0"
 	$c += " --output="
 	$c += $sarif
 	$c += " --search-path="
@@ -199,8 +202,22 @@ if ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database"
 
+	$queryfile = "windows_driver_recommended.qls"
+	Try {
+		$ver = New-Object System.Version((& "codeql" "--version")[0].Split(" ")[-1] + "0")
+		Write-Host -ForegroundColor Cyan "INFO: CodeQL version " $ver
+		$minver = New-Object System.Version("2.20.1.0")
+		if ($ver -ge $minver) {
+			$queryfile = "mustfix.qls"
+		}
+	} Catch {
+	}
+	if (-not [string]::IsNullOrEmpty($Env:CODEQL_QUERY_FILE)) {
+		$queryfile = $Env:CODEQL_QUERY_FILE
+		Write-Host -ForegroundColor Cyan "INFO: Overwriting codeql query file to " $queryfile
+	}
 	ForEach ($project in $ProjectList) {
-		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath $queryfile
 	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Nov 11 08:34:31 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 11 Nov 2025 08:34:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1158819.1487227 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjpd-00077m-5s; Tue, 11 Nov 2025 08:34:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1158819.1487227; Tue, 11 Nov 2025 08:34:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjpd-00077f-2t; Tue, 11 Nov 2025 08:34:29 +0000
Received: by outflank-mailman (input) for mailman id 1158819;
 Tue, 11 Nov 2025 08:34:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=es58=5T=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vIjpb-00077S-UN
 for win-pv-devel@lists.xenproject.org; Tue, 11 Nov 2025 08:34:27 +0000
Received: from na1pdmzitismtp02.tibco.com (unknown [160.101.131.9])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3b27ca5b-bed9-11f0-9d18-b5c5bf9af7f9;
 Tue, 11 Nov 2025 09:34:26 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 462D080C8C9E;
 Tue, 11 Nov 2025 03:33:03 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3b27ca5b-bed9-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@cloud.com>
Subject: [PATCH 1/7] Refactor msbuild.ps1
Date: Tue, 11 Nov 2025 08:34:11 +0000
Message-ID: <20251111083418.1657-2-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251111083418.1657-1-owen.smith@citrix.com>
References: <20251111083418.1657-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Owen Smith <owen.smith@cloud.com>

Moves all repo specific data to a 'Globals' section, and simplifies the
structure so that it can be common across all drivers.

Also seperates DVL log generation from SDV build, so that DVL logs
can be created for CodeQL builds without SDV.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
---
 msbuild.ps1 | 67 +++++++++++++++++++++++++++++++++++------------------
 1 file changed, 45 insertions(+), 22 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index 64455ea..83b6928 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -12,6 +12,16 @@ param(
 	[switch]$CodeAnalysis
 )
 
+#
+# Globals
+#
+$SolutionName = "xenbus.sln"
+$ArchivePath = "xenbus"
+$ProjectList = @( "xen", "xenfilt", "xenbus" )
+
+#
+# Functions
+#
 Function Run-MSBuild {
 	param(
 		[string]$SolutionPath,
@@ -63,6 +73,24 @@ Function Run-MSBuildSDV {
 	Run-MSBuild $projpath $project $Configuration $Platform "Build"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
+
+	Set-Location $basepath
+}
+
+Function Run-MSBuildDVL {
+	param(
+		[string]$SolutionPath,
+		[string]$Name,
+		[string]$Configuration,
+		[string]$Platform
+	)
+
+	$basepath = Get-Location
+	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
+	Set-Location $projpath
+
+	$project = [string]::Format("{0}.vcxproj", $Name)
+
 	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
 	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
 
@@ -151,19 +179,15 @@ $solutionpath = Resolve-Path $SolutionDir
 
 Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
 
-if ($Type -eq "free") {
-	Run-MSBuild $solutionpath "xenbus.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
-}
-elseif ($Type -eq "checked") {
-	Run-MSBuild $solutionpath "xenbus.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+if (-Not (Test-Path -Path $archivepath)) {
+	New-Item -Name $archivepath -ItemType Directory | Out-Null
 }
-elseif ($Type -eq "codeql") {
-	$archivepath = "xenbus"
 
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
-	}
+if (($Type -eq "free") -or ($Type -eq "checked")) {
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+}
 
+if ($Type -eq "codeql") {
 	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
 		$searchpath = Resolve-Path ".."
 	} else {
@@ -175,22 +199,21 @@ elseif ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database"
 
-	Run-CodeQL $solutionpath "xen" $configuration["codeql"] $platform[$Arch] $searchpath
-	Run-CodeQL $solutionpath "xenfilt" $configuration["codeql"] $platform[$Arch] $searchpath
-	Run-CodeQL $solutionpath "xenbus" $configuration["codeql"] $platform[$Arch] $searchpath
-
+	ForEach ($project in $ProjectList) {
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
+	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
-elseif ($Type -eq "sdv") {
-	$archivepath = "xenbus"
 
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
+if ($Type -eq "sdv") {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
 	}
+}
 
-	Run-MSBuildSDV $solutionpath "xen" $configuration["sdv"] $platform[$Arch]
-	Run-MSBuildSDV $solutionpath "xenfilt" $configuration["sdv"] $platform[$Arch]
-	Run-MSBuildSDV $solutionpath "xenbus" $configuration["sdv"] $platform[$Arch]
-
+if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
+	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Nov 11 08:34:33 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 11 Nov 2025 08:34:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1158821.1487236 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjph-0007B3-9s; Tue, 11 Nov 2025 08:34:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1158821.1487236; Tue, 11 Nov 2025 08:34:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjph-0007Av-5X; Tue, 11 Nov 2025 08:34:33 +0000
Received: by outflank-mailman (input) for mailman id 1158821;
 Tue, 11 Nov 2025 08:34:31 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=es58=5T=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vIjpf-0007A1-8I
 for win-pv-devel@lists.xenproject.org; Tue, 11 Nov 2025 08:34:31 +0000
Received: from na1pdmzitismtp02.tibco.com (na1pdmzitismtp02.tibco.com
 [160.101.131.9]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3a399cfd-bed9-11f0-980a-7dc792cee155;
 Tue, 11 Nov 2025 09:34:25 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id A1C9E80C8C8D;
 Tue, 11 Nov 2025 03:33:01 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3a399cfd-bed9-11f0-980a-7dc792cee155
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 0/7] xenbus cleanup patches
Date: Tue, 11 Nov 2025 08:34:10 +0000
Message-ID: <20251111083418.1657-1-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Refactors msbuild.ps1 and extends build support for additional tools. Similar
patches will be required for all other drivers.

Cleans up a few failure paths, in which error logging is not required, and can
add excess logging which can complicate log files.

Owen Smith (7):
  Refactor msbuild.ps1
  Add support for CodeQL 2.20.1
  Enable KASAN build support
  Set InterruptManagement values in HardwareKey
  Squash Error when LogLevel value is not present
  Remove Error logging from RangeSetPop
  Add ConfigFreeActive / ConfigFreeSzValue

 build.ps1              |  6 ++-
 include/xen.h          | 12 ++++++
 msbuild.ps1            | 97 +++++++++++++++++++++++++++++++-----------
 src/xen/config.c       | 22 +++++++++-
 src/xen/log.c          | 11 ++++-
 src/xenbus.inf         |  5 ++-
 src/xenbus/fdo.c       |  6 +--
 src/xenbus/range_set.c |  6 +--
 src/xenbus/unplug.c    |  2 +-
 9 files changed, 127 insertions(+), 40 deletions(-)

-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Nov 11 08:34:33 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 11 Nov 2025 08:34:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1158822.1487242 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjph-0007BU-EB; Tue, 11 Nov 2025 08:34:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1158822.1487242; Tue, 11 Nov 2025 08:34:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjph-0007B9-6h; Tue, 11 Nov 2025 08:34:33 +0000
Received: by outflank-mailman (input) for mailman id 1158822;
 Tue, 11 Nov 2025 08:34:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=es58=5T=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vIjpf-00077S-WF
 for win-pv-devel@lists.xenproject.org; Tue, 11 Nov 2025 08:34:32 +0000
Received: from na1pdmzitismtp02.tibco.com (unknown [160.101.131.9])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3e260b05-bed9-11f0-9d18-b5c5bf9af7f9;
 Tue, 11 Nov 2025 09:34:31 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 4822180C8C9F;
 Tue, 11 Nov 2025 03:33:08 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3e260b05-bed9-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 4/7] Set InterruptManagement values in HardwareKey
Date: Tue, 11 Nov 2025 08:34:14 +0000
Message-ID: <20251111083418.1657-5-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251111083418.1657-1-owen.smith@citrix.com>
References: <20251111083418.1657-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

InterruptManagement values should be stored under the hardware key, and this
fixes an issue reported by InfVerif although this issue does not block WHQL
qualification.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xenbus.inf | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/xenbus.inf b/src/xenbus.inf
index 10774b0..adc70bd 100644
--- a/src/xenbus.inf
+++ b/src/xenbus.inf
@@ -76,6 +76,9 @@ CopyFiles=XenBus_CopyFiles
 CopyFiles=Monitor_CopyFiles
 FeatureScore=0xFE
 
+[XenBus_Inst.HW]
+AddReg = XenBus_Interrupts
+
 [XenBus_Inst.Services]
 AddService=xenbus_monitor,%SPSVCSINST_STARTSERVICE%,Monitor_Service,Monitor_EventLog
 AddService=xenbus,%SPSVCINST_ASSOCSERVICE%,XenBus_Service
@@ -88,7 +91,7 @@ StartType=%SERVICE_BOOT_START%
 ErrorControl=%SERVICE_ERROR_NORMAL% 
 ServiceBinary=%12%\xenbus.sys 
 LoadOrderGroup="Boot Bus Extender"
-AddReg = XenBus_Parameters, XenBus_Interrupts, XenBus_Unplug
+AddReg = XenBus_Parameters, XenBus_Unplug
 
 [XenBus_Parameters]
 HKR,"Parameters",,0x00000010
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Nov 11 08:34:33 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 11 Nov 2025 08:34:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1158823.1487244 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjph-0007Bd-F9; Tue, 11 Nov 2025 08:34:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1158823.1487244; Tue, 11 Nov 2025 08:34:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjph-0007BK-86; Tue, 11 Nov 2025 08:34:33 +0000
Received: by outflank-mailman (input) for mailman id 1158823;
 Tue, 11 Nov 2025 08:34:32 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=es58=5T=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vIjpg-0007A1-1X
 for win-pv-devel@lists.xenproject.org; Tue, 11 Nov 2025 08:34:32 +0000
Received: from na1pdmzitismtp02.tibco.com (na1pdmzitismtp02.tibco.com
 [160.101.131.9]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3d304277-bed9-11f0-980a-7dc792cee155;
 Tue, 11 Nov 2025 09:34:30 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 6F68F80C8C9E;
 Tue, 11 Nov 2025 03:33:06 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3d304277-bed9-11f0-980a-7dc792cee155
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>,
	david ambu <david.preetham@cloud.com>
Subject: [PATCH 3/7] Enable KASAN build support
Date: Tue, 11 Nov 2025 08:34:13 +0000
Message-ID: <20251111083418.1657-4-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251111083418.1657-1-owen.smith@citrix.com>
References: <20251111083418.1657-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

KASAN (Kernel Address Sanitizer)
(see https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/kasan)
builds can be enabled when using the WDK 10.0.26100.2161 or later, and can be
used on specially prepared Windows 11 24H2 / Server 2025, or later, OSs.

KASAN enabled drivers should not generally deployed, as the OS needs to be
enabled, but these drivers can help track down illegal memory accesses and
similar issues.

Signed-off-by: david ambu <david.preetham@cloud.com>
---
 build.ps1   |  6 ++++--
 msbuild.ps1 | 11 ++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/build.ps1 b/build.ps1
index 42bbdde..1ec30ee 100644
--- a/build.ps1
+++ b/build.ps1
@@ -9,7 +9,8 @@ param(
 	[string]$SignMode = "TestSign",
 	[switch]$CodeQL,
 	[switch]$Sdv,
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -32,7 +33,8 @@ Function Build {
 		Arch = $Arch;
 		Type = $Type;
 		SignMode = $SignMode;
-		CodeAnalysis = $CodeAnalysis
+		CodeAnalysis = $CodeAnalysis;
+		Kasan = $Kasan
 		}
 	& ".\msbuild.ps1" @params
 	if ($LASTEXITCODE -ne 0) {
diff --git a/msbuild.ps1 b/msbuild.ps1
index 9484a8d..6f0755d 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -9,7 +9,8 @@ param(
 	[Parameter(Mandatory = $true)]
 	[string]$Type,
 	[string]$SignMode = "TestSign",
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -30,7 +31,8 @@ Function Run-MSBuild {
 		[string]$Platform,
 		[string]$Target = "Build",
 		[string]$Inputs = "",
-		[switch]$CodeAnalysis
+		[switch]$CodeAnalysis,
+		[switch]$Kasan
 	)
 
 	$c = "msbuild.exe"
@@ -46,6 +48,9 @@ Function Run-MSBuild {
 		$c += "/p:RunCodeAnalysis=true "
 		$c += "/p:EnablePREFast=true "
 	}
+	if ($Kasan) {
+		$c += "/p:EnableKASAN=true "
+	}
 
 	$c += Join-Path -Path $SolutionPath -ChildPath $Name
 
@@ -187,7 +192,7 @@ if (-Not (Test-Path -Path $archivepath)) {
 }
 
 if (($Type -eq "free") -or ($Type -eq "checked")) {
-	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis -Kasan:$Kasan
 }
 
 if ($Type -eq "codeql") {
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Nov 11 08:34:36 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 11 Nov 2025 08:34:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1158824.1487248 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjpk-0007GM-CO; Tue, 11 Nov 2025 08:34:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1158824.1487248; Tue, 11 Nov 2025 08:34:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjpk-0007GF-9V; Tue, 11 Nov 2025 08:34:36 +0000
Received: by outflank-mailman (input) for mailman id 1158824;
 Tue, 11 Nov 2025 08:34:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=es58=5T=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vIjpj-00077S-5u
 for win-pv-devel@lists.xenproject.org; Tue, 11 Nov 2025 08:34:35 +0000
Received: from na1pdmzitismtp02.tibco.com (unknown [160.101.131.9])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 400e14df-bed9-11f0-9d18-b5c5bf9af7f9;
 Tue, 11 Nov 2025 09:34:34 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 78D4780C8C9E;
 Tue, 11 Nov 2025 03:33:11 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 400e14df-bed9-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 6/7] Remove Error logging from RangeSetPop
Date: Tue, 11 Nov 2025 08:34:16 +0000
Message-ID: <20251111083418.1657-7-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251111083418.1657-1-owen.smith@citrix.com>
References: <20251111083418.1657-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Reduce logging to Trace, so its only displayed in checked builds.
Failures reported here would result in the range set being expanded, and
failures in expanding the range set will report errors.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xenbus/range_set.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/xenbus/range_set.c b/src/xenbus/range_set.c
index 76d04c4..ceed3b9 100644
--- a/src/xenbus/range_set.c
+++ b/src/xenbus/range_set.c
@@ -237,15 +237,15 @@ found:
     return STATUS_SUCCESS;
 
 fail3:
-    Error("fail3\n");
+    Trace("fail3\n");
 
 fail2:
-    Error("fail2\n");
+    Trace("fail2\n");
 
     KeReleaseSpinLock(&RangeSet->Lock, Irql);
 
 fail1:
-    Error("fail1 (%08x)\n", status);
+    Trace("fail1 (%08x)\n", status);
 
     return status;
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Nov 11 08:34:37 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 11 Nov 2025 08:34:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1158825.1487252 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjpl-0007Iq-DV; Tue, 11 Nov 2025 08:34:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1158825.1487252; Tue, 11 Nov 2025 08:34:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjpl-0007IS-Ah; Tue, 11 Nov 2025 08:34:37 +0000
Received: by outflank-mailman (input) for mailman id 1158825;
 Tue, 11 Nov 2025 08:34:37 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=es58=5T=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vIjpk-0007A1-V0
 for win-pv-devel@lists.xenproject.org; Tue, 11 Nov 2025 08:34:36 +0000
Received: from na1pdmzitismtp02.tibco.com (na1pdmzitismtp02.tibco.com
 [160.101.131.9]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3f16ad2f-bed9-11f0-980a-7dc792cee155;
 Tue, 11 Nov 2025 09:34:33 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id DE93880C8C8D;
 Tue, 11 Nov 2025 03:33:09 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3f16ad2f-bed9-11f0-980a-7dc792cee155
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 5/7] Squash Error when LogLevel value is not present
Date: Tue, 11 Nov 2025 08:34:15 +0000
Message-ID: <20251111083418.1657-6-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251111083418.1657-1-owen.smith@citrix.com>
References: <20251111083418.1657-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

LogLevel override values are usually not present, and this will reduce logging
which is not required.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 src/xen/log.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/xen/log.c b/src/xen/log.c
index a65b233..8673105 100644
--- a/src/xen/log.c
+++ b/src/xen/log.c
@@ -744,14 +744,20 @@ LogReadLogLevel(
     PANSI_STRING        Values;
     ULONG               Type;
     ULONG               Index;
+    BOOLEAN             SquashError;
     NTSTATUS            status;
 
+    SquashError = FALSE;
+
     status = RegistryQuerySzValue(Key,
                                   Name,
                                   &Type,
                                   &Values);
-    if (!NT_SUCCESS(status))
+    if (!NT_SUCCESS(status)) {
+        if (status == STATUS_OBJECT_NAME_NOT_FOUND)
+            SquashError = TRUE;
         goto fail1;
+    }
 
     status = STATUS_INVALID_PARAMETER;
     if (Type != REG_MULTI_SZ)
@@ -780,7 +786,8 @@ fail2:
     RegistryFreeSzValue(Values);
 
 fail1:
-    Error("fail1 (%08x)\n", status);
+    if (!SquashError)
+        Error("fail1 (%08x)\n", status);
 
     *LogLevel = LOG_LEVEL_NONE;
 
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Nov 11 08:34:38 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 11 Nov 2025 08:34:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1158826.1487256 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjpm-0007Ks-FM; Tue, 11 Nov 2025 08:34:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1158826.1487256; Tue, 11 Nov 2025 08:34:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIjpm-0007Ki-CX; Tue, 11 Nov 2025 08:34:38 +0000
Received: by outflank-mailman (input) for mailman id 1158826;
 Tue, 11 Nov 2025 08:34:38 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=es58=5T=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vIjpl-0007A1-VB
 for win-pv-devel@lists.xenproject.org; Tue, 11 Nov 2025 08:34:37 +0000
Received: from na1pdmzitismtp02.tibco.com (na1pdmzitismtp02.tibco.com
 [160.101.131.9]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4100667e-bed9-11f0-980a-7dc792cee155;
 Tue, 11 Nov 2025 09:34:36 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 1BD3680C8C93;
 Tue, 11 Nov 2025 03:33:12 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4100667e-bed9-11f0-980a-7dc792cee155
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH 7/7] Add ConfigFreeActive / ConfigFreeSzValue
Date: Tue, 11 Nov 2025 08:34:17 +0000
Message-ID: <20251111083418.1657-8-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251111083418.1657-1-owen.smith@citrix.com>
References: <20251111083418.1657-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Values returned by ConfigGetActive should be freed by ConfigFreeActive,
and values returned by ConfigQuerySystemStartOption should be freed by
ConfigFreeSzValue, so that pool tag tracking is correct.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 include/xen.h       | 12 ++++++++++++
 src/xen/config.c    | 22 ++++++++++++++++++++--
 src/xenbus/fdo.c    |  6 +++---
 src/xenbus/unplug.c |  2 +-
 4 files changed, 36 insertions(+), 6 deletions(-)

diff --git a/include/xen.h b/include/xen.h
index 7016c86..8691a0f 100644
--- a/include/xen.h
+++ b/include/xen.h
@@ -573,6 +573,12 @@ ConfigClearActive(
     VOID
     );
 
+XEN_API
+VOID
+ConfigFreeActive(
+    _In_ PSTR   Value
+    );
+
 XEN_API
 NTSTATUS
 ConfigRequestReboot(
@@ -587,4 +593,10 @@ ConfigQuerySystemStartOption(
     _Outptr_ PANSI_STRING   *Option
     );
 
+XEN_API
+VOID
+ConfigFreeSzValue(
+    _In_ PANSI_STRING       Array
+    );
+
 #endif  // _XEN_H
diff --git a/src/xen/config.c b/src/xen/config.c
index 99980a6..b7268c0 100644
--- a/src/xen/config.c
+++ b/src/xen/config.c
@@ -305,7 +305,7 @@ ConfigUpdateActive(
 
     status = ConfigGetActive("InstanceID", &ActiveInstanceID);
     if (NT_SUCCESS(status)) {
-        ExFreePool(ActiveInstanceID);
+        ConfigFreeActive(ActiveInstanceID);
     } else {
         RtlInitAnsiString(&Ansi[0], InstanceID);
 
@@ -319,7 +319,7 @@ ConfigUpdateActive(
 
     status = ConfigGetActive("LocationInformation", &ActiveLocationInformation);
     if (NT_SUCCESS(status)) {
-        ExFreePool(ActiveLocationInformation);
+        ConfigFreeActive(ActiveLocationInformation);
     } else {
         RtlInitAnsiString(&Ansi[0], LocationInformation);
 
@@ -408,6 +408,15 @@ fail1:
     return status;
 }
 
+XEN_API
+VOID
+ConfigFreeActive(
+    _In_ PSTR   Value
+    )
+{
+    __FreePoolWithTag(Value, 'SUB');
+}
+
 XEN_API
 NTSTATUS
 ConfigRequestReboot(
@@ -496,3 +505,12 @@ ConfigQuerySystemStartOption(
 {
     return RegistryQuerySystemStartOption(Key, Option);
 }
+
+XEN_API
+VOID
+ConfigFreeSzValue(
+    _In_ PANSI_STRING       Array
+    )
+{
+    RegistryFreeSzValue(Array);
+}
diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index e3de8b9..d093db8 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -806,7 +806,7 @@ fallback:
         if (Fdo->Active)
             (VOID) ConfigUpdateActive(DeviceID, InstanceID, LocationInformation);
 
-        ExFreePool(ActiveDeviceID);
+        ConfigFreeActive(ActiveDeviceID);
     } else {
         status = ConfigSetActive(DeviceID, InstanceID, LocationInformation);
         if (NT_SUCCESS(status))
@@ -5746,7 +5746,7 @@ FdoBalloonInitialize(
     else if (strcmp(Value, "ON") != 0)
         Warning("UNRECOGNIZED VALUE OF %s: %s\n", Key, Value);
 
-    RegistryFreeSzValue(Option);
+    ConfigFreeSzValue(Option);
 
 done:
     return Enabled ?
@@ -5782,7 +5782,7 @@ FdoSetWatchdog(
 
     Value = strtoul(Option->Buffer + sizeof (Key) - 1, NULL, 0);
 
-    RegistryFreeSzValue(Option);
+    ConfigFreeSzValue(Option);
 
     if (Value && Value < 10) {
         Warning("%us TOO SHORT (ROUNDING UP TO 10s)\n");
diff --git a/src/xenbus/unplug.c b/src/xenbus/unplug.c
index ca58c31..6bf8fb3 100644
--- a/src/xenbus/unplug.c
+++ b/src/xenbus/unplug.c
@@ -175,7 +175,7 @@ UnplugBootEmulated(
     else if (strcmp(Value, "FALSE") != 0)
         Warning("UNRECOGNIZED VALUE OF %s: %s\n", KeyName, Value);
 
-    RegistryFreeSzValue(Option);
+    ConfigFreeSzValue(Option);
 
 done:
     ReleaseMutex(&Context->Mutex);
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Tue Nov 11 08:54:04 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 11 Nov 2025 08:54:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1158883.1487259 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIk8Y-0001SA-Ka; Tue, 11 Nov 2025 08:54:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1158883.1487259; Tue, 11 Nov 2025 08:54:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIk8Y-0001S3-I5; Tue, 11 Nov 2025 08:54:02 +0000
Received: by outflank-mailman (input) for mailman id 1158883;
 Tue, 11 Nov 2025 08:54:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=es58=5T=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vIk8W-0001Ru-Te
 for win-pv-devel@lists.xenproject.org; Tue, 11 Nov 2025 08:54:01 +0000
Received: from CY3PR05CU001.outbound.protection.outlook.com
 (mail-westcentralusazlp170130007.outbound.protection.outlook.com
 [2a01:111:f403:c112::7])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f6034a73-bedb-11f0-9d18-b5c5bf9af7f9;
 Tue, 11 Nov 2025 09:53:59 +0100 (CET)
Received: from SA1PR03MB7098.namprd03.prod.outlook.com (2603:10b6:806:338::6)
 by PH7PR03MB7224.namprd03.prod.outlook.com (2603:10b6:510:244::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.15; Tue, 11 Nov
 2025 08:53:55 +0000
Received: from SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15]) by SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15%6]) with mapi id 15.20.9298.015; Tue, 11 Nov 2025
 08:53:55 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f6034a73-bedb-11f0-9d18-b5c5bf9af7f9
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=bQ/EFYtt6s1+3WnaeJMjJv8HqlaARddsLFPy/l6J/wWdutaDnwKSFhBvvb1awpRJ+/q5FZJ5XoobHrw9ouz7vHQbZjBDn/DQ4jahff8hpQtcRBbmbfImMAzmCnYfbI9I/q5CBtBAGRPnzSaHmdI5dnBp/Obhg4cJmqtQbieJoViitml2Peb++uMfvga2wagDfTTb8It/flMR309uY9oJER6pT3Fz7FQHxOjBn4Y6oil7ui3MJxVgFikd8w5DBeDfiblitzxgu0/ghVV8vLXJopB2TMHHISmgp0f5B9cFdG0SKfXgH5TOg/2H/OGM9cMEoDYkmInsvtI2PYA/6JN0eA==
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=RGmDg7ne1fBocdhPdKEj0G8RKnIjbYW2UqawBGDbl4o=;
 b=rR+ni/972mxjipxAdlUdfPhFlcnBVCzSjgKD+kZVHmmAQx1ESHlph45GG0t/DDA3gqIHjDc+DWQLtqlgBT/iNQ9MUunh2jFEQRoziiEtnSeb0/hQOX2OkA36eXF05rVDjIlVX8awbL0RdLAIpPvq3HStkampH8zq+n+ugoBd1Gk9HL+mR0wFvE/LAuTwkRmS+jd38sM2QaEouMsfYKK0YOZeFYrU4A3vYY8zzJRQXZZhUd0k33rXNUlyeT9lz54OHQ4EcIVmqWYquy0fRgVlCHxKZUSbWN2I1Nb0up6P/KXKgtI9FoqQNNByZmF+wc9VwE3PmmIFhl0EuQfWdlyjgA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RGmDg7ne1fBocdhPdKEj0G8RKnIjbYW2UqawBGDbl4o=;
 b=k0Db13ite/XTHx6fD+YLt/WH3xTpRHmOxFXyzoI/ONtjn2DiUCrM2/71NwTfVuX8+AkCtenb0qa5yrsKRC7GVBMIpb1W7HGSz4SDau88ESuANe/k0eg9E9WOnH5VTTEcS11HUdY0a2mp81FXrUzhGmRSFrWmTSR6bni8kxSZmEQ=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [PATCH] Correct system time calculation
Thread-Topic: [PATCH] Correct system time calculation
Thread-Index: AQHcUnYx6BC9hGrxbUKAeTuwcG9sPLTtKyAh
Date: Tue, 11 Nov 2025 08:53:55 +0000
Message-ID:
 <SA1PR03MB709817961E53F99A297E638FFECFA@SA1PR03MB7098.namprd03.prod.outlook.com>
References: <20251110191346.1847-1-ngoc-tu.dinh@vates.tech>
In-Reply-To: <20251110191346.1847-1-ngoc-tu.dinh@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA1PR03MB7098:EE_|PH7PR03MB7224:EE_
x-ms-office365-filtering-correlation-id: 0243d994-0060-444c-920c-08de20ffd884
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|376014|366016|1800799024|38070700021;
x-microsoft-antispam-message-info:
 =?us-ascii?Q?C2qITI1g/0IO5zgqHDd/NSvay7+n1Q7x8EOAt6YnCSiWH6lgoIA0rBUovcaS?=
 =?us-ascii?Q?dNF9rgn7folY6h5PncNGuA326FF2DLrrK2wZRdUX11Uqb6Cv0c0oofK0uzlA?=
 =?us-ascii?Q?nCCJC9fd9KK2xsGG7bp17hS4LR8j7zvovwAnV43CRQjgm6wseTYMhUMgZQzU?=
 =?us-ascii?Q?dGM+adfSjlZw8bQgBQ3kj3ZTqq6+NlQORk8fDcIGokJ+OIgppHaJO2ki7hpA?=
 =?us-ascii?Q?dkRy46ADKTLApGRr8jzQIqaN2QlbnDyTfjKz1bbad3fJtyqIxToGoerfapgT?=
 =?us-ascii?Q?0HTSvyP0Ij2MxC7jFP0orRUSk6AIqh35+XnWfKXbpQrzAc0MSN/dLya3yEQL?=
 =?us-ascii?Q?/10G1NJkGe/H5Y6DQCk6bWXXtp69eqpa8eE4t2cZ5t3P/eQzKvwKoAX3zaTL?=
 =?us-ascii?Q?ugYpLPiXtVVOXYKC46TfT/uinN36LjjmtOnYxvbIkf/cgDRgydWrlx/UzQLT?=
 =?us-ascii?Q?ezVc01dS41m/gHEOvlmx7K4w6GIbrIZUkeE+43I5IbTuMhBlw70BV/zyIrd5?=
 =?us-ascii?Q?u5OI/Jf7jqKFMiSOrV8B0R9DIuPC8hHjCoUjDPTI/ghanIXiW2xiEgCX23fP?=
 =?us-ascii?Q?9F2o6jsflo4qtNOeb3JlEW9MLcLs5uXBmsO/zlaQVw1sA0DzUv9wiLP5zPHW?=
 =?us-ascii?Q?8ZYADwnpZmYRVDJnOj68j1yh4RKwkUMUZRIuSjMG2M8oUHFh+f8uTG21O96W?=
 =?us-ascii?Q?zhT9f0x9AIBIGHTNJxUQVidAkzdj3iUuBY1D25k8gK59bXA0l2q22Qy10sRe?=
 =?us-ascii?Q?h1/KrhZzjvAfOY0nvASaAWkB1bws0a1/6vVqHsZiEIcCdDb2bK/HLd9LjG6J?=
 =?us-ascii?Q?9KX6cOMD4FRbZVQq2Ck0S7u0/ce7JknTpEIuUfWhYZSw9//9km2dZ5oGP/m2?=
 =?us-ascii?Q?EBp/LWAyJv7XPqwllybn7l7uk3Q4BDNkQKWwFsnZiISDXCyWG+PEJUfDwKl+?=
 =?us-ascii?Q?4kUbw3Unmzv57Mzf8ARedvcV7BWt1/QIEzNi5EfW4iExI3HhXOLCPbcPjQPC?=
 =?us-ascii?Q?8GWgXllBkoJpLATdJwgLpv5YM1A/HrvsIB/8bBqanrD51Z3+8CynSoj12qR2?=
 =?us-ascii?Q?MkuHJLdlqML0DvXeoqLQ16L6oSpRv63uaJN6M3D8cWqxKUq/DBdI5+3FJmMb?=
 =?us-ascii?Q?JLJSQbYTSeKGuqZdr8AFky+VbPNnn/j9BY1JDNZAQ79QyQZpu2RqddA0Nshn?=
 =?us-ascii?Q?rL2dEYl8Bm/Cx9hkMqVdYOfUomUYAfKiGvMYHmYDlplSD2e5XBa6X4nuw5j2?=
 =?us-ascii?Q?TrJiRUrT6nblSoOJN3ZVuFyel/Yu39CLKHVtcCNKoIpNAd5GxxXtjEeaOF3U?=
 =?us-ascii?Q?hVPlwMNEn9LxtB4WYxFY0jAu+j0Dv54RPkxBQ6qjzNp291oo4hUwDGGwA9J9?=
 =?us-ascii?Q?jxDtW4rdcJP5BibY8Y6zjiXNlP/XUzKkNdX1lb+oxzXxFJSLM5xyNDAOYiUT?=
 =?us-ascii?Q?g5WJbuJfHChXNBjNUph0GrhPP0fj13Ps?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR03MB7098.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(38070700021);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?aMI5LK9ZadsKwqCDO0t78hsJoE7vsJ1LJxh7Lqu0KO8lrRfM9agfB07Rq+c+?=
 =?us-ascii?Q?JJ653jSWimNC0VbcaybxkGeJUfdQj2ws7+I99cylVAObpXS+7GxeH9ka5nug?=
 =?us-ascii?Q?kgfLvtjMLrYsBTHFsEiGX8IDNXkgdOB45KJDBF3XP0v2FVLO/PRmU/O3ZxYP?=
 =?us-ascii?Q?JEBl2Il1jmbsZ7kEeNPAdTsN4jwht4AciNjsk8GdJnQs1W+65oPmuezBANE2?=
 =?us-ascii?Q?7qyVjwJTbkFGGP364blrZRRUoLchGxuvt+/McMls2bo3Jkfgj9HZX9EaV7L4?=
 =?us-ascii?Q?NDN6JNtrSk1cVvh+rgVjqr/0DX+dUveijwNAnxCBTUJMp6cD7ldwtszDsDIw?=
 =?us-ascii?Q?Oyb9TvN9GzrHACEB3HW4E0Sl3r4aITdNAt6GkaHhVar6i83h/tymP3i6moaL?=
 =?us-ascii?Q?vq+EIM6J9kqoUWQuEOhYlH/2auuMnyFc+qpjsg8YxDj8Ik5euO8mrJltqzJ6?=
 =?us-ascii?Q?Oq47K0VeeWnWsvpWOnwDZR0rguVdimEd/WPfM51Ho/6N7t5eQAJvmOQRVama?=
 =?us-ascii?Q?DJ1vfYrYo113Z5bu1xf4KRia3JYYpvApF70+DHIaysU/T96T3MROXptQA1TR?=
 =?us-ascii?Q?ykazr2uo28L+dH3sZDSymmnARPGKDSsBj2qk4I841Ix4653sQfQUVqnW3BlT?=
 =?us-ascii?Q?cIL2vCTHMOx9HlouSEBHjZAcly9p9PWlDKQq1uUA51khe/J6tRNLHHOu3RG+?=
 =?us-ascii?Q?gka8BdyyF84T3rGcwyJ4TuHMF9FFmtNfpayrdkAcP3cqoahyeFJgQxp8MLsz?=
 =?us-ascii?Q?hQv27HZqYV/OLAkXljtN47R6+Xq+qecYfv04IUbhTYthW6j0SgCji97YnOJy?=
 =?us-ascii?Q?HVR1MgHIBC+8CNpGuewJs6dtrEjVy+4OHDaaFHvbv12dZD8bqD9w0tzGzeS5?=
 =?us-ascii?Q?uCE4luSQs5biRZk/z+2otlNVY+/btIHtzFzcDAMRuj2bhIo2rLkL0ZDH9q2I?=
 =?us-ascii?Q?xpIuoBylqvBNeN25Ru7AkEo2KA1aHpykMELLOjbhPB0kCrdLFV2/HuCNNEf8?=
 =?us-ascii?Q?X/xu794Ox+Mn1CSp4AFxlOUtBlf8XmRzKTMwoQh8Vj6vrn0WoAHVGGHN60bN?=
 =?us-ascii?Q?IKxXH8f5m9FZZctb+U/oGYZvgbLNmqOSFvx+Zyv4yfWMAzHc8wqhXtEgapF4?=
 =?us-ascii?Q?EWy2SOFlg+HK9iqc6IucEeYIdFNj9/q8xy5EUaXJ6RRBgys/RXr+2CZOkzk1?=
 =?us-ascii?Q?hMOFSh4VVCwuWR0dIhXb/YXqm3cSgdD+iFZY2CAqa6JffxvDlMqxULntKIBp?=
 =?us-ascii?Q?+wC8dsgEmTqBGzXaEJ69Hg7PaPO808En5gqy/gQw478laRfTyxpxSPbhCG2x?=
 =?us-ascii?Q?B7JkKwzusdfT7mUdT8RvziD2zjWGH+tILLpoRbJd9e3bzKEudksLJePbpLjC?=
 =?us-ascii?Q?MKLxi2/mTmQyAQm3t0sSc74pPwHRqucxoC9U0PncXqmesmZk4LuQI+VwoGIU?=
 =?us-ascii?Q?Nqeo3O8N2GvJx2rRTw06JMvZcjt0dWnL28sm4Ne306JTlEX4G6hnuzgEoDUi?=
 =?us-ascii?Q?viP0eJ5eD1uFUjAxU097LuBZYCIkJUXOs1KAAKlQBeKBa0NE6qbRxziQczSE?=
 =?us-ascii?Q?2WKGP0yS/T76hdWH4QJdcv39Dsnu96TGykTze2am?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA1PR03MB7098.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 0243d994-0060-444c-920c-08de20ffd884
X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2025 08:53:55.3775
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: f5s7mFktWggzF3prTi5at/dzE46CqnbeYqwtm3AJxVbPQ4CM3tPoaFCNIu0PtpOTA/B3wOwhLZmGpO+D5Hu6Tg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR03MB7224

Interestingly, xen.h defines the time calculation in a comment, but does no=
t account for tsc_shift being a signed int8_t value.

https://xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dblob;f=3Dxen/include/public=
/xen.h;h=3D82b9c05a76b7faedded8778fb8274a0d3d5d31e4;hb=3DHEAD#l677

Reviewed-by: Owen Smith <owen.smith@citrix.com>

________________________________________
From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf of=
 Tu Dinh <ngoc-tu.dinh@vates.tech>
Sent: 10 November 2025 7:13 PM
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh
Subject: [PATCH] Correct system time calculation

SharedInfoGetTime uses the naive formula ((Tsc << TscShift) *
TscSystemMul) >> 32 to calculate the current system time. However, there
are two issues: firstly, TscShift may be negative (to indicate a right
shift); and secondly, multiplying the shifted Tsc with TscSystemMul will
throw away the result's upper 64 bits.

Adjust for negative shift amounts and use UnsignedMultiplyExtract128 to
correctly perform the multiplication.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xenbus/shared_info.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/xenbus/shared_info.c b/src/xenbus/shared_info.c
index 06e0aec..fe29470 100644
--- a/src/xenbus/shared_info.c
+++ b/src/xenbus/shared_info.c
@@ -356,6 +356,7 @@ SharedInfoGetTime(
     ULONGLONG                       NanoSeconds;
     ULONGLONG                       Timestamp;
     ULONGLONG                       Tsc;
+    ULONGLONG                       Age;
     ULONGLONG                       SystemTime;
     ULONG                           TscSystemMul;
     CHAR                            TscShift;
@@ -404,10 +405,15 @@ SharedInfoGetTime(
     KeLowerIrql(Irql);

     // Number of elapsed ticks since timestamp was captured
-    Tsc -=3D Timestamp;
+    Age =3D Tsc - Timestamp;
+    if (TscShift < 0)
+        Age >>=3D -TscShift;
+    else
+        Age <<=3D TscShift;
+    Age =3D UnsignedMultiplyExtract128(Age, TscSystemMul, 32);

     // Time in nanoseconds since boot
-    SystemTime +=3D ((Tsc << TscShift) * TscSystemMul) >> 32;
+    SystemTime +=3D Age;

     Trace("WALLCLOCK TIME AT BOOT: Seconds =3D %llu NanoSeconds =3D %llu\n=
",
           Seconds,
--
2.51.0.windows.2



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




From win-pv-devel-bounces@lists.xenproject.org Tue Nov 11 14:10:14 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 11 Nov 2025 14:10:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1159069.1487458 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIp4W-0003H0-Rp; Tue, 11 Nov 2025 14:10:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1159069.1487458; Tue, 11 Nov 2025 14:10:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIp4W-0003Gt-Ow; Tue, 11 Nov 2025 14:10:12 +0000
Received: by outflank-mailman (input) for mailman id 1159069;
 Tue, 11 Nov 2025 14:10:11 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=es58=5T=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vIp4V-0003Gn-9K
 for win-pv-devel@lists.xenproject.org; Tue, 11 Nov 2025 14:10:11 +0000
Received: from DM5PR21CU001.outbound.protection.outlook.com
 (mail-centralusazlp170110009.outbound.protection.outlook.com
 [2a01:111:f403:c111::9])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1f0ec002-bf08-11f0-980a-7dc792cee155;
 Tue, 11 Nov 2025 15:10:06 +0100 (CET)
Received: from SA1PR03MB7098.namprd03.prod.outlook.com (2603:10b6:806:338::6)
 by SN7PR03MB7034.namprd03.prod.outlook.com (2603:10b6:806:32e::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9298.16; Tue, 11 Nov
 2025 14:10:02 +0000
Received: from SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15]) by SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15%6]) with mapi id 15.20.9298.015; Tue, 11 Nov 2025
 14:10:02 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1f0ec002-bf08-11f0-980a-7dc792cee155
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=j5LiMl+oXSxKPQedwp04xfg5kbdpjFPXDpHmBOKj2aDZTcCX2oeJ3/lVzhwtePPtDWKCsKDlofWZFvQpL6q2ZjBqgrIsWc/uAejT1mkhx97c0BtVMqTPb1cNXVpURyrHF69YChkKpDGYBbhF/lw3tsZzz+pH1v2nQeK9PoO1qiBFmX8oHX0jLVkVWMd2tFRE+apa44qWxy2YWAF5j0lp8bCgwmqTC9F5YCfNkUGJBm+9q0rJORI1eViu86sMipBNvav6Pcs2eOMJA0OJM2/JkSACLryYPKmzMQZYYvK0LGKw32eFM5qMIcmLgr6ZgWWIQ541psxu3qaQSn2HzgvvIA==
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=6cw3bfJtDC0R+BfQwjbWt3WAdiIRl6rVaL1Pclzwzww=;
 b=Jseol74iH9K9d+jX8JNunpKJ8h2+yoziUKJId5Ds4Wp2jjZOfHNjU0tEMrrLr+yYrgLWn5EgVZc5FeLqk+V4EqzegU4JQEh4IxuVIjxS9cHTpIheKJEGISvJ07+rk48qsldWNW3Wli8gxKtfyuvtRHp545FoJrL8cSDKc2t9YXB/GK53du+QW3bAP+vesAyOsH590IFMyRtev2wXD4fwswrlcaQBIYpe7e4BdupMngtN4ezuiMwpd9hrtt2z0uCQ1kyRjsl7ueT0WEVDaAHpAcr4l4ppGSI75Gf3t1NlQiEIDd3ZJmZI/glEDLNBU7P4JRLTeAn5RSx7shi485AFaw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=6cw3bfJtDC0R+BfQwjbWt3WAdiIRl6rVaL1Pclzwzww=;
 b=fh2WNm6pHhZzPAQH82927mPNJ/XLD/WbIjCFeRVMgJXPnWhie6FVYpiDMEXNKZTn+VwN9740Nat3yWBryarbkTzIRofQa3G4bdHm6nuzptLxL0VP+oIUHeia0dsKRUFVuS98+uJO4KD/4DMd+j6sIprowrq+jFmQrZliMOwFWu8=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [PATCH] Correct system time calculation
Thread-Topic: [PATCH] Correct system time calculation
Thread-Index: AQHcUnYx6BC9hGrxbUKAeTuwcG9sPLTtKyAhgABXCKc=
Date: Tue, 11 Nov 2025 14:10:02 +0000
Message-ID:
 <SA1PR03MB70980413F6E6626002B82A0BFECFA@SA1PR03MB7098.namprd03.prod.outlook.com>
References: <20251110191346.1847-1-ngoc-tu.dinh@vates.tech>
 <SA1PR03MB709817961E53F99A297E638FFECFA@SA1PR03MB7098.namprd03.prod.outlook.com>
In-Reply-To:
 <SA1PR03MB709817961E53F99A297E638FFECFA@SA1PR03MB7098.namprd03.prod.outlook.com>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA1PR03MB7098:EE_|SN7PR03MB7034:EE_
x-ms-office365-filtering-correlation-id: 088c7953-5272-4dd7-c2f7-08de212c01c0
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|366016|1800799024|376014|38070700021;
x-microsoft-antispam-message-info:
 =?us-ascii?Q?wE+O4oAQpRnFIXSeCEJOn5OzpKJNMuknUnpooipFK2xBPWHafBAfRkdTCMYr?=
 =?us-ascii?Q?Wpw0NXb3C5B7WtmEyzHE/ylJ408qKblFGr4j6aXLSiBlB4bb2yr2Vztgb/9G?=
 =?us-ascii?Q?ytKxviGE+K9tnOqVxd/N0CIRbVsT7Ox4igp9kwp30e3MnYKId8tWmUV46aIm?=
 =?us-ascii?Q?UaM+3A7+RlJzBN34VzEKfI6L1BkD55/ZfhLzfc9qDkkiofJh9PRbqBlkh+d+?=
 =?us-ascii?Q?thHLLv33bUo83xo2rfGGLBNFjeIN2eORZ2jWGihKHCtsr7dUcFKeJKGVQ+NC?=
 =?us-ascii?Q?4OJ9LRfgiEJOoFMnlgnsMYf5X0O5vVjsk5sFYGn2KXRC/cFNWfp5Efrlpn9E?=
 =?us-ascii?Q?/4RnUqowZsqfpMOrfYhuk9kHF/T3i3ncYotSyhwgcfe2BZ4seUcqKQR+6/pZ?=
 =?us-ascii?Q?Sk0kJItChILGQMRVYOVFlsv/zPf5ijsCxBME+p2QSHka/CE1yUiH02ZrhhCV?=
 =?us-ascii?Q?1I0FxhcQOlwBTxTvf7umK8zMNd9nIIoNTH4xEgPnCHL8p5oPWQ0Ik801BSKs?=
 =?us-ascii?Q?cxxGw/7rRdBGMk+VyjvDgljqi15hd6fFXzTZIVD+wrKvzY8F0h/aFkXyCNOy?=
 =?us-ascii?Q?SS1XWs7x71LA0pFzb8KK0ly3iE4oLVhgjCWe+LD3+LI+rk/L28V6nMhS1RM9?=
 =?us-ascii?Q?kIjwSKl8pEgvjgkSvhN3kJPTi/xfXHHSjj9OctkfEYi70+zJO1jgy1TGNnBA?=
 =?us-ascii?Q?z0zK105EutFtBcAClKEKPBWpsi45LAjnhAmgXJAAE/lK8Zf43OyXyXG51Ju0?=
 =?us-ascii?Q?9Gd++iToIePIp3RoDcPJ2EgbZ0GTpMZElVuqOKKFYumTG4H0DqHD9gpoAOnz?=
 =?us-ascii?Q?eFmrJuATRW+yid8zas9nGl+WDjWtnap+VBV3rFVUDapRvCjM4r8yF3c9aC4m?=
 =?us-ascii?Q?h29P7GqzFLcZsTph3ohuZFsW2ww/oF8yBkJxXTEHtxvd4kpZNbezeWycZ1gH?=
 =?us-ascii?Q?Kl5AtZHRFrYjQe6SIedc/+4PY7+cB8NtcDj9bR3s2oxIGdkqb277rXtnkONV?=
 =?us-ascii?Q?MIWp8ck1cnoyw4np2o9U+boJBXblD7Ai5745Myx0anNt1kTWg+VyI7Qk1GPQ?=
 =?us-ascii?Q?f9E9wiNazP9tyZwkJCkriL0CZV034bSEzgRLpWBwjSHbhEKjYetnjzruF50q?=
 =?us-ascii?Q?SHRuDIfA5LH63i5Hbd0DLf+xGvw9Qgfi/xqpF6VmK6U90MwqBo81W/XyG5sE?=
 =?us-ascii?Q?dqyWMiO/wC1kvlOqwZLCk9hbKFxnwH4JInbqqlFdEU91tuU7l53JU/hRuKjN?=
 =?us-ascii?Q?Hb1XlMJHxz6euHKUo93ztjlslBoFDjiztfx4vr7CKQVLgsCLM3JIYsKg3lkt?=
 =?us-ascii?Q?gUWDpNaFdyCEa6mmjuZ6Z8fyVApHk5KHQ+e0pjdNv0riVJzW7Ebf37hnF3RE?=
 =?us-ascii?Q?1fMjK7l+kGLkhkCkwFUddara963vBcHTquA3MKvkAmRuVX5dIBzYWh33lMoO?=
 =?us-ascii?Q?d0dKZrposdfjycvDRhEeht4u+QZTG+nW?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR03MB7098.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(38070700021);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?bkr1zeUKCm1D6RxuyAKqCo7WvCEytVreZt1TluJ+6hsdqpaJiETTek3d9Mmd?=
 =?us-ascii?Q?LkzacZFCLdyExDNVEpIphcuK+hk8AigrxhUm0gxfjMaCZu1bBMQISewc03Bn?=
 =?us-ascii?Q?1S/FfakL5shw7J7yZMP8zrBm054cmXWhM+5O9OVbKDAs/7/wos5cHW2+LkHW?=
 =?us-ascii?Q?PCgcSr3Nq7xFci+JQW7o+yORinJ9/7CBVEHteBRkG5fRfES7zb+fioyR6KQm?=
 =?us-ascii?Q?46sKaKHEaF5lnh4AczQg0p9E5oaFX9AO64B8xA4CsEkSg3pIDrfD1lIypENw?=
 =?us-ascii?Q?RDRJFYbvHGnidtABiRiQe9mRMIuwh0P7rlOVo0pHFZ4JUjFz+RX/tBEeU9SZ?=
 =?us-ascii?Q?Nuc3nGX0PHJ+WUH+JYyB2sTDM8e618Q//+xJFlCYUihyLWGhRqrkkfHfrqwL?=
 =?us-ascii?Q?BmLHvJidPeYvtG1Ierrtrt4cUFsQ5RZ6iJLG+7oKrv/lp5QFpAhB3B5Cmx2L?=
 =?us-ascii?Q?7EgFVlyo8w4NrfcpIq7IEQVnDYWkWaJwsgAXAlVhM+hBxMDH0oForuBDo/3I?=
 =?us-ascii?Q?4b39gJyhJfo8jijNmsg3jLsidA9A11TBappdONwvSDcBiVKomCdJK2OkvMuo?=
 =?us-ascii?Q?gah5u4H59HTQvrr/E7NkokvHPop1oSSK5nTuEMhkpbCkLKUvME9IrUC/a1Kh?=
 =?us-ascii?Q?NTyZqUdcodRjdOfbBatvX/qO5xD53Cxqx2R/WtTi6nFkZcm6WvLWIhODtg6r?=
 =?us-ascii?Q?6IvSBNVbHAe5+dA9HAJN5NnaUl5XwDTU1ccNyyN1T9EOrMrBURt++nayRqiN?=
 =?us-ascii?Q?a+ww6SGsZJN1E72n3+4zmjIznkmrqkyWaR6P1cUXK3WLNmA4KLDs5HbBOWRK?=
 =?us-ascii?Q?PdnY7HVt3ieip/jBbFLhA2a2s6kM8Q8pu/ZuTH3usS0w3VY0IdnL0DubE/ea?=
 =?us-ascii?Q?w58X9PreSYu/VHmGCDphy8SWiARWQiqQoONUcZTs4lYkqcCWOJN58KF4YjXq?=
 =?us-ascii?Q?hs//I4Quwy8JYV3o3+6A/QuQ0YZyFCgcSEl1e12+DNzbsi4jLJ2eAgR5FQRy?=
 =?us-ascii?Q?riVovFOLIL/I2hmU4sW4ONcnnOGSM6/2PRhzZkoKdN3EW1/wCfoZERsusgdC?=
 =?us-ascii?Q?deARLSR0D8cPVTvhUjCKBmx02f6dcJNm15pd6ksP3z8NHt+vKPwX4sz/Uj1C?=
 =?us-ascii?Q?Y5rSq8B7BKB3UM/4eOBTQSmBg4U10/xy6qNuy1ZKyPpVuGIqReLuuDXSWTe/?=
 =?us-ascii?Q?NDTleX8JSIcpZCxHHyIv/ZYb2qbN8frIuq8/+o7vFeVs4nLnk+KxuhQRjC7o?=
 =?us-ascii?Q?tD46kNZ5TNOM+PyjwXxBXJla3xoliVa77GpryH8xeStFRCkRn6wLi71IT2mt?=
 =?us-ascii?Q?aldpmuP4m+bwuzfdLXsp82Wrn1TLqpvb04QU7RksiEXSQrbXX7LpJA0+6BPD?=
 =?us-ascii?Q?1Jc/lvVsy+EBLBT2N4E1hC5ljtlHFEXcgaEEg6xp2GkUw76rUg5Y+Ejvl8Vf?=
 =?us-ascii?Q?vjK9I5nBCYRXcfqyMl90+XmX4GnTxHLLnYxrt1J0LNqtSEzelpUk3d/G+7eh?=
 =?us-ascii?Q?OI/+et6sDxI9PxSRDdxF+yl1qux61JjKJrLJGleAYGl5HWiOhANrRc/hsHpg?=
 =?us-ascii?Q?pjJLWXbzFWBaY0I78Lj52X8nnFEcwmVxD33hZ6Re?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA1PR03MB7098.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 088c7953-5272-4dd7-c2f7-08de212c01c0
X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2025 14:10:02.4306
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: jAtcPVYOJVyQ9oLMH5c5qDtbMumXQkNCdDbCi9HyafxS03Jm5NmqmZVHEUEi2Okkq1ZmT08VGvn1j3iMQI8Aww==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR03MB7034

UnsignedMultiplyExtract128 is not available in the 22000 EWDK

Owen

________________________________________
From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf of=
 Owen Smith <owen.smith@citrix.com>
Sent: 11 November 2025 8:53 AM
To: Tu Dinh; win-pv-devel@lists.xenproject.org
Subject: Re: [PATCH] Correct system time calculation

Interestingly, xen.h defines the time calculation in a comment, but does no=
t account for tsc_shift being a signed int8_t value.

https://xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dblob;f=3Dxen/include/public=
/xen.h;h=3D82b9c05a76b7faedded8778fb8274a0d3d5d31e4;hb=3DHEAD#l677

Reviewed-by: Owen Smith <owen.smith@citrix.com>

________________________________________
From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf of=
 Tu Dinh <ngoc-tu.dinh@vates.tech>
Sent: 10 November 2025 7:13 PM
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh
Subject: [PATCH] Correct system time calculation

SharedInfoGetTime uses the naive formula ((Tsc << TscShift) *
TscSystemMul) >> 32 to calculate the current system time. However, there
are two issues: firstly, TscShift may be negative (to indicate a right
shift); and secondly, multiplying the shifted Tsc with TscSystemMul will
throw away the result's upper 64 bits.

Adjust for negative shift amounts and use UnsignedMultiplyExtract128 to
correctly perform the multiplication.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xenbus/shared_info.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/xenbus/shared_info.c b/src/xenbus/shared_info.c
index 06e0aec..fe29470 100644
--- a/src/xenbus/shared_info.c
+++ b/src/xenbus/shared_info.c
@@ -356,6 +356,7 @@ SharedInfoGetTime(
     ULONGLONG                       NanoSeconds;
     ULONGLONG                       Timestamp;
     ULONGLONG                       Tsc;
+    ULONGLONG                       Age;
     ULONGLONG                       SystemTime;
     ULONG                           TscSystemMul;
     CHAR                            TscShift;
@@ -404,10 +405,15 @@ SharedInfoGetTime(
     KeLowerIrql(Irql);

     // Number of elapsed ticks since timestamp was captured
-    Tsc -=3D Timestamp;
+    Age =3D Tsc - Timestamp;
+    if (TscShift < 0)
+        Age >>=3D -TscShift;
+    else
+        Age <<=3D TscShift;
+    Age =3D UnsignedMultiplyExtract128(Age, TscSystemMul, 32);

     // Time in nanoseconds since boot
-    SystemTime +=3D ((Tsc << TscShift) * TscSystemMul) >> 32;
+    SystemTime +=3D Age;

     Trace("WALLCLOCK TIME AT BOOT: Seconds =3D %llu NanoSeconds =3D %llu\n=
",
           Seconds,
--
2.51.0.windows.2



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech





From win-pv-devel-bounces@lists.xenproject.org Tue Nov 11 17:19:22 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 11 Nov 2025 17:19:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1159183.1487553 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIs1X-0003yu-UN; Tue, 11 Nov 2025 17:19:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1159183.1487553; Tue, 11 Nov 2025 17:19:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vIs1X-0003yn-Rw; Tue, 11 Nov 2025 17:19:19 +0000
Received: by outflank-mailman (input) for mailman id 1159183;
 Tue, 11 Nov 2025 17:19:19 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3fdO=5T=bounce.vates.tech=bounce-md_30504962.69137010.v1-170599a3614f4cba86279135a6d62eaf@srs-se1.protection.inumbo.net>)
 id 1vIs1X-0003yh-87
 for win-pv-devel@lists.xenproject.org; Tue, 11 Nov 2025 17:19:19 +0000
Received: from mail179-26.suw41.mandrillapp.com
 (mail179-26.suw41.mandrillapp.com [198.2.179.26])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8af9333d-bf22-11f0-980a-7dc792cee155;
 Tue, 11 Nov 2025 18:19:13 +0100 (CET)
Received: from pmta12.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail179-26.suw41.mandrillapp.com (Mailchimp) with ESMTP id
 4d5YDJ1ylpzKsbjQj
 for <win-pv-devel@lists.xenproject.org>; Tue, 11 Nov 2025 17:19:12 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 170599a3614f4cba86279135a6d62eaf; Tue, 11 Nov 2025 17:19:12 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8af9333d-bf22-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1762881552; x=1763151552;
	bh=hFF9FO4UUD5eg2JDp9pyVZndQX7TAa6a6IfW3MVY9Zc=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=dVo6dmQoDoGjhCCdYLG4FtrvlwFesvHQ6zSHj1r+Q7c5IGuaXvs6Z1S6SyO9H7b9T
	 qkf0E6rDoj1YNdaAcYwWLOe9gLrsQvzAkF5FGGwKiNpl+ql46IHOL8waDK96iD/8eg
	 U8cD55noMX603+PjbMwlAHlsYHzhiLiPUZN1zwu73iaf3KXMOg+CtAP/y2z6QpznvJ
	 Ih+OIQME0BxUknOuMy6EvpSJ9aZ+HR4/G4agG5L4DYxHRlENwqioOp93bVTt9Sp7DA
	 C6iJTvzjVNTMfSx/I0uoO72ynfVFtIwU24mQjNrRrmDvssSgYc3J2/U/EqCO972Nni
	 2kUlwfw3Mg2xg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1762881552; x=1763142052; i=ngoc-tu.dinh@vates.tech;
	bh=hFF9FO4UUD5eg2JDp9pyVZndQX7TAa6a6IfW3MVY9Zc=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=n1HvGoYX67YsMqt2R23fmHZb9fzIFqZd70IDHXdgJ8X2iMOu2A6PqCCwCswTUMxSe
	 Oh/flaYqS3a6z5SZBSRCcbxR+5DFqEzY3waNZ2ABvXC4cRV+m9TUfl0j7YFgmyHQfu
	 sgIbkcr/5RsMWi2Gm9tUWX6GWnss0dJhD5APUZ43rcMoIJSYi+zbyLDzSF/z6DvzHr
	 s1VzZL/vlzw/6v+HNDav26xXG3GLnzUqRYaKDGCk6A51DD/SeuviaOJxw8nfVGY+dB
	 uJy74Px3iQbKFSVpoeGale3IhWAvOkFfKBONNhjvWz4H2VEB0W1twX+F6qhAPBCwHL
	 HBVlvhFyPP9hw==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH]=20Correct=20system=20time=20calculation?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1762881551245
Message-Id: <df6245f3-812b-4f0c-bbfb-f24885b6be54@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251110191346.1847-1-ngoc-tu.dinh@vates.tech> <SA1PR03MB709817961E53F99A297E638FFECFA@SA1PR03MB7098.namprd03.prod.outlook.com> <SA1PR03MB70980413F6E6626002B82A0BFECFA@SA1PR03MB7098.namprd03.prod.outlook.com>
In-Reply-To: <SA1PR03MB70980413F6E6626002B82A0BFECFA@SA1PR03MB7098.namprd03.prod.outlook.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.170599a3614f4cba86279135a6d62eaf?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251111:md
Date: Tue, 11 Nov 2025 17:19:12 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 11/11/2025 15:10, Owen Smith wrote:
> UnsignedMultiplyExtract128 is not available in the 22000 EWDK
> 
> Owen
> 

I managed to build it with EWDK_fe_release_20348_210507-1500.iso. Are 
you building for 32-bit x86?

> ________________________________________
> From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf of Owen Smith <owen.smith@citrix.com>
> Sent: 11 November 2025 8:53 AM
> To: Tu Dinh; win-pv-devel@lists.xenproject.org
> Subject: Re: [PATCH] Correct system time calculation
> 
> Interestingly, xen.h defines the time calculation in a comment, but does not account for tsc_shift being a signed int8_t value.
> 
> https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/include/public/xen.h;h=82b9c05a76b7faedded8778fb8274a0d3d5d31e4;hb=HEAD#l677
> 
> Reviewed-by: Owen Smith <owen.smith@citrix.com>
> 
> ________________________________________
> From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf of Tu Dinh <ngoc-tu.dinh@vates.tech>
> Sent: 10 November 2025 7:13 PM
> To: win-pv-devel@lists.xenproject.org
> Cc: Tu Dinh
> Subject: [PATCH] Correct system time calculation
> 
> SharedInfoGetTime uses the naive formula ((Tsc << TscShift) *
> TscSystemMul) >> 32 to calculate the current system time. However, there
> are two issues: firstly, TscShift may be negative (to indicate a right
> shift); and secondly, multiplying the shifted Tsc with TscSystemMul will
> throw away the result's upper 64 bits.
> 
> Adjust for negative shift amounts and use UnsignedMultiplyExtract128 to
> correctly perform the multiplication.
> 
> Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
> ---
>   src/xenbus/shared_info.c | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/src/xenbus/shared_info.c b/src/xenbus/shared_info.c
> index 06e0aec..fe29470 100644
> --- a/src/xenbus/shared_info.c
> +++ b/src/xenbus/shared_info.c
> @@ -356,6 +356,7 @@ SharedInfoGetTime(
>       ULONGLONG                       NanoSeconds;
>       ULONGLONG                       Timestamp;
>       ULONGLONG                       Tsc;
> +    ULONGLONG                       Age;
>       ULONGLONG                       SystemTime;
>       ULONG                           TscSystemMul;
>       CHAR                            TscShift;
> @@ -404,10 +405,15 @@ SharedInfoGetTime(
>       KeLowerIrql(Irql);
> 
>       // Number of elapsed ticks since timestamp was captured
> -    Tsc -= Timestamp;
> +    Age = Tsc - Timestamp;
> +    if (TscShift < 0)
> +        Age >>= -TscShift;
> +    else
> +        Age <<= TscShift;
> +    Age = UnsignedMultiplyExtract128(Age, TscSystemMul, 32);
> 
>       // Time in nanoseconds since boot
> -    SystemTime += ((Tsc << TscShift) * TscSystemMul) >> 32;
> +    SystemTime += Age;
> 
>       Trace("WALLCLOCK TIME AT BOOT: Seconds = %llu NanoSeconds = %llu\n",
>             Seconds,
> --
> 2.51.0.windows.2
> 
> 
> 
> --
> Ngoc Tu Dinh | Vates XCP-ng Developer
> 
> XCP-ng & Xen Orchestra - Vates solutions
> 
> web: https://vates.tech
> 
> 
> 
> 



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Wed Nov 12 08:08:54 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 12 Nov 2025 08:08:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1159553.1487849 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ5uN-0005Uu-Vi; Wed, 12 Nov 2025 08:08:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1159553.1487849; Wed, 12 Nov 2025 08:08:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ5uN-0005Un-TJ; Wed, 12 Nov 2025 08:08:51 +0000
Received: by outflank-mailman (input) for mailman id 1159553;
 Wed, 12 Nov 2025 08:08:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=h36J=5U=bounce.vates.tech=bounce-md_30504962.6914408e.v1-d8ca4cf1c6d84ec597dda4fd0205dcd6@srs-se1.protection.inumbo.net>)
 id 1vJ5uM-0005Uh-Ne
 for win-pv-devel@lists.xenproject.org; Wed, 12 Nov 2025 08:08:50 +0000
Received: from mail179-26.suw41.mandrillapp.com
 (mail179-26.suw41.mandrillapp.com [198.2.179.26])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d0b3a657-bf9e-11f0-9d18-b5c5bf9af7f9;
 Wed, 12 Nov 2025 09:08:49 +0100 (CET)
Received: from pmta12.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail179-26.suw41.mandrillapp.com (Mailchimp) with ESMTP id
 4d5wyk6YWzzKsblNX
 for <win-pv-devel@lists.xenproject.org>; Wed, 12 Nov 2025 08:08:46 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 d8ca4cf1c6d84ec597dda4fd0205dcd6; Wed, 12 Nov 2025 08:08:46 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d0b3a657-bf9e-11f0-9d18-b5c5bf9af7f9
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1762934926; x=1763204926;
	bh=jdaJDlfZQ1VCpEPY6fv76SkdER+eoeluIUUaE+cyuPY=;
	h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=vcC4fXCiGGdxS0BkQF/KiPWKBECQbrEEtGRo413L3RddW+LdRWxbFid0lgWM35URi
	 q12hkgiPiRvDAM4KwStfyja4DSi6DBMSzvQ0mlvwtfZSQv2W+WzajvDpyjD/EltJrI
	 mnRqIZKk0Ez+FfixpxWerTo8IPFH8DV/BNoxWtkEMgbF4L8gpAQ1eueca5BFiWCxcP
	 PBTcSQ5Za9hTCVvwwvi2a5VYpNGq0tSdAVztZNDMks5NAbJENW5MaQGYbkzFGTx94k
	 Cy8HoTXAtvhdFwV/6Td2ofbZ2vNYOr9ni+eXijOYV0d6D9z1Q9gXTwb1JJtMlMOrB6
	 oyN8e0LM1/UrA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1762934926; x=1763195426; i=ngoc-tu.dinh@vates.tech;
	bh=jdaJDlfZQ1VCpEPY6fv76SkdER+eoeluIUUaE+cyuPY=;
	h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=p5/IODCpv1+xZIPcpUew5OdSob+NifGDGwDjLQb6Qdf7rYkJmGvg0v8yBGS6nghnM
	 m98j4zp5AfI3tKZ+qugkdJ753PsOOsr8jjDgA+24d/OAZ31kV7w0MldsQgDEMw2VJM
	 LvkUI6bI2Wq0AKOWqg/fAl7af5Xs64Xu1CX8fQcdVzLQj2jnPaHM/9MA8WYrr0q7t6
	 LorMSyVe6/jN3xtChbo0AyMzNLWGG9Hy1VmBzDcB4CWNKNglDw7mIeOpB8Hv7nUzkS
	 U0imIhmPCFgIlC5/8Ywb/zvPwN6jlrak8edifjrM26e0lI6gGU3tMbVatyrTNB6v6r
	 taGL8VE1dBpWg==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=202/7]=20Add=20support=20for=20CodeQL=202.20.1?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1762934925879
Message-Id: <bf4d7399-c70b-43a8-9058-4ae0dd0be599@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
Cc: "Owen Smith" <owen.smith@cloud.com>
References: <20251111083418.1657-1-owen.smith@citrix.com> <20251111083418.1657-3-owen.smith@citrix.com>
In-Reply-To: <20251111083418.1657-3-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.d8ca4cf1c6d84ec597dda4fd0205dcd6?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251112:md
Date: Wed, 12 Nov 2025 08:08:46 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Hi,

On 11/11/2025 09:34, Owen Smith wrote:
> From: Owen Smith <owen.smith@cloud.com>
> 
> CodeQL 2.20.1 uses a different query file to previous versions, and relies
> on using different query packs, which need to be present on the system.
> 
> Adds CODEQL_QUERY_FILE environment variable to force a specific query file, if set.
> 
> Also adds "--threads=0" parameter, to use alll available CPUs.
> 
> https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/static-tools-and-codeql
> 
> Signed-off-by: Owen Smith <owen.smith@cloud.com>
> ---
>   msbuild.ps1 | 23 ++++++++++++++++++++---
>   1 file changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/msbuild.ps1 b/msbuild.ps1
> index 83b6928..9484a8d 100644
> --- a/msbuild.ps1
> +++ b/msbuild.ps1
> @@ -110,7 +110,8 @@ Function Run-CodeQL {
>   		[string]$Name,
>   		[string]$Configuration,
>   		[string]$Platform,
> -		[string]$SearchPath
> +		[string]$SearchPath,
> +		[string]$QueryFile
>   	)
>   
>   	$projpath = Resolve-Path (Join-Path $SolutionPath $Name)
> @@ -154,8 +155,10 @@ Function Run-CodeQL {
>   	$c += " database"
>   	$c += " analyze "
>   	$c += $database
> -	$c += " windows_driver_recommended.qls"
> +	$c += " "
> +	$c += $QueryFile
>   	$c += " --format=sarifv2.1.0"
> +	$c += " --threads=0"
>   	$c += " --output="
>   	$c += $sarif
>   	$c += " --search-path="

Using the & operator to call MSBuild and CodeQL may be cleaner here, 
though it can be done later.

> @@ -199,8 +202,22 @@ if ($Type -eq "codeql") {
>   	}
>   	New-Item -ItemType Directory "database"
>   
> +	$queryfile = "windows_driver_recommended.qls"
> +	Try {
> +		$ver = New-Object System.Version((& "codeql" "--version")[0].Split(" ")[-1] + "0")
> +		Write-Host -ForegroundColor Cyan "INFO: CodeQL version " $ver
> +		$minver = New-Object System.Version("2.20.1.0")
> +		if ($ver -ge $minver) {
> +			$queryfile = "mustfix.qls"

You can just use 
"microsoft/windows-drivers:windows-driver-suites/mustfix.qls" to target 
a specific pack, or a versioned form like 
"microsoft/windows-drivers@1.8.0:windows-driver-suites/mustfix.qls".

Also, why is mustfix.qls being used with the new pack instead of 
recommended.qls? I did notice new false positives in the newer 1.8.0 
pack, was this the cause of the change?

> +		}
> +	} Catch {
> +	}
> +	if (-not [string]::IsNullOrEmpty($Env:CODEQL_QUERY_FILE)) {
> +		$queryfile = $Env:CODEQL_QUERY_FILE
> +		Write-Host -ForegroundColor Cyan "INFO: Overwriting codeql query file to " $queryfile
> +	}
>   	ForEach ($project in $ProjectList) {
> -		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
> +		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath $queryfile
>   	}
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
>   }



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Wed Nov 12 08:17:44 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 12 Nov 2025 08:17:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1159563.1487863 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ62x-0007BA-R8; Wed, 12 Nov 2025 08:17:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1159563.1487863; Wed, 12 Nov 2025 08:17:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ62x-0007B3-Oi; Wed, 12 Nov 2025 08:17:43 +0000
Received: by outflank-mailman (input) for mailman id 1159563;
 Wed, 12 Nov 2025 08:17:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=IR8p=5U=bounce.vates.tech=bounce-md_30504962.691442a2.v1-ab3cb0cf5b06427f838d729ddb6ce068@srs-se1.protection.inumbo.net>)
 id 1vJ62w-0007Ax-EY
 for win-pv-devel@lists.xenproject.org; Wed, 12 Nov 2025 08:17:42 +0000
Received: from mail136-17.atl41.mandrillapp.com
 (mail136-17.atl41.mandrillapp.com [198.2.136.17])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0e27c6cf-bfa0-11f0-9d18-b5c5bf9af7f9;
 Wed, 12 Nov 2025 09:17:41 +0100 (CET)
Received: from pmta11.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail136-17.atl41.mandrillapp.com (Mailchimp) with ESMTP id
 4d5x8z07WszPm0X1J
 for <win-pv-devel@lists.xenproject.org>; Wed, 12 Nov 2025 08:17:39 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 ab3cb0cf5b06427f838d729ddb6ce068; Wed, 12 Nov 2025 08:17:38 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0e27c6cf-bfa0-11f0-9d18-b5c5bf9af7f9
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1762935459; x=1763205459;
	bh=IPojyIzXjIoykJzkAJgIfdjMECxIoYqI1onB7SJijb4=;
	h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=Hj2aA53RmCvuyyL0GvLffzAoKTEx2zp9IuQJZsHxKaWyZPhFUIuh3kWS5o/woBVX1
	 KXAFFIymAzQZivpe47UaRmO6pvAUiXUc6vlrcqT/JXp3RRrC2J5JIr1tVWxSZabK3r
	 j4ylrobiEaSAIxM7BaeUYS9+z+dYDZAWAKCUs4VqbNZQ/nZonAwJhAaBl9Aww8pXxb
	 39e5ZXemKbtXizeJX6qZFsaPu5wZtyAb5BJfPQvRoajXSNN+3QFnITQHFBwJgMGpfu
	 iuEYNGXnTfYq5YE6AwJ8WAxyhRQFbM4jVzXxQJwqfdz7xtchKm95/RCr/GD5udIz+U
	 X1f2Kp/1oyKlg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1762935459; x=1763195959; i=ngoc-tu.dinh@vates.tech;
	bh=IPojyIzXjIoykJzkAJgIfdjMECxIoYqI1onB7SJijb4=;
	h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=QzakQRTfDrYCp4f3Ct1NGoXK8oxi3kwWsnC7nYHtsL2kuRelAnCwvEOyZ3ImBTXGj
	 gwyGAOKkbKL8u2NbU5CyEQT0JwWseumMev/WOwiEXCi3svMUniaFTXqsIVDTGpAIea
	 ty7JzwI67zb7JHeAgMd3GCpeYeCHsQl+/fFL53jxBf9ZL1+Kstzb0wfjzpROtpklKT
	 TZpxjpZ2D8CoSLea8ihiuQCYOmLUd+mAzvLlxC/BC5HQzYFeXub+/YWoF5Hz6QCKlB
	 QLuHmrflhmM3rUQkut5B1ajIUKylopKiwyCxxzKRyquBflNAlkPyzFO4COol8r978t
	 /mryZD3fqaGzQ==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=201/7]=20Refactor=20msbuild.ps1?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1762935458032
Message-Id: <4c0a43dd-63eb-4fdf-8536-5d2b54fe4062@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
Cc: "Owen Smith" <owen.smith@cloud.com>
References: <20251111083418.1657-1-owen.smith@citrix.com> <20251111083418.1657-2-owen.smith@citrix.com>
In-Reply-To: <20251111083418.1657-2-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.ab3cb0cf5b06427f838d729ddb6ce068?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251112:md
Date: Wed, 12 Nov 2025 08:17:38 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 11/11/2025 09:34, Owen Smith wrote:
> From: Owen Smith <owen.smith@cloud.com>
> 
> Moves all repo specific data to a 'Globals' section, and simplifies the
> structure so that it can be common across all drivers.
> 
> Also seperates DVL log generation from SDV build, so that DVL logs
> can be created for CodeQL builds without SDV.
> 
> Signed-off-by: Owen Smith <owen.smith@cloud.com>

Reviewed-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

> ---
>   msbuild.ps1 | 67 +++++++++++++++++++++++++++++++++++------------------
>   1 file changed, 45 insertions(+), 22 deletions(-)
> 
> diff --git a/msbuild.ps1 b/msbuild.ps1
> index 64455ea..83b6928 100644
> --- a/msbuild.ps1
> +++ b/msbuild.ps1
> @@ -12,6 +12,16 @@ param(
>   	[switch]$CodeAnalysis
>   )
>   
> +#
> +# Globals
> +#
> +$SolutionName = "xenbus.sln"
> +$ArchivePath = "xenbus"
> +$ProjectList = @( "xen", "xenfilt", "xenbus" )
> +
> +#
> +# Functions
> +#
>   Function Run-MSBuild {
>   	param(
>   		[string]$SolutionPath,
> @@ -63,6 +73,24 @@ Function Run-MSBuildSDV {
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
> +
> +	Set-Location $basepath
> +}
> +
> +Function Run-MSBuildDVL {
> +	param(
> +		[string]$SolutionPath,
> +		[string]$Name,
> +		[string]$Configuration,
> +		[string]$Platform
> +	)
> +
> +	$basepath = Get-Location
> +	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
> +	Set-Location $projpath
> +
> +	$project = [string]::Format("{0}.vcxproj", $Name)
> +
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
>   	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
>   
> @@ -151,19 +179,15 @@ $solutionpath = Resolve-Path $SolutionDir
>   
>   Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
>   
> -if ($Type -eq "free") {
> -	Run-MSBuild $solutionpath "xenbus.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> -}
> -elseif ($Type -eq "checked") {
> -	Run-MSBuild $solutionpath "xenbus.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +if (-Not (Test-Path -Path $archivepath)) {
> +	New-Item -Name $archivepath -ItemType Directory | Out-Null
>   }
> -elseif ($Type -eq "codeql") {
> -	$archivepath = "xenbus"
>   
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
> +if (($Type -eq "free") -or ($Type -eq "checked")) {
> +	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +}
>   
> +if ($Type -eq "codeql") {
>   	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
>   		$searchpath = Resolve-Path ".."
>   	} else {
> @@ -175,22 +199,21 @@ elseif ($Type -eq "codeql") {
>   	}
>   	New-Item -ItemType Directory "database"
>   
> -	Run-CodeQL $solutionpath "xen" $configuration["codeql"] $platform[$Arch] $searchpath
> -	Run-CodeQL $solutionpath "xenfilt" $configuration["codeql"] $platform[$Arch] $searchpath
> -	Run-CodeQL $solutionpath "xenbus" $configuration["codeql"] $platform[$Arch] $searchpath
> -
> +	ForEach ($project in $ProjectList) {
> +		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
> +	}
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
>   }
> -elseif ($Type -eq "sdv") {
> -	$archivepath = "xenbus"
>   
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> +if ($Type -eq "sdv") {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
>   	}
> +}
>   
> -	Run-MSBuildSDV $solutionpath "xen" $configuration["sdv"] $platform[$Arch]
> -	Run-MSBuildSDV $solutionpath "xenfilt" $configuration["sdv"] $platform[$Arch]
> -	Run-MSBuildSDV $solutionpath "xenbus" $configuration["sdv"] $platform[$Arch]
> -
> +if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
> +	}
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
>   }



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Wed Nov 12 08:20:02 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 12 Nov 2025 08:20:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1159566.1487868 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ65C-0007KC-2t; Wed, 12 Nov 2025 08:20:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1159566.1487868; Wed, 12 Nov 2025 08:20:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ65B-0007Jm-VV; Wed, 12 Nov 2025 08:20:01 +0000
Received: by outflank-mailman (input) for mailman id 1159566;
 Wed, 12 Nov 2025 08:20:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=hRIU=5U=bounce.vates.tech=bounce-md_30504962.6914432d.v1-f478b94228be4e509f5a39618236ff79@srs-se1.protection.inumbo.net>)
 id 1vJ65A-0007GD-Av
 for win-pv-devel@lists.xenproject.org; Wed, 12 Nov 2025 08:20:00 +0000
Received: from mail136-17.atl41.mandrillapp.com
 (mail136-17.atl41.mandrillapp.com [198.2.136.17])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6063a863-bfa0-11f0-9d18-b5c5bf9af7f9;
 Wed, 12 Nov 2025 09:19:58 +0100 (CET)
Received: from pmta11.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail136-17.atl41.mandrillapp.com (Mailchimp) with ESMTP id
 4d5xCd3C3BzPm0RHF
 for <win-pv-devel@lists.xenproject.org>; Wed, 12 Nov 2025 08:19:57 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 f478b94228be4e509f5a39618236ff79; Wed, 12 Nov 2025 08:19:57 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6063a863-bfa0-11f0-9d18-b5c5bf9af7f9
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1762935597; x=1763205597;
	bh=gf1MrKDrv7ZmrBMapmm1jZGtNWsrseJkNxS3U/Uz9tc=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=wjbS6dXpgH98buGx2GAFGePU5fKcdVPNXOyQ1z79RhxTQVYY59Xh576iOp6+zNhDU
	 nFeQT8JsHmxkJsIp8w+NXooKwuWYm2EOxbd/IohZlfURtXSackQPMMhoIKfXSbOPPa
	 YUMsTZYzjaY5zA4raZrKmzBuP8dKJJBSgyhvcpM9jfl/D8TJVr5HUsVbs+3zTs7uAZ
	 eYkXdHqqKKy4wWaDaThoJqHOR6jTFFW1/dHhze1XbqGmo6BjbbkfN2r0Xq/eOtV1Ct
	 /wESurmguKCSJmMqpASLBL5RWJlbQyXtOKhJxgL+fpNFFy0IUFExGttWlsINzNc0Ws
	 xZw0YNMngKj+Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1762935597; x=1763196097; i=ngoc-tu.dinh@vates.tech;
	bh=gf1MrKDrv7ZmrBMapmm1jZGtNWsrseJkNxS3U/Uz9tc=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=0Kx+OKByCpue81j1qBwDq4Rmtci20f6sljC/gqWE7E3n7iCbm7KK4aRsIvdHQ/oBy
	 ++AzpLQ6nhOTFfMaBbnwQwNu21MGmp3nEOzbeE2IOTYf2TxcTGUpRb0YEJ/TV0Hxkr
	 6MHZoAhrV/vzs+USzWtpoQCbmGVY4NGjHqtU3xn9Fp02Taai9Sua2l77C4HIQq7cVb
	 8XDru1oRtX5kJKlmrA4uuQ+ytVru/lPE5QBXmYYQw2J0JfG8PP+bBFBIdEGWWZZSCM
	 FjdChS/dkFx9IKoeel5SCybBd0bSxLSfcaNwX6Awp3N7dpKbO6jHncFPTk9PURvgq/
	 6OIN9E9NQh8cA==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=204/7]=20Set=20InterruptManagement=20values=20in=20HardwareKey?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1762935596380
Message-Id: <dfa19513-f957-48ce-b76e-f5f1e10e9769@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251111083418.1657-1-owen.smith@citrix.com> <20251111083418.1657-5-owen.smith@citrix.com>
In-Reply-To: <20251111083418.1657-5-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.f478b94228be4e509f5a39618236ff79?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251112:md
Date: Wed, 12 Nov 2025 08:19:57 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 11/11/2025 09:34, Owen Smith wrote:
> InterruptManagement values should be stored under the hardware key, and this
> fixes an issue reported by InfVerif although this issue does not block WHQL
> qualification.
> 
> Signed-off-by: Owen Smith <owen.smith@citrix.com>

Reviewed-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

> ---
>   src/xenbus.inf | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/xenbus.inf b/src/xenbus.inf
> index 10774b0..adc70bd 100644
> --- a/src/xenbus.inf
> +++ b/src/xenbus.inf
> @@ -76,6 +76,9 @@ CopyFiles=XenBus_CopyFiles
>   CopyFiles=Monitor_CopyFiles
>   FeatureScore=0xFE
>   
> +[XenBus_Inst.HW]
> +AddReg = XenBus_Interrupts
> +
>   [XenBus_Inst.Services]
>   AddService=xenbus_monitor,%SPSVCSINST_STARTSERVICE%,Monitor_Service,Monitor_EventLog
>   AddService=xenbus,%SPSVCINST_ASSOCSERVICE%,XenBus_Service
> @@ -88,7 +91,7 @@ StartType=%SERVICE_BOOT_START%
>   ErrorControl=%SERVICE_ERROR_NORMAL%
>   ServiceBinary=%12%\xenbus.sys
>   LoadOrderGroup="Boot Bus Extender"
> -AddReg = XenBus_Parameters, XenBus_Interrupts, XenBus_Unplug
> +AddReg = XenBus_Parameters, XenBus_Unplug
>   
>   [XenBus_Parameters]
>   HKR,"Parameters",,0x00000010



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Wed Nov 12 08:21:06 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 12 Nov 2025 08:21:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1159568.1487872 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ66E-0008HT-5k; Wed, 12 Nov 2025 08:21:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1159568.1487872; Wed, 12 Nov 2025 08:21:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ66E-0008HM-2t; Wed, 12 Nov 2025 08:21:06 +0000
Received: by outflank-mailman (input) for mailman id 1159568;
 Wed, 12 Nov 2025 08:21:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=WywH=5U=bounce.vates.tech=bounce-md_30504962.69144369.v1-b3ebbbfc03044fd1be180b3e7c87a9bb@srs-se1.protection.inumbo.net>)
 id 1vJ66C-0008HG-64
 for win-pv-devel@lists.xenproject.org; Wed, 12 Nov 2025 08:21:04 +0000
Received: from mail179-26.suw41.mandrillapp.com
 (mail179-26.suw41.mandrillapp.com [198.2.179.26])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8412308e-bfa0-11f0-980a-7dc792cee155;
 Wed, 12 Nov 2025 09:20:58 +0100 (CET)
Received: from pmta12.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail179-26.suw41.mandrillapp.com (Mailchimp) with ESMTP id
 4d5xDn2vBvzKsbb6g
 for <win-pv-devel@lists.xenproject.org>; Wed, 12 Nov 2025 08:20:57 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 b3ebbbfc03044fd1be180b3e7c87a9bb; Wed, 12 Nov 2025 08:20:57 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8412308e-bfa0-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1762935657; x=1763205657;
	bh=O4pzNz7kNImnG1Ap9pEfJKrSuJbWHMPXykVD3LDPB5g=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=CHlb315SPLsNYC9l4Hbmd7444hntFwlVXG9erNgvPOcKIgtRyseY7ONyITsa0CN/L
	 JWorKdnyNFMiD7O+LJdU4gAAcwQ8hofbSIbXU3bsGMO4WJGWGdwtjDxVfrk00O5kCt
	 e3vezmKQo/6hy2YgE010Lax7f44M4+gDtU1j4FQdzhpqUDyrDXZFJ/F/sbMMc1iQ75
	 8yrLYxdfHDqhtOzcADAVTEs88pXZv97Kha0wWJNpSePzh6r7tZl+CkKGYysPnv+Ne7
	 tXprS8HQmkbJtCvMMdpuSq7ZrBlW5h5rVHtY5EJQTvH2xtGU6OhRcxfZORhv62ueEL
	 zKyoUVCsk/OFg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1762935657; x=1763196157; i=ngoc-tu.dinh@vates.tech;
	bh=O4pzNz7kNImnG1Ap9pEfJKrSuJbWHMPXykVD3LDPB5g=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=oMXj2zMgFt48fGhB8YkqMlzDg1H/xfTKx1XvBYDp7Ds7KU8Bjzi+PH+0p6voClp8A
	 MurC31Ll3A4ptIGNawmQ6qHoVo/ZuvThHpvUkqZkrbnqMReh0bmzDLAoOb4KLiHYVV
	 WrNMGx3u2p2VR0dONT732cEoiMxMYb4aQ36i6JCvulVej7ePN3Nn1QYFuZl1Yurl3V
	 OahFHzYWK+0/o5H7WMHawS/oUOqwq4LTdDqUfuabZKwHGcwpPZ7BK9ktHXhxNfNToc
	 p+Szpr1wcmchA+3JKGT/JDRk2RYyt9epQWWrQ+o+Z3cY9SV5zgyl0u8VayHrVsE9al
	 sWlMJU6mg3jzg==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=205/7]=20Squash=20Error=20when=20LogLevel=20value=20is=20not=20present?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1762935656444
Message-Id: <8f8560e0-d956-4910-bfc9-7a67c41ca482@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251111083418.1657-1-owen.smith@citrix.com> <20251111083418.1657-6-owen.smith@citrix.com>
In-Reply-To: <20251111083418.1657-6-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.b3ebbbfc03044fd1be180b3e7c87a9bb?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251112:md
Date: Wed, 12 Nov 2025 08:20:57 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 11/11/2025 09:34, Owen Smith wrote:
> LogLevel override values are usually not present, and this will reduce logging
> which is not required.
> 
> Signed-off-by: Owen Smith <owen.smith@citrix.com>

Reviewed-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

> ---
>   src/xen/log.c | 11 +++++++++--
>   1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/src/xen/log.c b/src/xen/log.c
> index a65b233..8673105 100644
> --- a/src/xen/log.c
> +++ b/src/xen/log.c
> @@ -744,14 +744,20 @@ LogReadLogLevel(
>       PANSI_STRING        Values;
>       ULONG               Type;
>       ULONG               Index;
> +    BOOLEAN             SquashError;
>       NTSTATUS            status;
>   
> +    SquashError = FALSE;
> +
>       status = RegistryQuerySzValue(Key,
>                                     Name,
>                                     &Type,
>                                     &Values);
> -    if (!NT_SUCCESS(status))
> +    if (!NT_SUCCESS(status)) {
> +        if (status == STATUS_OBJECT_NAME_NOT_FOUND)
> +            SquashError = TRUE;
>           goto fail1;
> +    }
>   
>       status = STATUS_INVALID_PARAMETER;
>       if (Type != REG_MULTI_SZ)
> @@ -780,7 +786,8 @@ fail2:
>       RegistryFreeSzValue(Values);
>   
>   fail1:
> -    Error("fail1 (%08x)\n", status);
> +    if (!SquashError)
> +        Error("fail1 (%08x)\n", status);
>   
>       *LogLevel = LOG_LEVEL_NONE;
>   



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Wed Nov 12 08:21:18 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 12 Nov 2025 08:21:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1159569.1487875 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ66Q-0008KB-7A; Wed, 12 Nov 2025 08:21:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1159569.1487875; Wed, 12 Nov 2025 08:21:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ66Q-0008K4-4k; Wed, 12 Nov 2025 08:21:18 +0000
Received: by outflank-mailman (input) for mailman id 1159569;
 Wed, 12 Nov 2025 08:21:16 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yf7R=5U=bounce.vates.tech=bounce-md_30504962.69144379.v1-440c7cf2f4ad4e238fcd6101dcbca886@srs-se1.protection.inumbo.net>)
 id 1vJ66O-0008HG-8o
 for win-pv-devel@lists.xenproject.org; Wed, 12 Nov 2025 08:21:16 +0000
Received: from mail179-26.suw41.mandrillapp.com
 (mail179-26.suw41.mandrillapp.com [198.2.179.26])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8d9f395f-bfa0-11f0-980a-7dc792cee155;
 Wed, 12 Nov 2025 09:21:14 +0100 (CET)
Received: from pmta12.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail179-26.suw41.mandrillapp.com (Mailchimp) with ESMTP id
 4d5xF52yLlzKsblNq
 for <win-pv-devel@lists.xenproject.org>; Wed, 12 Nov 2025 08:21:13 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 440c7cf2f4ad4e238fcd6101dcbca886; Wed, 12 Nov 2025 08:21:13 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8d9f395f-bfa0-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1762935673; x=1763205673;
	bh=YUEsPrkpLJ0/FXU5hQAEJ34NjQx+JNkX7aV6XEZCpe4=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=Ko1kPhCiPUi8iz6ZdUOl40Q+LuVvLJ3RnktiLMNoRBG/Huo6SaMlAwH2iX0KFpYSC
	 lytOOjndRTCkPoSRKoxs6QzCU8iKBtRurHxgpn6KNsoTMrzPOkFaSqGazStqhMO0Si
	 NWlzBsqCRqP1EfzI0rsYtFlkw6KyeOVSTBZPeF8Ncoblo7hfBEDYIT/Grcatya9fVg
	 RxYobBg19Hr5UEg4poNfc4qTmydDkby/NKFR+Egd8G57TCf2nNJBbF3/XX1TgRKeWT
	 pWsj54+TQoA1P0ydGXrcOQXwZ7Ht0m5cmTlxTwddXYktzUuaIj0IoJBCiKEKQcGEw/
	 x9JNHeGIi63Mw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1762935673; x=1763196173; i=ngoc-tu.dinh@vates.tech;
	bh=YUEsPrkpLJ0/FXU5hQAEJ34NjQx+JNkX7aV6XEZCpe4=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=qZ8syRXu7AwljWAH9yiNgT/Wqx7xat9HDhh9biV/oL0hkrcXltyd0ycxRJkwA+nag
	 ZZVqO2nel0DNbKOPMIyz0Ft2zz5SfOXzG3XI8RbFE1k+Fsx95NSnQqbOIlIO48yUFk
	 I5bbOFv1lIpywW4LRn9NDoRtxans1HrVM/hs1xe+URhKzVW6JmrxPj5EmhPXNZ1hkT
	 whULkFew03tWpy3+f9MaJUkyhPlp0TCEXH7P+gLIlC8EODxtTw/lrtJ+H7UvX6kyJP
	 C40RWGrkbZEIsOY53D624E/Z5YLAhPEdJUwh5LUqdkNQcyH823h1mFbcv2PQ7G+OV6
	 /NZX8pCqlY9EQ==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=206/7]=20Remove=20Error=20logging=20from=20RangeSetPop?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1762935672504
Message-Id: <24ebf963-7d95-469c-92a2-95a8f1d1c35f@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251111083418.1657-1-owen.smith@citrix.com> <20251111083418.1657-7-owen.smith@citrix.com>
In-Reply-To: <20251111083418.1657-7-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.440c7cf2f4ad4e238fcd6101dcbca886?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251112:md
Date: Wed, 12 Nov 2025 08:21:13 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 11/11/2025 09:34, Owen Smith wrote:
> Reduce logging to Trace, so its only displayed in checked builds.
> Failures reported here would result in the range set being expanded, and
> failures in expanding the range set will report errors.
> 
> Signed-off-by: Owen Smith <owen.smith@citrix.com>

Reviewed-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

> ---
>   src/xenbus/range_set.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/xenbus/range_set.c b/src/xenbus/range_set.c
> index 76d04c4..ceed3b9 100644
> --- a/src/xenbus/range_set.c
> +++ b/src/xenbus/range_set.c
> @@ -237,15 +237,15 @@ found:
>       return STATUS_SUCCESS;
>   
>   fail3:
> -    Error("fail3\n");
> +    Trace("fail3\n");
>   
>   fail2:
> -    Error("fail2\n");
> +    Trace("fail2\n");
>   
>       KeReleaseSpinLock(&RangeSet->Lock, Irql);
>   
>   fail1:
> -    Error("fail1 (%08x)\n", status);
> +    Trace("fail1 (%08x)\n", status);
>   
>       return status;
>   }



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Wed Nov 12 08:26:45 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 12 Nov 2025 08:26:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1159570.1487879 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ6Bg-00006q-Jx; Wed, 12 Nov 2025 08:26:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1159570.1487879; Wed, 12 Nov 2025 08:26:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ6Bg-00006j-HW; Wed, 12 Nov 2025 08:26:44 +0000
Received: by outflank-mailman (input) for mailman id 1159570;
 Wed, 12 Nov 2025 08:26:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zt9X=5U=bounce.vates.tech=bounce-md_30504962.691444c0.v1-83dafd6372484ee08a0209a279b496f1@srs-se1.protection.inumbo.net>)
 id 1vJ6Bf-00006d-Bp
 for win-pv-devel@lists.xenproject.org; Wed, 12 Nov 2025 08:26:43 +0000
Received: from mail179-26.suw41.mandrillapp.com
 (mail179-26.suw41.mandrillapp.com [198.2.179.26])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5079e677-bfa1-11f0-9d18-b5c5bf9af7f9;
 Wed, 12 Nov 2025 09:26:41 +0100 (CET)
Received: from pmta12.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail179-26.suw41.mandrillapp.com (Mailchimp) with ESMTP id
 4d5xMN3w5wzKsblN6
 for <win-pv-devel@lists.xenproject.org>; Wed, 12 Nov 2025 08:26:40 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 83dafd6372484ee08a0209a279b496f1; Wed, 12 Nov 2025 08:26:40 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5079e677-bfa1-11f0-9d18-b5c5bf9af7f9
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1762936000; x=1763206000;
	bh=oiEviYFgxThWmWOou62IMbVkw1GjHr1K+QFdPiEg8Ig=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=fOk2kBNu4YJIYrXbL0MJNwWzKX1IkuCPXl1/VeJw7wpjGLDgxw+HyIkKb+WpmXhEd
	 4rzf9Kd1dR8pfKajpul1mw1M6qljserUB9QdAUpSIE7otEhQ9mCPNjUGNR1QKZZPMP
	 VkFWKaewsiY98sbov7brOea0IENRiMFT7igiXNp/QD0TUyKx7d0cANOxppf4RzFiyY
	 FRMH0BHC/Vmix9Kih8gvibutMrt3ZgSziipDt5kQs4Bi0bsh8VMP5cPu3nu3+3g90p
	 ickqboEfb4LmeZVgCp4aOC4EaWSQzjbCLCMO2Q/PEDT3iPj/v5zV/G+ZfU1GymQMDO
	 EsTH+zrxpE9JQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1762936000; x=1763196500; i=ngoc-tu.dinh@vates.tech;
	bh=oiEviYFgxThWmWOou62IMbVkw1GjHr1K+QFdPiEg8Ig=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=cvoXiFPuTDFDhrvhU37VVb80+RnTguziyS7XMClVV7kJcNUNd4Ebvpjbg1C9Gek5C
	 3GJPgJePLdhSSX2MdlzvdJd9W/zWT0nhuJ5IVUVtBPAeHf6p/i7kMd+1w4/xgmGlE/
	 pX+kb3hnm04yfSAeo0aAYeJql1s7648tIHoW6BUwiurBqwR3JPt65gEdz2U0FPJ0aI
	 Sf1ucuCNmnOdutf/gs+0kIB/YddLAjadVp1sdma+Ep+hT9SD1JH0NaTk8ALig/IoUk
	 HmUHNuFmjyQ1xAvKmZgei9FsUggTPszJBDUUKMg8r/tlNhrgeTPuaCWi/LBsoIXbQM
	 hHkGXY4uh+wiw==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=207/7]=20Add=20ConfigFreeActive=20/=20ConfigFreeSzValue?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1762935999726
Message-Id: <11a77b6d-9444-4619-90e8-a1f771101ad8@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251111083418.1657-1-owen.smith@citrix.com> <20251111083418.1657-8-owen.smith@citrix.com>
In-Reply-To: <20251111083418.1657-8-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.83dafd6372484ee08a0209a279b496f1?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251112:md
Date: Wed, 12 Nov 2025 08:26:40 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 11/11/2025 09:34, Owen Smith wrote:
> Values returned by ConfigGetActive should be freed by ConfigFreeActive,
> and values returned by ConfigQuerySystemStartOption should be freed by
> ConfigFreeSzValue, so that pool tag tracking is correct.
> 
> Signed-off-by: Owen Smith <owen.smith@citrix.com>
> ---
>   include/xen.h       | 12 ++++++++++++
>   src/xen/config.c    | 22 ++++++++++++++++++++--
>   src/xenbus/fdo.c    |  6 +++---
>   src/xenbus/unplug.c |  2 +-
>   4 files changed, 36 insertions(+), 6 deletions(-)
> 
> diff --git a/include/xen.h b/include/xen.h
> index 7016c86..8691a0f 100644
> --- a/include/xen.h
> +++ b/include/xen.h
> @@ -573,6 +573,12 @@ ConfigClearActive(
>       VOID
>       );
>   
> +XEN_API
> +VOID
> +ConfigFreeActive(
> +    _In_ PSTR   Value
> +    );
> +
>   XEN_API
>   NTSTATUS
>   ConfigRequestReboot(
> @@ -587,4 +593,10 @@ ConfigQuerySystemStartOption(
>       _Outptr_ PANSI_STRING   *Option
>       );
>   
> +XEN_API
> +VOID
> +ConfigFreeSzValue(
> +    _In_ PANSI_STRING       Array
> +    );
> +
>   #endif  // _XEN_H
> diff --git a/src/xen/config.c b/src/xen/config.c
> index 99980a6..b7268c0 100644
> --- a/src/xen/config.c
> +++ b/src/xen/config.c
> @@ -305,7 +305,7 @@ ConfigUpdateActive(
>   
>       status = ConfigGetActive("InstanceID", &ActiveInstanceID);
>       if (NT_SUCCESS(status)) {
> -        ExFreePool(ActiveInstanceID);
> +        ConfigFreeActive(ActiveInstanceID);
>       } else {
>           RtlInitAnsiString(&Ansi[0], InstanceID);
>   
> @@ -319,7 +319,7 @@ ConfigUpdateActive(
>   
>       status = ConfigGetActive("LocationInformation", &ActiveLocationInformation);
>       if (NT_SUCCESS(status)) {
> -        ExFreePool(ActiveLocationInformation);
> +        ConfigFreeActive(ActiveLocationInformation);
>       } else {
>           RtlInitAnsiString(&Ansi[0], LocationInformation);
>   
> @@ -408,6 +408,15 @@ fail1:
>       return status;
>   }
>   
> +XEN_API
> +VOID
> +ConfigFreeActive(
> +    _In_ PSTR   Value
> +    )
> +{
> +    __FreePoolWithTag(Value, 'SUB');

Perhaps this should be under a #define like the other pool tags?

> +}
> +
>   XEN_API
>   NTSTATUS
>   ConfigRequestReboot(
> @@ -496,3 +505,12 @@ ConfigQuerySystemStartOption(
>   {
>       return RegistryQuerySystemStartOption(Key, Option);
>   }
> +
> +XEN_API
> +VOID
> +ConfigFreeSzValue(
> +    _In_ PANSI_STRING       Array
> +    )
> +{
> +    RegistryFreeSzValue(Array);
> +}
> diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
> index e3de8b9..d093db8 100644
> --- a/src/xenbus/fdo.c
> +++ b/src/xenbus/fdo.c
> @@ -806,7 +806,7 @@ fallback:
>           if (Fdo->Active)
>               (VOID) ConfigUpdateActive(DeviceID, InstanceID, LocationInformation);
>   
> -        ExFreePool(ActiveDeviceID);
> +        ConfigFreeActive(ActiveDeviceID);
>       } else {
>           status = ConfigSetActive(DeviceID, InstanceID, LocationInformation);
>           if (NT_SUCCESS(status))
> @@ -5746,7 +5746,7 @@ FdoBalloonInitialize(
>       else if (strcmp(Value, "ON") != 0)
>           Warning("UNRECOGNIZED VALUE OF %s: %s\n", Key, Value);
>   
> -    RegistryFreeSzValue(Option);
> +    ConfigFreeSzValue(Option);
>   
>   done:
>       return Enabled ?
> @@ -5782,7 +5782,7 @@ FdoSetWatchdog(
>   
>       Value = strtoul(Option->Buffer + sizeof (Key) - 1, NULL, 0);
>   
> -    RegistryFreeSzValue(Option);
> +    ConfigFreeSzValue(Option);
>   
>       if (Value && Value < 10) {
>           Warning("%us TOO SHORT (ROUNDING UP TO 10s)\n");
> diff --git a/src/xenbus/unplug.c b/src/xenbus/unplug.c
> index ca58c31..6bf8fb3 100644
> --- a/src/xenbus/unplug.c
> +++ b/src/xenbus/unplug.c
> @@ -175,7 +175,7 @@ UnplugBootEmulated(
>       else if (strcmp(Value, "FALSE") != 0)
>           Warning("UNRECOGNIZED VALUE OF %s: %s\n", KeyName, Value);
>   
> -    RegistryFreeSzValue(Option);
> +    ConfigFreeSzValue(Option);
>   
>   done:
>       ReleaseMutex(&Context->Mutex);



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Wed Nov 12 08:29:00 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 12 Nov 2025 08:29:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1159582.1487893 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ6Ds-0000gz-02; Wed, 12 Nov 2025 08:29:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1159582.1487893; Wed, 12 Nov 2025 08:28:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ6Dr-0000gs-Tr; Wed, 12 Nov 2025 08:28:59 +0000
Received: by outflank-mailman (input) for mailman id 1159582;
 Wed, 12 Nov 2025 08:28:59 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dmqo=5U=bounce.vates.tech=bounce-md_30504962.69144548.v1-3535c5e39aa440b7a2bd66a58d8f60ec@srs-se1.protection.inumbo.net>)
 id 1vJ6Dr-0000gm-MP
 for win-pv-devel@lists.xenproject.org; Wed, 12 Nov 2025 08:28:59 +0000
Received: from mail179-26.suw41.mandrillapp.com
 (mail179-26.suw41.mandrillapp.com [198.2.179.26])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a17e56d1-bfa1-11f0-980a-7dc792cee155;
 Wed, 12 Nov 2025 09:28:57 +0100 (CET)
Received: from pmta12.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail179-26.suw41.mandrillapp.com (Mailchimp) with ESMTP id
 4d5xQ01tpbzKsbbtx
 for <win-pv-devel@lists.xenproject.org>; Wed, 12 Nov 2025 08:28:56 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 3535c5e39aa440b7a2bd66a58d8f60ec; Wed, 12 Nov 2025 08:28:56 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a17e56d1-bfa1-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1762936136; x=1763206136;
	bh=4Q5O0FFDMEtXCC8TKHBGnIhnmd550Zz27NYFmuWXCco=;
	h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=HrPs4B1FtoCfWgSrJMBediSAcdgQ9R/IKVhkBaEStoeEr3VXvgHm5CykpMfUz1L7k
	 RLPrdiz7OYqInmRaqoqfwW/2ahS4lAsGxomPtuw3lAITKx0McfI5FCEbpuLyBFLszx
	 C6n0a58NlznCeUkOa5R6WUIc5bVO2rv7fC2noyJNC7ztFaicbS/Op73fHYIsCMK2Qk
	 DXKaX1ZWOIq3iWHa6QVjawFShJQUSM/qdQbN9HSl3K6vdIrC6s1JUQqbwsewJCGwnc
	 kyztwGSd6MPwRx5p8vSKjgZ9+hk4E6fEt0Ha97QR3iwubcR7bIs8acETRc1i8C6oXV
	 d5TJCBWt3WaAA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1762936136; x=1763196636; i=ngoc-tu.dinh@vates.tech;
	bh=4Q5O0FFDMEtXCC8TKHBGnIhnmd550Zz27NYFmuWXCco=;
	h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=cezkImPHKcs4P03u79Ac6ZZW22Z6F7ycRBabOUlEcmkdHz//PCQfBchDvlrp18gj4
	 jcVAX5yZDzjaXo5S8Aqxmafcyo/tPAw6139V2Cu3X6sl29wzoWTcigau97XD4r4INQ
	 2nexmwT+RmqV1+UgcUvAKxIMp/Zv1I1bVln5zZDP5za+xxJq4ry0d/EwVxpAKwAwd9
	 JreTOrxaJe7a7q+Wq5bXFfl25oPquQm9m4RpmxogsydHZwm4VJU4vnkY2HsifaJsjL
	 +1drL9nMtiMXTK/6ppqXKSNujbk1TPl1OEjmprS2GPq8170adiYSlCTR7vH48MAjXS
	 YkJSvsmy27EMQ==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=203/7]=20Enable=20KASAN=20build=20support?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1762936134879
Message-Id: <790b8ef9-4ad3-4fbc-82ab-0f62dd53f2f7@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
Cc: "david ambu" <david.preetham@cloud.com>
References: <20251111083418.1657-1-owen.smith@citrix.com> <20251111083418.1657-4-owen.smith@citrix.com>
In-Reply-To: <20251111083418.1657-4-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.3535c5e39aa440b7a2bd66a58d8f60ec?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251112:md
Date: Wed, 12 Nov 2025 08:28:56 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 11/11/2025 09:34, Owen Smith wrote:
> KASAN (Kernel Address Sanitizer)
> (see https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/kasan)
> builds can be enabled when using the WDK 10.0.26100.2161 or later, and can be
> used on specially prepared Windows 11 24H2 / Server 2025, or later, OSs.
> 
> KASAN enabled drivers should not generally deployed, as the OS needs to be
> enabled, but these drivers can help track down illegal memory accesses and
> similar issues.
> 
> Signed-off-by: david ambu <david.preetham@cloud.com>

I tested it to verify that the KASAN section got created, but haven't 
gotten the time to test further.

Acked-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

> ---
>   build.ps1   |  6 ++++--
>   msbuild.ps1 | 11 ++++++++---
>   2 files changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/build.ps1 b/build.ps1
> index 42bbdde..1ec30ee 100644
> --- a/build.ps1
> +++ b/build.ps1
> @@ -9,7 +9,8 @@ param(
>   	[string]$SignMode = "TestSign",
>   	[switch]$CodeQL,
>   	[switch]$Sdv,
> -	[switch]$CodeAnalysis
> +	[switch]$CodeAnalysis,
> +	[switch]$Kasan
>   )
>   
>   #
> @@ -32,7 +33,8 @@ Function Build {
>   		Arch = $Arch;
>   		Type = $Type;
>   		SignMode = $SignMode;
> -		CodeAnalysis = $CodeAnalysis
> +		CodeAnalysis = $CodeAnalysis;
> +		Kasan = $Kasan
>   		}
>   	& ".\msbuild.ps1" @params
>   	if ($LASTEXITCODE -ne 0) {
> diff --git a/msbuild.ps1 b/msbuild.ps1
> index 9484a8d..6f0755d 100644
> --- a/msbuild.ps1
> +++ b/msbuild.ps1
> @@ -9,7 +9,8 @@ param(
>   	[Parameter(Mandatory = $true)]
>   	[string]$Type,
>   	[string]$SignMode = "TestSign",
> -	[switch]$CodeAnalysis
> +	[switch]$CodeAnalysis,
> +	[switch]$Kasan
>   )
>   
>   #
> @@ -30,7 +31,8 @@ Function Run-MSBuild {
>   		[string]$Platform,
>   		[string]$Target = "Build",
>   		[string]$Inputs = "",
> -		[switch]$CodeAnalysis
> +		[switch]$CodeAnalysis,
> +		[switch]$Kasan
>   	)
>   
>   	$c = "msbuild.exe"
> @@ -46,6 +48,9 @@ Function Run-MSBuild {
>   		$c += "/p:RunCodeAnalysis=true "
>   		$c += "/p:EnablePREFast=true "
>   	}
> +	if ($Kasan) {
> +		$c += "/p:EnableKASAN=true "
> +	}
>   
>   	$c += Join-Path -Path $SolutionPath -ChildPath $Name
>   
> @@ -187,7 +192,7 @@ if (-Not (Test-Path -Path $archivepath)) {
>   }
>   
>   if (($Type -eq "free") -or ($Type -eq "checked")) {
> -	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis -Kasan:$Kasan
>   }
>   
>   if ($Type -eq "codeql") {



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Wed Nov 12 08:53:09 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 12 Nov 2025 08:53:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1159599.1487908 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ6bE-00054k-1C; Wed, 12 Nov 2025 08:53:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1159599.1487908; Wed, 12 Nov 2025 08:53:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ6bD-00054d-Un; Wed, 12 Nov 2025 08:53:07 +0000
Received: by outflank-mailman (input) for mailman id 1159599;
 Wed, 12 Nov 2025 08:53:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QCq8=5U=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vJ6bD-00054X-1V
 for win-pv-devel@lists.xenproject.org; Wed, 12 Nov 2025 08:53:07 +0000
Received: from SN4PR0501CU005.outbound.protection.outlook.com
 (mail-southcentralusazlp170110003.outbound.protection.outlook.com
 [2a01:111:f403:c10d::3])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0051824a-bfa5-11f0-9d18-b5c5bf9af7f9;
 Wed, 12 Nov 2025 09:53:05 +0100 (CET)
Received: from SA1PR03MB7098.namprd03.prod.outlook.com (2603:10b6:806:338::6)
 by SJ0PR03MB5887.namprd03.prod.outlook.com (2603:10b6:a03:2ae::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.17; Wed, 12 Nov
 2025 08:53:01 +0000
Received: from SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15]) by SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15%6]) with mapi id 15.20.9298.015; Wed, 12 Nov 2025
 08:53:01 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0051824a-bfa5-11f0-9d18-b5c5bf9af7f9
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=x18mhTfAVuS2bccYoTBvgDeAhv960D5trauRtolb23AdstgeQnARyB/Vhf4k+bIpf/cL8gxigNRfwNZCku6khq+aYIkiGbpkmXbXQF1puztKEvjIta6ei5NdouhCMzBshFypENrtfkL3WvW/CDuA8FO2gcWTENxuNmGL1nJ3FyrEGou6vF+InvpVkwK4JKKI9Jcjzvv68uKpRvRiN0VKnKHnMCZgor8y7b143hHegHeWqHVOrsMejixnFhVRrkFXigHzrq6l6wYpR5Ftw/Vi33qt/7T7ND+2nUoraqzaKcIG+XU4zUJMLspOf31MFabU8gKVLUW/HsOeORghVw3QQg==
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=vkp/+6dftPjFdX2xUd2DaWG3o86TMJryzQ3FRKTZVE0=;
 b=F1GP/BHL8FpSi4zvq/kNRmZinGFwsaRES/s6mKr3fCgu5JMd4dmjosSiTw8DaRNmnWIOG02TUH6Cg8pAUbXfo/DxWFXgBrOliDrfNOQnSsSh2isSHQ0mn41GRR066Pkljel07VhKxUdpMaP/teAIC5O8azxNseUTYy3xKYqATACazhKO7xAJJ7fqeCnJmJUhuYIPSozodb53kfzCUtUNtAdZIdsdUEE309TBtibs0JqTAkQmaQnJE5lskdo6msGzYd1R/3c0Ac6weRBWlLv2mBYsK7N3Zlaf/ktpCM2fM1wNUoOzAZI9K+toWqImzMjLq9vn2FbtHcKrM91Nz3kePw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vkp/+6dftPjFdX2xUd2DaWG3o86TMJryzQ3FRKTZVE0=;
 b=PLoC+2lz0BobKNYEUL7Az+aJm8YicQmqsUAk6yjZXb8pzdHz/PPA7IiT/yp8qN1MDOF0kxXKUjC5wUL6dMkXOLTeD8xucOMkQHG/1/kz73U884NzqOc3gX7gQ/r/X9TPRZ8JxRgAPd9aAKbckju030ZGQ5CggKjBaeKqKG5VK0M=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [PATCH] Correct system time calculation
Thread-Topic: [PATCH] Correct system time calculation
Thread-Index: AQHcUnYx6BC9hGrxbUKAeTuwcG9sPLTtKyAhgABXCKeAADeDAIABBFWE
Date: Wed, 12 Nov 2025 08:53:01 +0000
Message-ID:
 <SA1PR03MB709883C037BDA4B3EE151C8EFECCA@SA1PR03MB7098.namprd03.prod.outlook.com>
References: <20251110191346.1847-1-ngoc-tu.dinh@vates.tech>
 <SA1PR03MB709817961E53F99A297E638FFECFA@SA1PR03MB7098.namprd03.prod.outlook.com>
 <SA1PR03MB70980413F6E6626002B82A0BFECFA@SA1PR03MB7098.namprd03.prod.outlook.com>
 <df6245f3-812b-4f0c-bbfb-f24885b6be54@vates.tech>
In-Reply-To: <df6245f3-812b-4f0c-bbfb-f24885b6be54@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA1PR03MB7098:EE_|SJ0PR03MB5887:EE_
x-ms-office365-filtering-correlation-id: 07aaca1d-3aa5-4407-30e5-08de21c8e292
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|376014|366016|38070700021|13003099007;
x-microsoft-antispam-message-info:
 =?us-ascii?Q?wbWYkFx/geceHtvSJziwJ830wdyWjNw8uAHcBaLoz+vBpMl619ysofmoZwf2?=
 =?us-ascii?Q?rJgiR3Gy8UEgUuyTkhhfY+eNJOq51Ew3xYztPiB41CiAr0RvHqeV/yqCiLfc?=
 =?us-ascii?Q?hHYaIO/Avcc5sChJVfMuw1dswWa6SOWuK8aq/HMxqXTeZKaQA1k9TVVoA/g6?=
 =?us-ascii?Q?QJBo5hg9BFAVzqHisGqtyBzWMBYo2gVjQe0tH70RhQlWMi/s3KKn4XnpvOxG?=
 =?us-ascii?Q?yPHK4BHiWSP+Sf/NpRWiseqA7lt+wKsba7p/M27wjO7wMo6VXQaswMKaBwga?=
 =?us-ascii?Q?Zoc8AFF9oQHyUBZx8/wQJevNZybV0O2q/FJNuxhjLzocQVJ2sTeaUVHep8Nk?=
 =?us-ascii?Q?2ugreijSPnmlhMtMspua27pjZ8bkQmkC8xqZszGoY1muFFmS+yVwdQMOrM5Z?=
 =?us-ascii?Q?xOd1QQv2Wm4AN3U3zSyj9D3aAqrOqAt/AG/7Ntq4Wfeld7Q8w6bJ05LAT2cR?=
 =?us-ascii?Q?JFdlbYxlWJ0t2El1kzreyti7j58DVXbCPIWU4fs8A2e9G8Y6s2viz32OxllL?=
 =?us-ascii?Q?7/10e3w5DmXMHOfliA962+rk+mCvtPtzukjZ7bWttHNBbKPIE46jDexfx8RY?=
 =?us-ascii?Q?sgtfGAOMLTO0qCSyPoQ4lzszD8EvkM9KhfUfOMIZpXx4X2kf5+fqQp066UU7?=
 =?us-ascii?Q?QF8m89drHYpSFU3AwT2PCVEh/a0fxTp2fq+Wqk3jMY08tjRdauvZNPJxeS1V?=
 =?us-ascii?Q?wAhzclXfh1NbR+XQg6Sy51HEZJgiPacMz4Ipq+ESBxu3jI4dY5qBlQV0efGO?=
 =?us-ascii?Q?R26D952DdRGKu3RoldmtGo0ffc4LodQ1g5J46lPfKsvArQrr50o2g0hAVIB4?=
 =?us-ascii?Q?58pehzpa2Q7zdJ0R5jMAOJtNVxGSGglYHtb6UrP2BWG/3NVpDxwnymWk6IWa?=
 =?us-ascii?Q?6Jeuc5Pums/cZuG0QqYp/9qONwIl8F34/me2Rg3uN1oQM5CoiiNKbqxUMfu3?=
 =?us-ascii?Q?m/GOoCRBsq3Ut+C7F6fG3ptHc+qBHEveyEa5DfXmo0rWvrxOnQuNcqZ34cUg?=
 =?us-ascii?Q?nunqWC2SahvUyN0WOMqeMcefXDYI0cLccz4hl34/fWYBpZmKDMFjEULMS8Jb?=
 =?us-ascii?Q?l3DYg+pGV74l3GQ1TzLEeCJxTltBaT91/TF9mSfST4ZtL/wcgsVX2AXVt+sE?=
 =?us-ascii?Q?nGe9NzoMxIzWtexCfbvJtaOb62iiIcunH2Wo596iryM0EiRQCr/NKQArm2dJ?=
 =?us-ascii?Q?fMndNvWnDz+PDZ0SHzteHH9EXaptrEAe79Gc0oA0kQf5tutLtACUGOKEqsKx?=
 =?us-ascii?Q?CIOVWo9WhrIulEBPJ4QD1EOsO6OQVnnhNGINMgnNiCxZiXFmoN7GZzbq+5Kw?=
 =?us-ascii?Q?ouy438gMlcamdXr/XHWS7zw/bPes/REW635/pTh7A9yN1qMVDDhOf+haAI/N?=
 =?us-ascii?Q?8JARDfW8MULcPxC/9c8xMPKu5mSlZjfs3A7QnuK6iz6JajounGPTGWFDNDU7?=
 =?us-ascii?Q?87TKISVX+mY+4HTHDeR4Kf9Ut0Zm0AzO?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR03MB7098.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(38070700021)(13003099007);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?y2hjd8CMWmYmwNA2pz1V8vTGYpzW0Pp5iFTmHzSKIZAfTG53guaz5ZePOLDn?=
 =?us-ascii?Q?M43JlF+oc1a9xc60SSVtjKBO5KcpqCsaumxhtkd9jnjtFRWxSyuT0mSmBhlN?=
 =?us-ascii?Q?rfVvvg73W5fL0/5JlHSYAW00tGsUeTGmEw/LAeJBoyf6hC0pYtZA2wjy43Eh?=
 =?us-ascii?Q?xRubcMGumYZsDK0YovNeWZCdFVH9jbCegfMnzMuubn+gnqWDiQjp8PPfDEqO?=
 =?us-ascii?Q?onoCMfdZIse/bhXos91a/kqoQJoTKjr4YEEJu570sOB66D11qLffMEuS8xIO?=
 =?us-ascii?Q?6My33yTH8wwqaiwss1DaqbJXj8ECoPIKOz7FLDG3A/sKbLF0I7uLVQPdnOAs?=
 =?us-ascii?Q?crsFT0wd3pMo0ilL8WZ359fTkO6gzos/X0s3UOZaqc+9kuZ9ky7nzc6rHEQT?=
 =?us-ascii?Q?ONL7LHXB83rfR0PCZ5odpzvohTZx6cDfjmX/z+SO+Lvf9cE3yjL9v+qSAwkv?=
 =?us-ascii?Q?m61xfs6Y0jR+gV361wy5kHjTBVg3qJSqCrmemAT+kjF9B6P9tn9AjK1KAPYy?=
 =?us-ascii?Q?ee7MZl8JCVrLAS9WQ42Jdo1j8VvcAyt551tFcrAGIRx0cNO4q1Autz8uFNWd?=
 =?us-ascii?Q?UMLpVrBiKsBhPDDsWh6eO2oioftAy3lz/q/kI14ZbX49eNjqdZR9bJBNIxhv?=
 =?us-ascii?Q?t+h5OYLhMjgbdvwr4G0Kk+bN9cnYTL5GVYPFaOqzQn0h8+LlVnGt1tt6ba9/?=
 =?us-ascii?Q?m6EwUboggskeUq/dl94rYRSeN0NoRgZeUzh7TqSZulAivNkW8BTkBf5Zs1Bt?=
 =?us-ascii?Q?Q8USFLH/UxQ3rsHN4I+k4+70WfEblcVPNk33S4FD4VtwNvm/bOjL8mmjQIPq?=
 =?us-ascii?Q?ElFk1UMhLLlgoymNiYzK6k/CV5hUPqYUlObNiML3B1aEjS28WeMY7+//IcyY?=
 =?us-ascii?Q?87xwcbp0hzuF8Np/xRpUTGUFELHXGMBy/rKaqOOJb1UmfmltF799+dUoiy4j?=
 =?us-ascii?Q?2uD3RGwkTDcLqNw/nbAXLRYm+JdmeTzaWk7+Qi5aHrJ5h9qbFqR8BOO6lQl+?=
 =?us-ascii?Q?y81lTgA7LJxXi0MHo8simCh7QWX19LVjVhzlwierNMacc/pqsVwNyjKlxzyA?=
 =?us-ascii?Q?CXVpBPI1TvSH2rXrz+DUVW4veRZ7ZxKs0PfKvsYWpdMZokJlJIKa0h5stZu+?=
 =?us-ascii?Q?6KI6rzNILzV0vjN6VY3uoNXpfZ7GdC75ECExLzWAl/rfds0zfuBF2P41/RRF?=
 =?us-ascii?Q?Jdgl6QCv0paK+IQ+uBauTsxp3/UOBhkjkcmgDDG2ApwtcrKNHdmnIkmYl7Af?=
 =?us-ascii?Q?I0zHBiOLOPgr/IVVbK3e9s02sk7Bjexal/CEI0+K08EjM0R8gl4u9VV9UjBP?=
 =?us-ascii?Q?5MoSEghMpPLKRPJUlthvcnfbrgHODfewY68XUXD3C4CHA81QJDTm3XUnbBc6?=
 =?us-ascii?Q?O+BzP6coeT3UNcA3oSw2MoWx/07WxNEkG7DOG+1XrTh7RGWgnY1jy7ArOwaG?=
 =?us-ascii?Q?Fm9EodJ/m+gjRfNgyI5GzdkxqsxZsoef8sHMBo6xLiga4iXBJTPPTKti0brY?=
 =?us-ascii?Q?aJF++QePLW53VWOgG3h67BSLoGQW99BbrjWDoFhhshAntefBtvzG+r3J1VOy?=
 =?us-ascii?Q?rvoprVtHCR0gEAMAMWqI70Utj6siOPsfWzCabBYo?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA1PR03MB7098.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 07aaca1d-3aa5-4407-30e5-08de21c8e292
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2025 08:53:01.0990
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Y6FCa4iRBRS5Xy/BgX6o902UtUaJyjog65geRfe4d2woA+AQACEcrqW3Ne5/3lCwj4PzrnUwW3T4EHTL+S/YBg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR03MB5887

Yes, x86 doesnt define UnsignedMultiplyExtract128
I'll make the following change, so x86 still compiles, even though x86 Wind=
ows should be phased out, now that Win10 is end-of-life.

#ifdef _X86_
    Age =3D (Age * TscSystemMul) >> 32;
#else
    Age =3D UnsignedMultiplyExtract128(Age, TscSystemMul, 32);
#endif

Owen

________________________________________
From: Tu Dinh <ngoc-tu.dinh@vates.tech>
Sent: 11 November 2025 5:19 PM
To: Owen Smith; win-pv-devel@lists.xenproject.org
Subject: Re: [PATCH] Correct system time calculation

On 11/11/2025 15:10, Owen Smith wrote:
> UnsignedMultiplyExtract128 is not available in the 22000 EWDK
>
> Owen
>

I managed to build it with EWDK_fe_release_20348_210507-1500.iso. Are
you building for 32-bit x86?

> ________________________________________
> From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf =
of Owen Smith <owen.smith@citrix.com>
> Sent: 11 November 2025 8:53 AM
> To: Tu Dinh; win-pv-devel@lists.xenproject.org
> Subject: Re: [PATCH] Correct system time calculation
>
> Interestingly, xen.h defines the time calculation in a comment, but does =
not account for tsc_shift being a signed int8_t value.
>
> https://xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dblob;f=3Dxen/include/publ=
ic/xen.h;h=3D82b9c05a76b7faedded8778fb8274a0d3d5d31e4;hb=3DHEAD#l677
>
> Reviewed-by: Owen Smith <owen.smith@citrix.com>
>
> ________________________________________
> From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf =
of Tu Dinh <ngoc-tu.dinh@vates.tech>
> Sent: 10 November 2025 7:13 PM
> To: win-pv-devel@lists.xenproject.org
> Cc: Tu Dinh
> Subject: [PATCH] Correct system time calculation
>
> SharedInfoGetTime uses the naive formula ((Tsc << TscShift) *
> TscSystemMul) >> 32 to calculate the current system time. However, there
> are two issues: firstly, TscShift may be negative (to indicate a right
> shift); and secondly, multiplying the shifted Tsc with TscSystemMul will
> throw away the result's upper 64 bits.
>
> Adjust for negative shift amounts and use UnsignedMultiplyExtract128 to
> correctly perform the multiplication.
>
> Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
> ---
>   src/xenbus/shared_info.c | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/xenbus/shared_info.c b/src/xenbus/shared_info.c
> index 06e0aec..fe29470 100644
> --- a/src/xenbus/shared_info.c
> +++ b/src/xenbus/shared_info.c
> @@ -356,6 +356,7 @@ SharedInfoGetTime(
>       ULONGLONG                       NanoSeconds;
>       ULONGLONG                       Timestamp;
>       ULONGLONG                       Tsc;
> +    ULONGLONG                       Age;
>       ULONGLONG                       SystemTime;
>       ULONG                           TscSystemMul;
>       CHAR                            TscShift;
> @@ -404,10 +405,15 @@ SharedInfoGetTime(
>       KeLowerIrql(Irql);
>
>       // Number of elapsed ticks since timestamp was captured
> -    Tsc -=3D Timestamp;
> +    Age =3D Tsc - Timestamp;
> +    if (TscShift < 0)
> +        Age >>=3D -TscShift;
> +    else
> +        Age <<=3D TscShift;
> +    Age =3D UnsignedMultiplyExtract128(Age, TscSystemMul, 32);
>
>       // Time in nanoseconds since boot
> -    SystemTime +=3D ((Tsc << TscShift) * TscSystemMul) >> 32;
> +    SystemTime +=3D Age;
>
>       Trace("WALLCLOCK TIME AT BOOT: Seconds =3D %llu NanoSeconds =3D %ll=
u\n",
>             Seconds,
> --
> 2.51.0.windows.2
>
>
>
> --
> Ngoc Tu Dinh | Vates XCP-ng Developer
>
> XCP-ng & Xen Orchestra - Vates solutions
>
> web: https://vates.tech
>
>
>
>



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Wed Nov 12 09:01:15 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Wed, 12 Nov 2025 09:01:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1159611.1487921 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ6j4-0006i5-RV; Wed, 12 Nov 2025 09:01:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1159611.1487921; Wed, 12 Nov 2025 09:01:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJ6j4-0006hy-Om; Wed, 12 Nov 2025 09:01:14 +0000
Received: by outflank-mailman (input) for mailman id 1159611;
 Wed, 12 Nov 2025 09:01:13 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=G0IP=5U=bounce.vates.tech=bounce-md_30504962.69144cd0.v1-2df2d64db24242bd9d1bb2f88bf0125f@srs-se1.protection.inumbo.net>)
 id 1vJ6j3-0006hq-M4
 for win-pv-devel@lists.xenproject.org; Wed, 12 Nov 2025 09:01:13 +0000
Received: from mail136-17.atl41.mandrillapp.com
 (mail136-17.atl41.mandrillapp.com [198.2.136.17])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1f37dea3-bfa6-11f0-980a-7dc792cee155;
 Wed, 12 Nov 2025 10:01:07 +0100 (CET)
Received: from pmta11.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail136-17.atl41.mandrillapp.com (Mailchimp) with ESMTP id
 4d5y744fx3zPm0X1g
 for <win-pv-devel@lists.xenproject.org>; Wed, 12 Nov 2025 09:01:04 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 2df2d64db24242bd9d1bb2f88bf0125f; Wed, 12 Nov 2025 09:01:04 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1f37dea3-bfa6-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1762938064; x=1763208064;
	bh=3UicpNfoFcJaDKqQXFLoSk1njs/j2vuBGjJsT4cCFdI=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=h7FJn69nosbSD6S4LrvRuhVAPo4LMZt5SoBeWvnBm343M4xmR5bl9bxOme+5zReKg
	 0MFsppuEULXEEdTtEK16YsjuJMr1/Ap1C/CzSsm/DKEsMVMa2SXoBO69AkO1scjFrm
	 N3ZOobMkdA9AYkUy0RPf79K+Mts7vMX9Xxk/2AjetnA4qblBMbbTwU6KvA/3YlKDBa
	 CsWTOfazbSfUbj+H5xTIcWcFseyOOva8ZimdeWL3YZYgUdUvV6Yr3AP+3zVhs7cgdf
	 kIArb9X+fwhx8Q4Do9STvQdJUNHWgpdUaLwGgabCNq3PFwUAUzxeJrxUp3LQYK4rjm
	 1Ad+b+8Lxcqyg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1762938064; x=1763198564; i=ngoc-tu.dinh@vates.tech;
	bh=3UicpNfoFcJaDKqQXFLoSk1njs/j2vuBGjJsT4cCFdI=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=OZzxLcKBQOcU2Vn9vGDg034u9djz3WKzNUMJRDBD07YGwT8DmvpGHirT95Mq+WdCv
	 BZu2y3Ikm9ZyBgDbIc4hN6MFR9P3Bv79fCC2Rcpq1Qt1HY7JpoNJ5pjzzbtSvv8Z+i
	 xPVUd6NMvCe+FMC1S7/h2u04qDN3m9Gb5Y/e0QVM1THy8QeEFoLOw5ljvlaqsLHVvE
	 ufH8TWJRp+XMIqPqJhGGj5obIvyejjYHPEuVAgS6pH2RMw0sQnwErzzwWLnl7OR+5R
	 XrRR3Lt6/aEbiJVwVsraXUHjViBgdS+D8DG+f6mXpX9Ss9KDLYCk3x1QZfi9SB0+3x
	 a5GtAWIidRkMQ==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH]=20Correct=20system=20time=20calculation?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1762938063704
Message-Id: <53e43bc5-d691-4914-a6da-0dcfafb3d96e@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251110191346.1847-1-ngoc-tu.dinh@vates.tech> <SA1PR03MB709817961E53F99A297E638FFECFA@SA1PR03MB7098.namprd03.prod.outlook.com> <SA1PR03MB70980413F6E6626002B82A0BFECFA@SA1PR03MB7098.namprd03.prod.outlook.com> <df6245f3-812b-4f0c-bbfb-f24885b6be54@vates.tech> <SA1PR03MB709883C037BDA4B3EE151C8EFECCA@SA1PR03MB7098.namprd03.prod.outlook.com>
In-Reply-To: <SA1PR03MB709883C037BDA4B3EE151C8EFECCA@SA1PR03MB7098.namprd03.prod.outlook.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.2df2d64db24242bd9d1bb2f88bf0125f?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251112:md
Date: Wed, 12 Nov 2025 09:01:04 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 12/11/2025 09:53, Owen Smith wrote:
> Yes, x86 doesnt define UnsignedMultiplyExtract128
> I'll make the following change, so x86 still compiles, even though x86 Windows should be phased out, now that Win10 is end-of-life.
> 
> #ifdef _X86_
>      Age = (Age * TscSystemMul) >> 32;
> #else
>      Age = UnsignedMultiplyExtract128(Age, TscSystemMul, 32);
> #endif
> 
> Owen

On x86, it should be possible to perform the calculation at 96-bit 
precision for the sake of time sync accuracy (totally untested):

void __cdecl ConvertTimestamp(
     UINT64          *Output,
     const UINT64    *Multiplicand,
     ULONG           Multiplier
     )
{
     __asm {
         ; assuming Multiplicand = (A<<32)+B, Multiplier = X
         mov eax, dword ptr [Multiplicand]
         mul Multiplier
         mov ecx, edx            ; ecx = C = (B*X)>>32
         mov eax, dword ptr [Multiplicand + 4]
         mul Multiplier
         add ecx, eax            ; ecx = C + ((A*X)&((1<<32)-1))
         adc edx, 0              ; accumulate lower carry into (A*X)>>32
         mov [Output], ecx
         mov [Output + 4], edx
     }
}

Though IMO x64 should stick to UnsignedMultiplyExtract128.

> 
> ________________________________________
> From: Tu Dinh <ngoc-tu.dinh@vates.tech>
> Sent: 11 November 2025 5:19 PM
> To: Owen Smith; win-pv-devel@lists.xenproject.org
> Subject: Re: [PATCH] Correct system time calculation
> 
> On 11/11/2025 15:10, Owen Smith wrote:
>> UnsignedMultiplyExtract128 is not available in the 22000 EWDK
>>
>> Owen
>>
> 
> I managed to build it with EWDK_fe_release_20348_210507-1500.iso. Are
> you building for 32-bit x86?
> 
>> ________________________________________
>> From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf of Owen Smith <owen.smith@citrix.com>
>> Sent: 11 November 2025 8:53 AM
>> To: Tu Dinh; win-pv-devel@lists.xenproject.org
>> Subject: Re: [PATCH] Correct system time calculation
>>
>> Interestingly, xen.h defines the time calculation in a comment, but does not account for tsc_shift being a signed int8_t value.
>>
>> https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/include/public/xen.h;h=82b9c05a76b7faedded8778fb8274a0d3d5d31e4;hb=HEAD#l677
>>
>> Reviewed-by: Owen Smith <owen.smith@citrix.com>
>>
>> ________________________________________
>> From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf of Tu Dinh <ngoc-tu.dinh@vates.tech>
>> Sent: 10 November 2025 7:13 PM
>> To: win-pv-devel@lists.xenproject.org
>> Cc: Tu Dinh
>> Subject: [PATCH] Correct system time calculation
>>
>> SharedInfoGetTime uses the naive formula ((Tsc << TscShift) *
>> TscSystemMul) >> 32 to calculate the current system time. However, there
>> are two issues: firstly, TscShift may be negative (to indicate a right
>> shift); and secondly, multiplying the shifted Tsc with TscSystemMul will
>> throw away the result's upper 64 bits.
>>
>> Adjust for negative shift amounts and use UnsignedMultiplyExtract128 to
>> correctly perform the multiplication.
>>
>> Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
>> ---
>>    src/xenbus/shared_info.c | 10 ++++++++--
>>    1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/xenbus/shared_info.c b/src/xenbus/shared_info.c
>> index 06e0aec..fe29470 100644
>> --- a/src/xenbus/shared_info.c
>> +++ b/src/xenbus/shared_info.c
>> @@ -356,6 +356,7 @@ SharedInfoGetTime(
>>        ULONGLONG                       NanoSeconds;
>>        ULONGLONG                       Timestamp;
>>        ULONGLONG                       Tsc;
>> +    ULONGLONG                       Age;
>>        ULONGLONG                       SystemTime;
>>        ULONG                           TscSystemMul;
>>        CHAR                            TscShift;
>> @@ -404,10 +405,15 @@ SharedInfoGetTime(
>>        KeLowerIrql(Irql);
>>
>>        // Number of elapsed ticks since timestamp was captured
>> -    Tsc -= Timestamp;
>> +    Age = Tsc - Timestamp;
>> +    if (TscShift < 0)
>> +        Age >>= -TscShift;
>> +    else
>> +        Age <<= TscShift;
>> +    Age = UnsignedMultiplyExtract128(Age, TscSystemMul, 32);
>>
>>        // Time in nanoseconds since boot
>> -    SystemTime += ((Tsc << TscShift) * TscSystemMul) >> 32;
>> +    SystemTime += Age;
>>
>>        Trace("WALLCLOCK TIME AT BOOT: Seconds = %llu NanoSeconds = %llu\n",
>>              Seconds,
>> --
>> 2.51.0.windows.2
>>
>>
>>
>> --
>> Ngoc Tu Dinh | Vates XCP-ng Developer
>>
>> XCP-ng & Xen Orchestra - Vates solutions
>>
>> web: https://vates.tech
>>
>>
>>
>>
> 
> 
> 
> --
> Ngoc Tu Dinh | Vates XCP-ng Developer
> 
> XCP-ng & Xen Orchestra - Vates solutions
> 
> web: https://vates.tech
> 
> 



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 13 10:07:27 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 13 Nov 2025 10:07:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1160876.1488921 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJUEf-00025W-6m; Thu, 13 Nov 2025 10:07:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1160876.1488921; Thu, 13 Nov 2025 10:07:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJUEf-00025P-4B; Thu, 13 Nov 2025 10:07:25 +0000
Received: by outflank-mailman (input) for mailman id 1160876;
 Thu, 13 Nov 2025 10:07:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CK2P=5V=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vJUEe-00025J-L6
 for win-pv-devel@lists.xenproject.org; Thu, 13 Nov 2025 10:07:24 +0000
Received: from PH8PR06CU001.outbound.protection.outlook.com
 (mail-westus3azlp170120001.outbound.protection.outlook.com
 [2a01:111:f403:c107::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8afb9441-c078-11f0-9d18-b5c5bf9af7f9;
 Thu, 13 Nov 2025 11:07:23 +0100 (CET)
Received: from SA1PR03MB7098.namprd03.prod.outlook.com (2603:10b6:806:338::6)
 by PH7PR03MB6942.namprd03.prod.outlook.com (2603:10b6:510:157::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.17; Thu, 13 Nov
 2025 10:07:17 +0000
Received: from SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15]) by SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15%6]) with mapi id 15.20.9320.013; Thu, 13 Nov 2025
 10:07:17 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8afb9441-c078-11f0-9d18-b5c5bf9af7f9
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=luUkfkPTZojE2ExCJZURD5Fu8XDlufZ588oAexoHj1dQ3/iZqs+oiSDwosPui5A64BozVf7gbaVqvchRgR1quKM01k5WMTQOwTrmz1LZiRWNhZ/UMbZPskaEKeHj60jjVE7m7kSozddwwHCJWbmsM6dyoiFdWV3aXxonurR7vIxxxisAI5oUKO8P08lMlqKjX8ZYn68/dRv7Emn6CyStqTdMKVDManFoeTSOHhCz6A66Y/e4ZHio803WJm7bePuDKXEJd4eZdC0PV9iS6BCO+ZIF1v/6gsqp9S/bgO/gvu1VwVutZO0xOIcC1Ci/8KbBMVSqiOA/CXodWW2RTXe6zA==
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=XpcEByTY5uH/uajFykvcy8KsCxhavIeN4jCbKzJrcqY=;
 b=m7rjH27H9VM/Bih27QVk4ELbJPa2hLdWivXMUxZ6GZIP5Qw4lKY6H6TA1VmI/eWA6VHDmrv1ajxm5Axmtb8Ne9qPUUehQ5oNfSnp+4YZ3kNMHTLYUa5FjONooMCWFB6jm58P4lXiieviVA6owa7U+hVAWbKpjINno1pFFPQAmqkFdk2o1s6j63maIPNXm7xQO5a/ubFCU6wHkXzEsvokFB7n6yJDerkxMzGHW1SLqQO3tn+W1NiHcykPwLPicjUrlszqFICeorRNkeD7VmPwefNAVak3YypAtqBrKwqgjKVWD7slklhSXHRzNnVavDEXsS1QLM/LCtlBDd7VjJkZVA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XpcEByTY5uH/uajFykvcy8KsCxhavIeN4jCbKzJrcqY=;
 b=y8JG2PFsTksxpVUJ3q/MaEe1U++6UCYkGk2+0MJrAk3OlqfKg51zN0mKfcsxFKa9FeQREu/VNo2aBmMs9T430qqnMgwU/ivYHYuA41rciWFgsAYipPUUiGvJVkq4hJ0Rw0ceSiBCZNrQC6NJSw+XW9dLBFUrN7o4OOdmlBzZ9GA=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
CC: Owen Smith <owen.smith@cloud.com>
Subject: Re: [PATCH 2/7] Add support for CodeQL 2.20.1
Thread-Topic: [PATCH 2/7] Add support for CodeQL 2.20.1
Thread-Index: AQHcUuYBfJ+eGnTEek27bC+qrgShibTusVcAgAGxbCE=
Date: Thu, 13 Nov 2025 10:07:17 +0000
Message-ID:
 <SA1PR03MB7098542CD95BE023A54C1CD9FECDA@SA1PR03MB7098.namprd03.prod.outlook.com>
References: <20251111083418.1657-1-owen.smith@citrix.com>
 <20251111083418.1657-3-owen.smith@citrix.com>
 <bf4d7399-c70b-43a8-9058-4ae0dd0be599@vates.tech>
In-Reply-To: <bf4d7399-c70b-43a8-9058-4ae0dd0be599@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA1PR03MB7098:EE_|PH7PR03MB6942:EE_
x-ms-office365-filtering-correlation-id: b900f946-da18-40e7-5c13-08de229c6d3a
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|376014|366016|38070700021;
x-microsoft-antispam-message-info:
 =?iso-8859-1?Q?5Hp7ZzgBJKehSAwttWk8V5D5d9QIWYWy6/WnczbpqmPTXHnG3hKcUQlpYf?=
 =?iso-8859-1?Q?5VV3WIXwDrQ17FLpI8y+r0AfiXLwhw0K0jf9UaGGeqAKFM3HHbq+bwQdzH?=
 =?iso-8859-1?Q?vk8ujyUBwXPbuIuqsQcYAcju5MlBHSnwO/YocxFbH0XMeLTuJadPNKpGw0?=
 =?iso-8859-1?Q?/aWAIYs+BWIXc+Mh+ZytT5vGLgJwQSRaixrGWV5Elq3ls1NfFNMuYfr6HC?=
 =?iso-8859-1?Q?iEnpgqrt03N8O6hbCkyFv/OEd7RGWwz/MP73VpU6xvNPfJAVEVRcIDIlw1?=
 =?iso-8859-1?Q?tLlfB8ptjl6NjhqGjM1sS4MlmSkV8F/SfbBzvADpUf25Ysu0zL14lF3nFH?=
 =?iso-8859-1?Q?hHQ4O1AlRte00Pg70oFFngV8QBQ4TO4VLfxHOjGW2v52kOjvZ+WH1o5J7y?=
 =?iso-8859-1?Q?x+y8i+nZAPjUF1x6C3/0tsSNaFGYImzEzogwXW6fITl78fwE8r/OCLGmHn?=
 =?iso-8859-1?Q?bFt/rORYUGrCBGfZRJ0lWRErS0yYWCv8+idDl7SS5wejjTeILqgw1z15g8?=
 =?iso-8859-1?Q?5Xadp3Sa7EvIfaw3KiU4GyaW8qs0MC2wJWwkoZNfZ3U2YdjOeHfauyQ5JT?=
 =?iso-8859-1?Q?t+cdu+wJMgwS+JfXr1EMRBenoNJETNeGT4Fjbpag5+LcEryLjyNCygQfmH?=
 =?iso-8859-1?Q?F8/hx9BzfyAU7lpxW4Xg+WBDRgPmb9JD93uladxXOAE6W+tmIzuGyuoGms?=
 =?iso-8859-1?Q?UmWHf4vWZRt0CA7UKmzY2CKRIIPtswYkFHGeCgfCLsTSNTOkJ5NfIhkcLl?=
 =?iso-8859-1?Q?0Jwm3rAbYI7niJ7s96h8fFN+Q91ALywEiEv96QKNfIrifEN8ce/j5ROZHl?=
 =?iso-8859-1?Q?BGoeZ+p/grIvpZTRs8EvixN1/2sBd4VGvDpx40DMTrdkm9FN1RfXItnWz+?=
 =?iso-8859-1?Q?ReJng1nHp33W4O5Ds8JspaWm782pOOHqIyRbfqYYUu7X7qrq+RnDydQwZo?=
 =?iso-8859-1?Q?WrBYicAFB78wZHnVIdjwUPeUmSmn1SwcJSUw+9H9tHf2neMGn5PNLhwvY3?=
 =?iso-8859-1?Q?Ql4TAxY97ZdnZVB4ge5wtnV+HNKzPkZpV9CnWmER+mjX6D8cklefv6QD/Y?=
 =?iso-8859-1?Q?Yf1ewgWBylcoWFznpgAwnK9r/cgv41GXsXNjS7G4BASX+mZ8x8ijTr4zFm?=
 =?iso-8859-1?Q?2sbdmdnIR53DiOatz7jYTx7y/HryusoazRLPX0TT/Y05f9tSJQTd5JZVO0?=
 =?iso-8859-1?Q?mr0e1X37jsyQXhO3i+5m3vX+zf4O3a1e71Q7u/b4kmiSgtg+N6afwuG4j1?=
 =?iso-8859-1?Q?L/zUo3oMg76nSaRcTbKNJCUZW0vtclQPETkJzXKQrHmV9fj3sldfP0a697?=
 =?iso-8859-1?Q?yg24SSvPW2qmMRfjUzsymp9grg9EZuGCbZ8zO3BvEEf2P9idyKEy2aKA4j?=
 =?iso-8859-1?Q?+bgVVPBhekMMMxFKnPH/qjla4cJx4rM7U+hmO1fhw6t5P6gRpXLA9T2YqV?=
 =?iso-8859-1?Q?uHYV0CaEoza+5/YWLsp0RLeSlsnc+EmK1JHzCLwG9Gm9gNs0q0zF3UoeiH?=
 =?iso-8859-1?Q?21hcpcXutbw8Z8GD5L5MvS7e8Ak36hq3uNd3L1XiUuTSTagmsSVGvikkgu?=
 =?iso-8859-1?Q?3ezO9TcKV5Bxt+QIgUew6TrLxwJs?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR03MB7098.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(38070700021);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?o2sz8Rlp+mHSHqCAMLb4ZcMPrElHNs7202kb/L+g33ThnWm5FcmUj1O+7z?=
 =?iso-8859-1?Q?mmrOwOGRgPhhA+vPzixF4q5hMp+v8lN8qI7VqlqjSaR3unKA/c/I06DhvD?=
 =?iso-8859-1?Q?BYjSGYKU8712XzqikFhB89X+4EAPRb0W+NZvHVieWNseuD33nQvzi2s+yf?=
 =?iso-8859-1?Q?1rDZyX4WQNmXFma3HkqE4mpnRFcOqikXi7vTQoXumgiEHx/+8O30NPuUWP?=
 =?iso-8859-1?Q?s6VL5KLD3hfKtpJuJkJsSy8BtKhc6TmIy/evH12DDdOOawPcvJ3korjHIu?=
 =?iso-8859-1?Q?Z0kMQnES2AjMbuN8huxsDX3qKwwaEdEJsP7WRcaP4RitHR4Pd4pQR01Mc2?=
 =?iso-8859-1?Q?sJQZvgt2O0Ir2wCatdHrFrw4v4g1sVCApLnOYMiey0mynptL1pdCxW4VKD?=
 =?iso-8859-1?Q?/kqXuc0vD7APVMUupXih7vuCvIaoyUjtmvx68JzZWzGj11US+B5rSegzad?=
 =?iso-8859-1?Q?kNNXfcsdprkz8ZSYtk7cEshttyv/pyhjvx9pafS67C7LSsv604w5qcqvVi?=
 =?iso-8859-1?Q?epv91hBCwmIIDI9i8xc4PhEz50KO5wAsV8Z4jeojqeROa/M5YIgKS9NHfZ?=
 =?iso-8859-1?Q?zSQn+rHv+oRkwlfo7gBq9gm2JXlw3ajutQ49nHjyeQN3Sib6P5irU0YhHQ?=
 =?iso-8859-1?Q?W2ybiPqP/DSb7oOK/i5XP+b2X5BrdW6T6Cj9cuSBpEZAmkNnSSM4p766Ty?=
 =?iso-8859-1?Q?9nRmzk2geUrc2cu4fwOUKhctJRzgspZFx3Qx43K/FmDL+KhnvMLSIobaCh?=
 =?iso-8859-1?Q?xtQGyahNABoSvfMC/UkJT+ZHskTzUFr4yPiRsQcoHFl7jN94SA7CqAAv+8?=
 =?iso-8859-1?Q?B6U+H3zrfh5PMvfJldYTqo59QCzrYztL3Kf+GD1d0DAm5sf0KI4jGmINfx?=
 =?iso-8859-1?Q?3LOonWZjPDY/U51ng9pa+DetlIUmff6+nEHcgDCfN1I8LwcR+rj2FZG9h6?=
 =?iso-8859-1?Q?/0cB3/GOvkX1e/OTmW1unwGRoim/+/fCQuzqBwUD+bzmr1/7Z7IoWSX7Kw?=
 =?iso-8859-1?Q?Nt3ouAXzLCkfurmqTTXLQvHPG1EQdplAmx0LS8ArAnQNR6mUPgeRgW7OFT?=
 =?iso-8859-1?Q?oQSgmr0rzXVu6dXsPngMUNYXH7kSNmvzRhppIGH47G+eedrpMZykiO0fo5?=
 =?iso-8859-1?Q?MC9EWFvRaEv/MZWPFB0tQrR3NUAjI0pocxVpk3BWErmTFoaHc3j/nKe/tG?=
 =?iso-8859-1?Q?khHEZbrOQt+4w9C6/BPOOuFnBkxs75PY26lCNvaEG1i6Bd8g7R1v08UBuj?=
 =?iso-8859-1?Q?NVbuZl6AzC/tOScfoVkaKTwCy/FWfgTfuez4RH9B6OwXV4tLFHgf4q/Fjv?=
 =?iso-8859-1?Q?tu33scskxvvv7VGQBfvk3/Ew1AFo0iq+3CsZzQMAOgogDHWmhF6sbsEDiY?=
 =?iso-8859-1?Q?1Zz4Rx0lKyCNhCDn1+K2Onpl16a9t0PP00Xqj28NJHgqqe2W/zjm77UIm9?=
 =?iso-8859-1?Q?JmGQ+Br92yyngH8NIzi/pbC59IPB0hx+gH9hnpUgupdhwgzzTrQAYt0zTi?=
 =?iso-8859-1?Q?ozG+tYlwr3ZLcxxxTpGqyzHOexjHUeiTYz6r/gwimZ4embfqiBGgAtkBCm?=
 =?iso-8859-1?Q?uE8J6B1JNXlKnXIOwc3QWIva1fghDaX5h9h4zggKepZBkRUXosaA+Yo1ye?=
 =?iso-8859-1?Q?yU5zTa92JXK96r0zGq7C0cE2Qoju4lCiM7?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA1PR03MB7098.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b900f946-da18-40e7-5c13-08de229c6d3a
X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Nov 2025 10:07:17.5789
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: mUsVkZYkRuqhZj71Ndkbl3RUe/fY8If/beB4KnqS2UmZP91P9kIMn/izNMfWzdXF5TdsjHhXJ3rzWKzpdrInKA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR03MB6942

Comments inline=0A=
_____________________________________=0A=
From: Tu Dinh <ngoc-tu.dinh@vates.tech>=0A=
Sent: 12 November 2025 8:08 AM=0A=
To: Owen Smith; win-pv-devel@lists.xenproject.org=0A=
Cc: Owen Smith=0A=
Subject: Re: [PATCH 2/7] Add support for CodeQL 2.20.1=0A=
=0A=
Hi,=0A=
=0A=
On 11/11/2025 09:34, Owen Smith wrote:=0A=
> From: Owen Smith <owen.smith@cloud.com>=0A=
>=0A=
<snip>=0A=
> @@ -154,8 +155,10 @@ Function Run-CodeQL {=0A=
>       $c +=3D " database"=0A=
>       $c +=3D " analyze "=0A=
>       $c +=3D $database=0A=
> -     $c +=3D " windows_driver_recommended.qls"=0A=
> +     $c +=3D " "=0A=
> +     $c +=3D $QueryFile=0A=
>       $c +=3D " --format=3Dsarifv2.1.0"=0A=
> +     $c +=3D " --threads=3D0"=0A=
>       $c +=3D " --output=3D"=0A=
>       $c +=3D $sarif=0A=
>       $c +=3D " --search-path=3D"=0A=
=0A=
Using the & operator to call MSBuild and CodeQL may be cleaner here,=0A=
though it can be done later.=0A=
=0A=
    I had issues with the & operator calling msbuild and codeql - issues ar=
ound quoting quoted strings,=0A=
    escaping strings and using different quotes did not help.=0A=
    Creating a bat file to run the build from the codeql command line was t=
he only method I could get working.=0A=
=0A=
=0A=
> @@ -199,8 +202,22 @@ if ($Type -eq "codeql") {=0A=
>       }=0A=
>       New-Item -ItemType Directory "database"=0A=
>=0A=
> +     $queryfile =3D "windows_driver_recommended.qls"=0A=
> +     Try {=0A=
> +             $ver =3D New-Object System.Version((& "codeql" "--version")=
[0].Split(" ")[-1] + "0")=0A=
> +             Write-Host -ForegroundColor Cyan "INFO: CodeQL version " $v=
er=0A=
> +             $minver =3D New-Object System.Version("2.20.1.0")=0A=
> +             if ($ver -ge $minver) {=0A=
> +                     $queryfile =3D "mustfix.qls"=0A=
=0A=
You can just use=0A=
"microsoft/windows-drivers:windows-driver-suites/mustfix.qls" to target=0A=
a specific pack, or a versioned form like=0A=
"microsoft/windows-drivers@1.8.0:windows-driver-suites/mustfix.qls".=0A=
=0A=
Also, why is mustfix.qls being used with the new pack instead of=0A=
recommended.qls? I did notice new false positives in the newer 1.8.0=0A=
pack, was this the cause of the change?=0A=
=0A=
    recommended.qls generates several false positives, and apparent incorre=
ct analysis, which would=0A=
    prevent these codeql logs from being valid for WHQL submissions.=0A=
    The CODEQL_QUERY_FILE environment variable can be set to override the Q=
LS file selection, to =0A=
    test recommended.qls while resolving issues=0A=
=0A=
> +             }=0A=
> +     } Catch {=0A=
> +     }=0A=
=0A=
=0A=
Owen=


From win-pv-devel-bounces@lists.xenproject.org Thu Nov 13 10:08:39 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 13 Nov 2025 10:08:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1160887.1488936 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJUFr-0002cL-HF; Thu, 13 Nov 2025 10:08:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1160887.1488936; Thu, 13 Nov 2025 10:08:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJUFr-0002cE-ET; Thu, 13 Nov 2025 10:08:39 +0000
Received: by outflank-mailman (input) for mailman id 1160887;
 Thu, 13 Nov 2025 10:08:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CK2P=5V=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vJUFq-0002b4-Om
 for win-pv-devel@lists.xenproject.org; Thu, 13 Nov 2025 10:08:38 +0000
Received: from CY3PR05CU001.outbound.protection.outlook.com
 (mail-westcentralusazlp170130007.outbound.protection.outlook.com
 [2a01:111:f403:c112::7])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b8fb834d-c078-11f0-9d18-b5c5bf9af7f9;
 Thu, 13 Nov 2025 11:08:38 +0100 (CET)
Received: from SA1PR03MB7098.namprd03.prod.outlook.com (2603:10b6:806:338::6)
 by SA2PR03MB5772.namprd03.prod.outlook.com (2603:10b6:806:11d::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.17; Thu, 13 Nov
 2025 10:08:35 +0000
Received: from SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15]) by SA1PR03MB7098.namprd03.prod.outlook.com
 ([fe80::578c:fcff:d164:cb15%6]) with mapi id 15.20.9320.013; Thu, 13 Nov 2025
 10:08:35 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b8fb834d-c078-11f0-9d18-b5c5bf9af7f9
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=UFL46lk64JaSGvYxF+UzXj4nS3bzALxnuQ9j0O/qDY8KKm1yWA6prybwuSreBjbJoaCCPUjw3J2urvGZTqsWhYeiKYwX7DDIFlcqjosLKSFN3bNGpr9tFl6D+upw3hghXfGIXJetVu1VEgT6A0N4bPfYZvYPuNLT0OI7DnAtmCz2QldMj6bgDAdqBKgA7athbaYyn64LXFjkS7Zub2oszpZmNgUu9/wM6uSNZtZnUJlinJ9CkQgCIXGZW25VMNIn6u0ZfkGg+ZVFh5Qa7R1Cgv4S1VlySwt6rydtF70I0zqW/kZRWQdoNngmwvkU/Cm0bf9/4BYCvrWIDMGuZGHEgA==
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=Z+S7jvdlc62qoABqmJEWlLnJ48ClzRcAx1fNG8wk2xw=;
 b=hxDKazHBp0YxCzA4re9CCU5qd2CusEa8ZxAnK09Z6RiPeNi6ZnWiiSwBYlRLlznLxyDa+4fP6VA0etBt1DOtqyBP/CntMunRpD0wZk+Jn7zlNT4kvXelIzTC50q91FkvNB3GDTmlKhNCEU8UVWiTmXXxLOFOUG2TVab3jt65ipqF63voPSnqyuPmmOfA+A48MBJqG1RBuMLMVdQYzo5O+jLHCMqtDHLBBp9HSg7hjJIdM6S9uj8KMJJrDHLe+BwhFH5dbe4QjilQ3js9R30oiQv6QN388Dqe0m20K4ug5DfLmwx3QDYsxw4RLwbOcqwfq9M2rVs7bCb/ZBRck+Ba2A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Z+S7jvdlc62qoABqmJEWlLnJ48ClzRcAx1fNG8wk2xw=;
 b=UzBAaIXWyzkZAH4E+QG5I4kFlvmmV6SuIkQ0/qH2qF7XO1RzGN+VVgB9YAZ/eP6p49Mlf+gLJkA/btDBDNij9X7uLedBC/Qg1xdCa28a7YziP12S7c61KNKOrYw03O8kSm32u/f0UYTGLgCSwT+enUjRYQ7tAiEoErHnsIas3EA=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [PATCH 7/7] Add ConfigFreeActive / ConfigFreeSzValue
Thread-Topic: [PATCH 7/7] Add ConfigFreeActive / ConfigFreeSzValue
Thread-Index: AQHcUuYEklAKlj2rgEqonbjW/J3/wrTutlcAgAGukIc=
Date: Thu, 13 Nov 2025 10:08:35 +0000
Message-ID:
 <SA1PR03MB709864C6068A0FB62593D7E1FECDA@SA1PR03MB7098.namprd03.prod.outlook.com>
References: <20251111083418.1657-1-owen.smith@citrix.com>
 <20251111083418.1657-8-owen.smith@citrix.com>
 <11a77b6d-9444-4619-90e8-a1f771101ad8@vates.tech>
In-Reply-To: <11a77b6d-9444-4619-90e8-a1f771101ad8@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA1PR03MB7098:EE_|SA2PR03MB5772:EE_
x-ms-office365-filtering-correlation-id: 538e0d07-bf0a-4c93-57b5-08de229c9b66
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700021;
x-microsoft-antispam-message-info:
 =?iso-8859-1?Q?HpZlAAONXASM0gSec25s2cYrrES0AQ+9f2N3w6b3qbTxs/mAnG8nwR2cfb?=
 =?iso-8859-1?Q?4x/oLWXOBHptbYtCFAefieXYLytxa7Dn3fBkG8mA6d/BsKFEsaEBlBsYqg?=
 =?iso-8859-1?Q?cimS6iBGp5XRrjh477Xg3ZwbA7hmT2uQ9xZhj+qAMMOqqEwBllao3deciQ?=
 =?iso-8859-1?Q?YtdpLl6kT2vgPOuZsQCmPo4cYVT1ZqcySMNtfup91kXhUIsCHELHe+3zbp?=
 =?iso-8859-1?Q?FeK+Y1+Rub48X8/pIIFW2AGWdVsYDDdfQZUTrlIsfqdMiufaq7MadZm1Fp?=
 =?iso-8859-1?Q?vxGuiknQMcE5q3/RlvbZYK60DbD5NVUj457kVEVJz+Nu2ApYOTw2+oQt7q?=
 =?iso-8859-1?Q?F2O0JiX/wga6eZQtMpXbZ7V1HGGcrHrGcV0z49eRbs60GtQYNyoqP9VwyC?=
 =?iso-8859-1?Q?zQuQP72lJ6CrVu2JjQfwI+M4GTv82TBMdTCnApMLg89TcnE1BXOCm3pgJS?=
 =?iso-8859-1?Q?V9+X9DZ7+a9O3olvhzobihh+ZL/rIev6s9Si/koz+KT99uainLDFSW9H5C?=
 =?iso-8859-1?Q?xSyNeF1e6jOmm73uV/eGWv9gcEWTpv4Au7qo6NdcaHXQBf1BTi8ex86Yn4?=
 =?iso-8859-1?Q?KqyFDpljLBiFMOiHibxYtcLAapi2b529tRs/dFWMUzEMkRGotiFtkVXOij?=
 =?iso-8859-1?Q?vrXG85+pipzf1p+42vLkrgnhSpaIT9ytwkBuRNEzuSkDSL/Fexr2j8CJsE?=
 =?iso-8859-1?Q?P+wP0TMkpXGj2yRdSlQ9fEbTkSDQ1oorCCEK4/J0WCCapPqmY5V6NtXJRt?=
 =?iso-8859-1?Q?JCnEZ2bhK4FCqjjS2+iOkXcIiJChm9pjBoYwcl6qbyzQDevnK6BNei0mh5?=
 =?iso-8859-1?Q?XHEIeZ2xMm6smhJeTl1DmZsfYdp0WajQCZtCdsxRkJZVlhJ3IKChONGheD?=
 =?iso-8859-1?Q?qbRJHkoTjFfS8bDhzwOpBPcUZ6jbG+AhsJ9Sc311u7b54XEqI5EVaMwE8t?=
 =?iso-8859-1?Q?4YzQv3MPvJF8va76uBKyRdbTnmd0obHvuvQQ6QsNw9tN2i0Z8/xMmgj8Bj?=
 =?iso-8859-1?Q?kreMzjl3gwkFgjwmESbRAbrBvY4ThMuly5qwG46gLY4M+jxl8TISa3N4Jr?=
 =?iso-8859-1?Q?w3UlaYYmbKogRHPcG4SPWrIDxng8VUkpjI188QQ/RCwrbMsnDojQexrrup?=
 =?iso-8859-1?Q?mVAYnklIOMtfSeGxANFuTwJFyasbLoTpEEwu1Y7ASbmKWQFgUFIE9alPHF?=
 =?iso-8859-1?Q?Ax6FDt5cme8wQ6VmnejlrUBhjhgzsk3qBplQHO8ox9cQYcPjXrs1t+0o4n?=
 =?iso-8859-1?Q?X274dPw2cWHyYcpFt//lXsjaVdczUqjZXP3Ima6AXKx9D2sUhsae6/Ds/l?=
 =?iso-8859-1?Q?RxqiOsgpxkxV+uYE2ZStfmA00Coo+HVsl62pQ1NGHjz1OQsy/J0KLVMmLy?=
 =?iso-8859-1?Q?j0uSgVtM3R8Bb8q66usLB9yddqbb74Pmxt0loiZkkooJIGNM5EP/2K8wFp?=
 =?iso-8859-1?Q?ivcZhPvt59GDquO5k1H2bkpftoBkAbK1lnUu6hl1gZYXbvBr+hXK0eqw+X?=
 =?iso-8859-1?Q?OKCfzks64qEMQbNHVVJP4/P+dxXLxcyl3/1kpawWbyPPekhFfAqp7jbs05?=
 =?iso-8859-1?Q?IVbxFsfDT42ZHlgKjLhprOUmHx0k?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR03MB7098.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(38070700021);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?iso-8859-1?Q?aXs8LP0KAMjPv2YueLuU6nwib1pX6G8jP6nX3TeA9gAMaRcd/08D5cEGzz?=
 =?iso-8859-1?Q?aE6f8sBnxmd53XVVHMyrffFvhNDIGlchmbM2CPsidSZV+XUKTH15DUL6PH?=
 =?iso-8859-1?Q?lwA2Px2NIFfN6MIcztdohpT2Dv1PXp129JSFZiElLxJvPR5/wzOjrNBqx9?=
 =?iso-8859-1?Q?lN8bOhCeKTP1MFobcxHSwp/uw9a60N8WWPSI9Y50nJ2gw4x/ltGWSuQZgl?=
 =?iso-8859-1?Q?ODy9I62aqyspPYRCcKDq68SzP/dbDsgJ6rLWtxX6yVb+2J1nxsDS97d781?=
 =?iso-8859-1?Q?mqTJhS0pbPaRm3GXIAi5p2CET4ms03RaTsMiRiXmIF7xkq/uLPdbvGJEvy?=
 =?iso-8859-1?Q?Ch0pnxctmeMoxbXRlvFGzaNJ9xjm5AlV3GLIh/OseFMkxH+mO7H627FodD?=
 =?iso-8859-1?Q?xD7uSRfZ/Dl8xLWalldVy8/LU4CjRSbY2e43ffSMNv/jUFHxwqXzKXngkJ?=
 =?iso-8859-1?Q?isfq6T0Cmr5uUBQQ1NggnzfQjkcDf14hF8QwEhL2tz+r70B8hGjMcCbOg3?=
 =?iso-8859-1?Q?qK9l02BbChcQSwtauP64WNopFiAUk7LuvOj3hZi0HiHEFZ41RlPsdYobIl?=
 =?iso-8859-1?Q?cdcXEaS6YvaHCHeWRRHb3QPn6fhj7bhBRpFN+/6qb2qac5BPvuLRyB2I2N?=
 =?iso-8859-1?Q?VbF1TYdA4+WToxcARMVb9NHHw7yqHTlRd+E2K0YeslWrvfEijJpQ1u7oMz?=
 =?iso-8859-1?Q?Z3niSIE5O83JTkkDH3BWnMRp2xdVF6JlJYr53SjsRI/PbIrub7ZPdxdxwQ?=
 =?iso-8859-1?Q?pRBqswmSk2vzVEgJL+6byvUj4uGuIl/9gVK6wA990fMLzEFlEmubsxs4vJ?=
 =?iso-8859-1?Q?IbfCD56pwAYXMVYqcArgj+rJkm25LKnMTSNnZpxylGFuid58edtIqD8pID?=
 =?iso-8859-1?Q?/n2Z6jg15EhdH/GMdPENbQT/J7Z8YErnE13tzZ9Pl9dAX9v9zcMahb1uS7?=
 =?iso-8859-1?Q?QbWrRNfna3VVrB2lIKh+KmbVI5OmskwCh2ksBmnw776+gn9UmOC9FzAixI?=
 =?iso-8859-1?Q?03CSlqSF9VVqzbt99yG4X4Kty0O4D1drkpYL751l9liAc/Mjr2wEeWrIHV?=
 =?iso-8859-1?Q?xKdCV/n/yzUJV4kD6gnA5p/Oz4iTS5EnDVkpmCs33GUZp111rRP4PSIw5V?=
 =?iso-8859-1?Q?D/ZSOmdUHtu5uIwhxjxp/5WnJZtLV48TsD7X9nxb+ZG36/qCu8CaunnZg4?=
 =?iso-8859-1?Q?/VVAgXOjhbvhGwB8fLQvrbmT0Oniu9pRFaHuXD9DPE8WDh9bqs9amHzhfw?=
 =?iso-8859-1?Q?UpygoqbIYnIhDkGxl9pEJev3IhgFNUnXNoMyO3kmZ8I+DNM0odzIQYRoYU?=
 =?iso-8859-1?Q?hN33ZHAP7VxUWA5VHDQw39IgQNFCNs3HIN1wJn0CHIOCRgu+o0iuMR73Em?=
 =?iso-8859-1?Q?nROwUkVfU+F+nOw0fZWXuPtJ8luTXw7+CT1bN25dJUdI4NXUXLucPaiQzS?=
 =?iso-8859-1?Q?A8Qu3V0bkLa7aKcpc2eCUJUVxOKiRCwUk+UJt3Yj4ASh3Z1IYTbSzRXg4+?=
 =?iso-8859-1?Q?H9zygJHJKOmyeZGCrBavIadGbxuy6dDFjITJ73Fm5lOwVWF4RnVhGO6qOk?=
 =?iso-8859-1?Q?NSWDkhXtj8J0BiSmhQNUgHik2dVPArpcVzZBG5bUetLg6iM0hXOyqu4zsv?=
 =?iso-8859-1?Q?ddQ0xT0qO5Fe4X6/+cSf7TZw4/kp/JEVed?=
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA1PR03MB7098.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 538e0d07-bf0a-4c93-57b5-08de229c9b66
X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Nov 2025 10:08:35.0232
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: bov+jTf6E5iyzVlx0OCPCWMR/OLfi+MB9tyKncKjkLAGvOxDxfOWaAni8sm8eGviI9iMQ+KoLLSSZj99CIBu5A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR03MB5772

Agreed, a define should be used for the pool tag. I will update for v2=0A=
Owen=0A=


From win-pv-devel-bounces@lists.xenproject.org Thu Nov 13 12:22:41 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 13 Nov 2025 12:22:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1161176.1489188 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJWLX-0001s2-9z; Thu, 13 Nov 2025 12:22:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1161176.1489188; Thu, 13 Nov 2025 12:22:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJWLX-0001rs-75; Thu, 13 Nov 2025 12:22:39 +0000
Received: by outflank-mailman (input) for mailman id 1161176;
 Thu, 13 Nov 2025 12:22:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=pneE=5V=bounce.vates.tech=bounce-md_30504962.6915cd8b.v1-24d9bc06577043f6b773545ef0da4fa4@srs-se1.protection.inumbo.net>)
 id 1vJWLW-0001rX-OX
 for win-pv-devel@lists.xenproject.org; Thu, 13 Nov 2025 12:22:38 +0000
Received: from mail179-26.suw41.mandrillapp.com
 (mail179-26.suw41.mandrillapp.com [198.2.179.26])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 702a2738-c08b-11f0-9d18-b5c5bf9af7f9;
 Thu, 13 Nov 2025 13:22:37 +0100 (CET)
Received: from pmta12.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail179-26.suw41.mandrillapp.com (Mailchimp) with ESMTP id
 4d6fY75sFrzKsbpXp
 for <win-pv-devel@lists.xenproject.org>; Thu, 13 Nov 2025 12:22:35 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 24d9bc06577043f6b773545ef0da4fa4; Thu, 13 Nov 2025 12:22:35 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 702a2738-c08b-11f0-9d18-b5c5bf9af7f9
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1763036555; x=1763306555;
	bh=6P0c0AvzqShH162LTQKr/AN4TWef3yXiYjnK+B8YYQg=;
	h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=lbKdJABvabPeu1zMXnAHEAqiiNigItvanRB7PnHOcYnnuQWyKeXXqYayiFLx3a+Oa
	 rNS23qKuXrgHgMbQrLysuxDwTb2nxpx0w3R7obg2NnwqMJW+8YofffZHHac889ApwS
	 fn4xFr1B1v6qMaqszEcM+0RPPIB2NCFUcTJLdAOiMrvXjmjLRq+kmOXae2hc2hMZ5J
	 OLRD5JTody06kgl07klO/21kjSRD4Fu5Dq7LtXCVv0uoKUuOECUBH2+s+WVps6eMa/
	 ORYW2UafgmYsaJTwbJwsA5gUoTAxthG3qkelnScL9RqImXy4fwsYTEug6gvKr1M/kR
	 UnoaIecbepeHA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1763036555; x=1763297055; i=ngoc-tu.dinh@vates.tech;
	bh=6P0c0AvzqShH162LTQKr/AN4TWef3yXiYjnK+B8YYQg=;
	h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=au+guz2eM127TdB3kKcsMySlI+I1hiL6JCzgtIMye07A6J3ssFiFXrHTOlS0fvSrG
	 BDFGO9M8y++Awo1xzPCyE3dtyQ1RbzV7wFFjT/VarB69zqGcc+6GDwZHPo48jkX7G5
	 oxAn97Hsdvz5xg8JlezMHO/cNh3mp6YSET1HFj3ijQzmYyro8uRO9IhGmjCCOCFd0y
	 sOhT5TWSj/Bu9hmusX7wN0aNnOQgHcvi6ZFXASBFcpNTHOWm0QQ+g2o4sCBmB1zoD5
	 kztK5sCYCY5CvWDKxZitIUIa6rLuMV82kkUYUBTScmzw4vPW7+nP/H8TyEslSXHFAc
	 TSGuNHg2V/p+w==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=202/7]=20Add=20support=20for=20CodeQL=202.20.1?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1763036554662
Message-Id: <7951352a-c9a9-429b-bae5-5b89431099de@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
Cc: "Owen Smith" <owen.smith@cloud.com>
References: <20251111083418.1657-1-owen.smith@citrix.com> <20251111083418.1657-3-owen.smith@citrix.com> <bf4d7399-c70b-43a8-9058-4ae0dd0be599@vates.tech> <SA1PR03MB7098542CD95BE023A54C1CD9FECDA@SA1PR03MB7098.namprd03.prod.outlook.com>
In-Reply-To: <SA1PR03MB7098542CD95BE023A54C1CD9FECDA@SA1PR03MB7098.namprd03.prod.outlook.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.24d9bc06577043f6b773545ef0da4fa4?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251113:md
Date: Thu, 13 Nov 2025 12:22:35 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 13/11/2025 11:07, Owen Smith wrote:
> Comments inline
> _____________________________________
> From: Tu Dinh <ngoc-tu.dinh@vates.tech>
> Sent: 12 November 2025 8:08 AM
> To: Owen Smith; win-pv-devel@lists.xenproject.org
> Cc: Owen Smith
> Subject: Re: [PATCH 2/7] Add support for CodeQL 2.20.1
> 
> Hi,
> 
> On 11/11/2025 09:34, Owen Smith wrote:
>> From: Owen Smith <owen.smith@cloud.com>
>>
> <snip>
>> @@ -154,8 +155,10 @@ Function Run-CodeQL {
>>        $c += " database"
>>        $c += " analyze "
>>        $c += $database
>> -     $c += " windows_driver_recommended.qls"
>> +     $c += " "
>> +     $c += $QueryFile
>>        $c += " --format=sarifv2.1.0"
>> +     $c += " --threads=0"
>>        $c += " --output="
>>        $c += $sarif
>>        $c += " --search-path="
> 
> Using the & operator to call MSBuild and CodeQL may be cleaner here,
> though it can be done later.
> 
>      I had issues with the & operator calling msbuild and codeql - issues around quoting quoted strings,
>      escaping strings and using different quotes did not help.
>      Creating a bat file to run the build from the codeql command line was the only method I could get working.
> 

Got it, I can try working on it later.

Reviewed-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

> 
>> @@ -199,8 +202,22 @@ if ($Type -eq "codeql") {
>>        }
>>        New-Item -ItemType Directory "database"
>>
>> +     $queryfile = "windows_driver_recommended.qls"
>> +     Try {
>> +             $ver = New-Object System.Version((& "codeql" "--version")[0].Split(" ")[-1] + "0")
>> +             Write-Host -ForegroundColor Cyan "INFO: CodeQL version " $ver
>> +             $minver = New-Object System.Version("2.20.1.0")
>> +             if ($ver -ge $minver) {
>> +                     $queryfile = "mustfix.qls"
> 
> You can just use
> "microsoft/windows-drivers:windows-driver-suites/mustfix.qls" to target
> a specific pack, or a versioned form like
> "microsoft/windows-drivers@1.8.0:windows-driver-suites/mustfix.qls".
> 
> Also, why is mustfix.qls being used with the new pack instead of
> recommended.qls? I did notice new false positives in the newer 1.8.0
> pack, was this the cause of the change?
> 
>      recommended.qls generates several false positives, and apparent incorrect analysis, which would
>      prevent these codeql logs from being valid for WHQL submissions.
>      The CODEQL_QUERY_FILE environment variable can be set to override the QLS file selection, to
>      test recommended.qls while resolving issues
> 
>> +             }
>> +     } Catch {
>> +     }
> 
> 
> Owen



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 13 14:08:03 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 13 Nov 2025 14:08:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1161655.1489551 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJXzW-0007Lq-7o; Thu, 13 Nov 2025 14:08:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1161655.1489551; Thu, 13 Nov 2025 14:08:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJXzW-0007Lj-5O; Thu, 13 Nov 2025 14:08:02 +0000
Received: by outflank-mailman (input) for mailman id 1161655;
 Thu, 13 Nov 2025 14:08:00 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CK2P=5V=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vJXzU-0007Ld-Rp
 for win-pv-devel@lists.xenproject.org; Thu, 13 Nov 2025 14:08:00 +0000
Received: from na1pdmzitismtp02.tibco.com (unknown [160.101.131.9])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 278bb718-c09a-11f0-980a-7dc792cee155;
 Thu, 13 Nov 2025 15:07:58 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id B0D4980CF3A0;
 Thu, 13 Nov 2025 09:06:34 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 278bb718-c09a-11f0-980a-7dc792cee155
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [PATCH] Add ConfigFreeActive / ConfigFreeSzValue
Date: Thu, 13 Nov 2025 14:07:54 +0000
Message-ID: <20251113140754.1061-1-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <SA1PR03MB709864C6068A0FB62593D7E1FECDA@SA1PR03MB7098.namprd03.prod.outlook.com>
References: <SA1PR03MB709864C6068A0FB62593D7E1FECDA@SA1PR03MB7098.namprd03.prod.outlook.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Values returned by ConfigGetActive should be freed by ConfigFreeActive,
and values returned by ConfigQuerySystemStartOption should be freed by
ConfigFreeSzValue, so that pool tag tracking is correct.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 include/xen.h       | 12 ++++++++++++
 src/xen/config.c    | 25 ++++++++++++++++++++++---
 src/xenbus/fdo.c    |  6 +++---
 src/xenbus/unplug.c |  2 +-
 4 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/include/xen.h b/include/xen.h
index 7016c86..8691a0f 100644
--- a/include/xen.h
+++ b/include/xen.h
@@ -573,6 +573,12 @@ ConfigClearActive(
     VOID
     );
 
+XEN_API
+VOID
+ConfigFreeActive(
+    _In_ PSTR   Value
+    );
+
 XEN_API
 NTSTATUS
 ConfigRequestReboot(
@@ -587,4 +593,10 @@ ConfigQuerySystemStartOption(
     _Outptr_ PANSI_STRING   *Option
     );
 
+XEN_API
+VOID
+ConfigFreeSzValue(
+    _In_ PANSI_STRING       Array
+    );
+
 #endif  // _XEN_H
diff --git a/src/xen/config.c b/src/xen/config.c
index 99980a6..2bc05df 100644
--- a/src/xen/config.c
+++ b/src/xen/config.c
@@ -46,6 +46,7 @@
 #include "util.h"
 
 #define MAXNAMELEN  128
+#define CONFIG_TAG  'GFCX'
 
 //
 // The canonical location for active device information is the XENFILT
@@ -88,7 +89,7 @@ ConfigGetActive(
         goto fail2;
 
     Length = Ansi[0].Length + sizeof (CHAR);
-    *Value = __AllocatePoolWithTag(PagedPool, Length, 'SUB');
+    *Value = __AllocatePoolWithTag(PagedPool, Length, CONFIG_TAG);
 
     status = STATUS_NO_MEMORY;
     if (*Value == NULL)
@@ -305,7 +306,7 @@ ConfigUpdateActive(
 
     status = ConfigGetActive("InstanceID", &ActiveInstanceID);
     if (NT_SUCCESS(status)) {
-        ExFreePool(ActiveInstanceID);
+        ConfigFreeActive(ActiveInstanceID);
     } else {
         RtlInitAnsiString(&Ansi[0], InstanceID);
 
@@ -319,7 +320,7 @@ ConfigUpdateActive(
 
     status = ConfigGetActive("LocationInformation", &ActiveLocationInformation);
     if (NT_SUCCESS(status)) {
-        ExFreePool(ActiveLocationInformation);
+        ConfigFreeActive(ActiveLocationInformation);
     } else {
         RtlInitAnsiString(&Ansi[0], LocationInformation);
 
@@ -408,6 +409,15 @@ fail1:
     return status;
 }
 
+XEN_API
+VOID
+ConfigFreeActive(
+    _In_ PSTR   Value
+    )
+{
+    __FreePoolWithTag(Value, CONFIG_TAG);
+}
+
 XEN_API
 NTSTATUS
 ConfigRequestReboot(
@@ -496,3 +506,12 @@ ConfigQuerySystemStartOption(
 {
     return RegistryQuerySystemStartOption(Key, Option);
 }
+
+XEN_API
+VOID
+ConfigFreeSzValue(
+    _In_ PANSI_STRING       Array
+    )
+{
+    RegistryFreeSzValue(Array);
+}
diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
index e3de8b9..d093db8 100644
--- a/src/xenbus/fdo.c
+++ b/src/xenbus/fdo.c
@@ -806,7 +806,7 @@ fallback:
         if (Fdo->Active)
             (VOID) ConfigUpdateActive(DeviceID, InstanceID, LocationInformation);
 
-        ExFreePool(ActiveDeviceID);
+        ConfigFreeActive(ActiveDeviceID);
     } else {
         status = ConfigSetActive(DeviceID, InstanceID, LocationInformation);
         if (NT_SUCCESS(status))
@@ -5746,7 +5746,7 @@ FdoBalloonInitialize(
     else if (strcmp(Value, "ON") != 0)
         Warning("UNRECOGNIZED VALUE OF %s: %s\n", Key, Value);
 
-    RegistryFreeSzValue(Option);
+    ConfigFreeSzValue(Option);
 
 done:
     return Enabled ?
@@ -5782,7 +5782,7 @@ FdoSetWatchdog(
 
     Value = strtoul(Option->Buffer + sizeof (Key) - 1, NULL, 0);
 
-    RegistryFreeSzValue(Option);
+    ConfigFreeSzValue(Option);
 
     if (Value && Value < 10) {
         Warning("%us TOO SHORT (ROUNDING UP TO 10s)\n");
diff --git a/src/xenbus/unplug.c b/src/xenbus/unplug.c
index ca58c31..6bf8fb3 100644
--- a/src/xenbus/unplug.c
+++ b/src/xenbus/unplug.c
@@ -175,7 +175,7 @@ UnplugBootEmulated(
     else if (strcmp(Value, "FALSE") != 0)
         Warning("UNRECOGNIZED VALUE OF %s: %s\n", KeyName, Value);
 
-    RegistryFreeSzValue(Option);
+    ConfigFreeSzValue(Option);
 
 done:
     ReleaseMutex(&Context->Mutex);
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Thu Nov 13 14:15:24 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Thu, 13 Nov 2025 14:15:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1161677.1489565 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJY6d-0001FU-TG; Thu, 13 Nov 2025 14:15:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1161677.1489565; Thu, 13 Nov 2025 14:15:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vJY6d-0001FN-Qn; Thu, 13 Nov 2025 14:15:23 +0000
Received: by outflank-mailman (input) for mailman id 1161677;
 Thu, 13 Nov 2025 14:15:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CheH=5V=bounce.vates.tech=bounce-md_30504962.6915e7f6.v1-63a9307b5f6c40ec86562d4ec0179d9c@srs-se1.protection.inumbo.net>)
 id 1vJY6c-0001FH-4Q
 for win-pv-devel@lists.xenproject.org; Thu, 13 Nov 2025 14:15:22 +0000
Received: from mail128-17.atl41.mandrillapp.com
 (mail128-17.atl41.mandrillapp.com [198.2.128.17])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2f7d4bdc-c09b-11f0-9d18-b5c5bf9af7f9;
 Thu, 13 Nov 2025 15:15:20 +0100 (CET)
Received: from pmta08.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail128-17.atl41.mandrillapp.com (Mailchimp) with ESMTP id
 4d6j3B3vHWzCf9P1Y
 for <win-pv-devel@lists.xenproject.org>; Thu, 13 Nov 2025 14:15:18 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 63a9307b5f6c40ec86562d4ec0179d9c; Thu, 13 Nov 2025 14:15:18 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2f7d4bdc-c09b-11f0-9d18-b5c5bf9af7f9
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1763043318; x=1763313318;
	bh=EayEi4Z3igGQnH8WOQVH4nCGVSZxgHlTc7GQUm3D5Jg=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=i+qZjJLgpnc0SgMKAydgLu4Hb/cl80pVVV8MjloRbmOiVpG3vmHlN0Al7ISoD/DV6
	 QoVEO8C/ZGE0kiD+8NrNd/7f0/An49EO/CIhRlgYeJ/mknUAbotC0cQvOEyKBt+cS7
	 ZeRgLyaHgJtiosEFrWnAAkw1Lul6mxzYaO2F1/aItQRqygetzG6UOng5VJ2x/yVdxF
	 h0uc+4xVDQ3d/J3tnLYwx9i9XSc0GQbMTZCGu0DUOtTD7FWMAEHV8eDMv9zrl/VTXX
	 gTe5Yq6onIZjp2uqvLmEw5X6xpHaXhcER+UCxyvOP9wy8DuG9PXGeajwoW+wF0lJIc
	 iuD4sFUhKEHbw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1763043318; x=1763303818; i=ngoc-tu.dinh@vates.tech;
	bh=EayEi4Z3igGQnH8WOQVH4nCGVSZxgHlTc7GQUm3D5Jg=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=ht4RxDyhNoR81FY0S/QTJEe4pOuuy4wN0RfU/qZ1/pqC1v8m5DlpbiJp0HlnBqzzf
	 vdmHbVG7LnP+YqgZ76YsMmkBnIsR/3PtlpzvQZJoorlBstu2rmcdjxjymRkfza7GpS
	 MpMc+V6L225rRPftjL55fMIIZkgWZY1/rAvdXeAl6yVIKRCWyJVSYGuIEb3NsRVCfo
	 njYpFoaKmN8J/JcOWCt4X429oUynWaVgDIuaKYku3OSnOBJyxXsrl9JmTA1+usJz3O
	 41h8ptNbvAXrslQh+M25kQlJFOGu0viwvuLFkPBJx/ENwCFweYAg6SYKSvA6vAJ66x
	 qd+UKlj9n2s3w==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH]=20Add=20ConfigFreeActive=20/=20ConfigFreeSzValue?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1763043317690
Message-Id: <2f306a7b-821f-4df9-a2a0-902016324768@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <SA1PR03MB709864C6068A0FB62593D7E1FECDA@SA1PR03MB7098.namprd03.prod.outlook.com> <20251113140754.1061-1-owen.smith@citrix.com>
In-Reply-To: <20251113140754.1061-1-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.63a9307b5f6c40ec86562d4ec0179d9c?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251113:md
Date: Thu, 13 Nov 2025 14:15:18 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 13/11/2025 15:08, Owen Smith wrote:
> Values returned by ConfigGetActive should be freed by ConfigFreeActive,
> and values returned by ConfigQuerySystemStartOption should be freed by
> ConfigFreeSzValue, so that pool tag tracking is correct.
> 
> Signed-off-by: Owen Smith <owen.smith@citrix.com>

Reviewed-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

> ---
>   include/xen.h       | 12 ++++++++++++
>   src/xen/config.c    | 25 ++++++++++++++++++++++---
>   src/xenbus/fdo.c    |  6 +++---
>   src/xenbus/unplug.c |  2 +-
>   4 files changed, 38 insertions(+), 7 deletions(-)
> 
> diff --git a/include/xen.h b/include/xen.h
> index 7016c86..8691a0f 100644
> --- a/include/xen.h
> +++ b/include/xen.h
> @@ -573,6 +573,12 @@ ConfigClearActive(
>       VOID
>       );
>   
> +XEN_API
> +VOID
> +ConfigFreeActive(
> +    _In_ PSTR   Value
> +    );
> +
>   XEN_API
>   NTSTATUS
>   ConfigRequestReboot(
> @@ -587,4 +593,10 @@ ConfigQuerySystemStartOption(
>       _Outptr_ PANSI_STRING   *Option
>       );
>   
> +XEN_API
> +VOID
> +ConfigFreeSzValue(
> +    _In_ PANSI_STRING       Array
> +    );
> +
>   #endif  // _XEN_H
> diff --git a/src/xen/config.c b/src/xen/config.c
> index 99980a6..2bc05df 100644
> --- a/src/xen/config.c
> +++ b/src/xen/config.c
> @@ -46,6 +46,7 @@
>   #include "util.h"
>   
>   #define MAXNAMELEN  128
> +#define CONFIG_TAG  'GFCX'
>   
>   //
>   // The canonical location for active device information is the XENFILT
> @@ -88,7 +89,7 @@ ConfigGetActive(
>           goto fail2;
>   
>       Length = Ansi[0].Length + sizeof (CHAR);
> -    *Value = __AllocatePoolWithTag(PagedPool, Length, 'SUB');
> +    *Value = __AllocatePoolWithTag(PagedPool, Length, CONFIG_TAG);
>   
>       status = STATUS_NO_MEMORY;
>       if (*Value == NULL)
> @@ -305,7 +306,7 @@ ConfigUpdateActive(
>   
>       status = ConfigGetActive("InstanceID", &ActiveInstanceID);
>       if (NT_SUCCESS(status)) {
> -        ExFreePool(ActiveInstanceID);
> +        ConfigFreeActive(ActiveInstanceID);
>       } else {
>           RtlInitAnsiString(&Ansi[0], InstanceID);
>   
> @@ -319,7 +320,7 @@ ConfigUpdateActive(
>   
>       status = ConfigGetActive("LocationInformation", &ActiveLocationInformation);
>       if (NT_SUCCESS(status)) {
> -        ExFreePool(ActiveLocationInformation);
> +        ConfigFreeActive(ActiveLocationInformation);
>       } else {
>           RtlInitAnsiString(&Ansi[0], LocationInformation);
>   
> @@ -408,6 +409,15 @@ fail1:
>       return status;
>   }
>   
> +XEN_API
> +VOID
> +ConfigFreeActive(
> +    _In_ PSTR   Value
> +    )
> +{
> +    __FreePoolWithTag(Value, CONFIG_TAG);
> +}
> +
>   XEN_API
>   NTSTATUS
>   ConfigRequestReboot(
> @@ -496,3 +506,12 @@ ConfigQuerySystemStartOption(
>   {
>       return RegistryQuerySystemStartOption(Key, Option);
>   }
> +
> +XEN_API
> +VOID
> +ConfigFreeSzValue(
> +    _In_ PANSI_STRING       Array
> +    )
> +{
> +    RegistryFreeSzValue(Array);
> +}
> diff --git a/src/xenbus/fdo.c b/src/xenbus/fdo.c
> index e3de8b9..d093db8 100644
> --- a/src/xenbus/fdo.c
> +++ b/src/xenbus/fdo.c
> @@ -806,7 +806,7 @@ fallback:
>           if (Fdo->Active)
>               (VOID) ConfigUpdateActive(DeviceID, InstanceID, LocationInformation);
>   
> -        ExFreePool(ActiveDeviceID);
> +        ConfigFreeActive(ActiveDeviceID);
>       } else {
>           status = ConfigSetActive(DeviceID, InstanceID, LocationInformation);
>           if (NT_SUCCESS(status))
> @@ -5746,7 +5746,7 @@ FdoBalloonInitialize(
>       else if (strcmp(Value, "ON") != 0)
>           Warning("UNRECOGNIZED VALUE OF %s: %s\n", Key, Value);
>   
> -    RegistryFreeSzValue(Option);
> +    ConfigFreeSzValue(Option);
>   
>   done:
>       return Enabled ?
> @@ -5782,7 +5782,7 @@ FdoSetWatchdog(
>   
>       Value = strtoul(Option->Buffer + sizeof (Key) - 1, NULL, 0);
>   
> -    RegistryFreeSzValue(Option);
> +    ConfigFreeSzValue(Option);
>   
>       if (Value && Value < 10) {
>           Warning("%us TOO SHORT (ROUNDING UP TO 10s)\n");
> diff --git a/src/xenbus/unplug.c b/src/xenbus/unplug.c
> index ca58c31..6bf8fb3 100644
> --- a/src/xenbus/unplug.c
> +++ b/src/xenbus/unplug.c
> @@ -175,7 +175,7 @@ UnplugBootEmulated(
>       else if (strcmp(Value, "FALSE") != 0)
>           Warning("UNRECOGNIZED VALUE OF %s: %s\n", KeyName, Value);
>   
> -    RegistryFreeSzValue(Option);
> +    ConfigFreeSzValue(Option);
>   
>   done:
>       ReleaseMutex(&Context->Mutex);



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:12:53 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:12:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163315.1490502 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuM0-0004IV-0Y; Mon, 17 Nov 2025 08:12:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163315.1490502; Mon, 17 Nov 2025 08:12:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuLz-0004IJ-S6; Mon, 17 Nov 2025 08:12:51 +0000
Received: by outflank-mailman (input) for mailman id 1163315;
 Mon, 17 Nov 2025 08:12:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuLz-0004Hu-Ep
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:12:51 +0000
Received: from na1pdmzitismtp02.tibco.com (na1pdmzitismtp02.tibco.com
 [160.101.131.9]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3383e726-c38d-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 09:12:48 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 4524480C6A66;
 Mon, 17 Nov 2025 03:11:24 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3383e726-c38d-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>,
	david ambu <david.preetham@cloud.com>
Subject: [xencons PATCH 3/3] Enable KASAN build support
Date: Mon, 17 Nov 2025 08:12:41 +0000
Message-ID: <20251117081241.1832-3-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251117081241.1832-1-owen.smith@citrix.com>
References: <20251117081241.1832-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

KASAN (Kernel Address Sanitizer)
(see https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/kasan)
builds can be enabled when using the WDK 10.0.26100.2161 or later, and can be
used on specially prepared Windows 11 24H2 / Server 2025, or later, OSs.

KASAN enabled drivers should not generally deployed, as the OS needs to be
enabled, but these drivers can help track down illegal memory accesses and
similar issues.

Signed-off-by: david ambu <david.preetham@cloud.com>
---
 build.ps1   |  6 ++++--
 msbuild.ps1 | 11 ++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/build.ps1 b/build.ps1
index 42bbdde..1ec30ee 100644
--- a/build.ps1
+++ b/build.ps1
@@ -9,7 +9,8 @@ param(
 	[string]$SignMode = "TestSign",
 	[switch]$CodeQL,
 	[switch]$Sdv,
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -32,7 +33,8 @@ Function Build {
 		Arch = $Arch;
 		Type = $Type;
 		SignMode = $SignMode;
-		CodeAnalysis = $CodeAnalysis
+		CodeAnalysis = $CodeAnalysis;
+		Kasan = $Kasan
 		}
 	& ".\msbuild.ps1" @params
 	if ($LASTEXITCODE -ne 0) {
diff --git a/msbuild.ps1 b/msbuild.ps1
index c8f65f4..3a21553 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -9,7 +9,8 @@ param(
 	[Parameter(Mandatory = $true)]
 	[string]$Type,
 	[string]$SignMode = "TestSign",
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -30,7 +31,8 @@ Function Run-MSBuild {
 		[string]$Platform,
 		[string]$Target = "Build",
 		[string]$Inputs = "",
-		[switch]$CodeAnalysis
+		[switch]$CodeAnalysis,
+		[switch]$Kasan
 	)
 
 	$c = "msbuild.exe"
@@ -46,6 +48,9 @@ Function Run-MSBuild {
 		$c += "/p:RunCodeAnalysis=true "
 		$c += "/p:EnablePREFast=true "
 	}
+	if ($Kasan) {
+		$c += "/p:EnableKASAN=true "
+	}
 
 	$c += Join-Path -Path $SolutionPath -ChildPath $Name
 
@@ -186,7 +191,7 @@ if (-Not (Test-Path -Path $archivepath)) {
 }
 
 if (($Type -eq "free") -or ($Type -eq "checked")) {
-	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis -Kasan:$Kasan
 }
 
 if ($Type -eq "codeql") {
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:12:53 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:12:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163314.1490497 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuLz-0004IC-Te; Mon, 17 Nov 2025 08:12:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163314.1490497; Mon, 17 Nov 2025 08:12:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuLz-0004I5-R1; Mon, 17 Nov 2025 08:12:51 +0000
Received: by outflank-mailman (input) for mailman id 1163314;
 Mon, 17 Nov 2025 08:12:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuLy-0004Hu-NM
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:12:50 +0000
Received: from na1pdmzitismtp02.tibco.com (na1pdmzitismtp02.tibco.com
 [160.101.131.9]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 33174ef4-c38d-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 09:12:48 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id A155B80C6B89;
 Mon, 17 Nov 2025 03:11:23 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 33174ef4-c38d-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [xencons PATCH 2/3] Add support for CodeQL 2.20.1
Date: Mon, 17 Nov 2025 08:12:40 +0000
Message-ID: <20251117081241.1832-2-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251117081241.1832-1-owen.smith@citrix.com>
References: <20251117081241.1832-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

CodeQL 2.20.1 uses a different query file to previous versions, and relies
on using different query packs, which need to be present on the system.

Adds CODEQL_QUERY_FILE environment variable to force a specific query file, if set.

Also adds "--threads=0" parameter, to use alll available CPUs.

https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/static-tools-and-codeql

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 msbuild.ps1 | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index f258781..c8f65f4 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -109,7 +109,8 @@ Function Run-CodeQL {
 		[string]$Name,
 		[string]$Configuration,
 		[string]$Platform,
-		[string]$SearchPath
+		[string]$SearchPath,
+		[string]$QueryFile
 	)
 
 	$projpath = Resolve-Path (Join-Path $SolutionPath $Name)
@@ -153,8 +154,10 @@ Function Run-CodeQL {
 	$c += " database"
 	$c += " analyze "
 	$c += $database
-	$c += " windows_driver_recommended.qls"
+	$c += " "
+	$c += $QueryFile
 	$c += " --format=sarifv2.1.0"
+	$c += " --threads=0"
 	$c += " --output="
 	$c += $sarif
 	$c += " --search-path="
@@ -198,8 +201,22 @@ if ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database" | Out-Null
 
+	$queryfile = "windows_driver_recommended.qls"
+	Try {
+		$ver = New-Object System.Version((& "codeql" "--version")[0].Split(" ")[-1] + "0")
+		Write-Host -ForegroundColor Cyan "INFO: CodeQL version " $ver
+		$minver = New-Object System.Version("2.20.1.0")
+		if ($ver -ge $minver) {
+			$queryfile = "mustfix.qls"
+		}
+	} Catch {
+	}
+	if (-not [string]::IsNullOrEmpty($Env:CODEQL_QUERY_FILE)) {
+		$queryfile = $Env:CODEQL_QUERY_FILE
+		Write-Host -ForegroundColor Cyan "INFO: Overwriting codeql query file to " $queryfile
+	}
 	ForEach ($project in $ProjectList) {
-		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath $queryfile
 	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:12:55 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:12:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163316.1490505 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuM2-0004L6-Vu; Mon, 17 Nov 2025 08:12:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163316.1490505; Mon, 17 Nov 2025 08:12:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuM2-0004Kz-TK; Mon, 17 Nov 2025 08:12:54 +0000
Received: by outflank-mailman (input) for mailman id 1163316;
 Mon, 17 Nov 2025 08:12:54 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuM2-0004KP-59
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:12:54 +0000
Received: from na1pdmzitismtp02.tibco.com (unknown [160.101.131.9])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 32d470fc-c38d-11f0-980a-7dc792cee155;
 Mon, 17 Nov 2025 09:12:48 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 09E0080C6B82;
 Mon, 17 Nov 2025 03:11:22 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 32d470fc-c38d-11f0-980a-7dc792cee155
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [xencons PATCH 1/3] Refactor msbuild.ps1
Date: Mon, 17 Nov 2025 08:12:39 +0000
Message-ID: <20251117081241.1832-1-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Moves all repo specific data to a 'Globals' section, and simplifies the
structure so that it can be common across all drivers.

Also seperates DVL log generation from SDV build, so that DVL logs
can be created for CodeQL builds without SDV.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 43 insertions(+), 20 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index 6f55a5f..f258781 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -12,6 +12,16 @@ param(
 	[switch]$CodeAnalysis
 )
 
+#
+# Globals
+#
+$SolutionName = "xencons.sln"
+$ArchivePath = "xencons"
+$ProjectList = @( "xencons" )
+
+#
+# Functions
+#
 Function Run-MSBuild {
 	param(
 		[string]$SolutionPath,
@@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
 	Run-MSBuild $projpath $project $Configuration $Platform "Build"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
+
+	Set-Location $basepath
+}
+
+Function Run-MSBuildDVL {
+	param(
+		[string]$SolutionPath,
+		[string]$Name,
+		[string]$Configuration,
+		[string]$Platform
+	)
+
+	$basepath = Get-Location
+	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
+	Set-Location $projpath
+
+	$project = [string]::Format("{0}.vcxproj", $Name)
 	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
 	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
 
@@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase Release"; "checked" = "$Configu
 $platform = @{ "x86" = "Win32"; "x64" = "x64" }
 $solutionpath = Resolve-Path $SolutionDir
 
-$archivepath = "xencons"
-$projectlist = @( "xencons" )
-
 Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
 
-if ($Type -eq "free") {
-	Run-MSBuild $solutionpath "xencons.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+if (-Not (Test-Path -Path $archivepath)) {
+	New-Item -Name $archivepath -ItemType Directory | Out-Null
 }
-elseif ($Type -eq "checked") {
-	Run-MSBuild $solutionpath "xencons.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+
+if (($Type -eq "free") -or ($Type -eq "checked")) {
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
 }
-elseif ($Type -eq "codeql") {
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
-	}
 
+if ($Type -eq "codeql") {
 	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
 		$searchpath = Resolve-Path ".."
 	} else {
@@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database" | Out-Null
 
-	$projectlist | ForEach {
-		Run-CodeQL $solutionpath $_ $configuration["codeql"] $platform[$Arch] $searchpath
+	ForEach ($project in $ProjectList) {
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
 	}
-
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
-elseif ($Type -eq "sdv") {
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
-	}
 
-	$projectlist | ForEach {
-		Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] $platform[$Arch]
+if ($Type -eq "sdv") {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
 	}
+}
 
+if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
+	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:16:45 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:16:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163335.1490509 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuPl-0004Xn-8D; Mon, 17 Nov 2025 08:16:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163335.1490509; Mon, 17 Nov 2025 08:16:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuPl-0004Xf-5b; Mon, 17 Nov 2025 08:16:45 +0000
Received: by outflank-mailman (input) for mailman id 1163335;
 Mon, 17 Nov 2025 08:16:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuPk-0004X7-Gf
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:16:44 +0000
Received: from na1pdmzitismtp01.tibco.com (na1pdmzitismtp01.tibco.com
 [160.101.131.8]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c0109298-c38d-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 09:16:43 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 7152740EE28F;
 Mon, 17 Nov 2025 03:15:23 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c0109298-c38d-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [xenhid PATCH 1/3] Refactor msbuild.ps1
Date: Mon, 17 Nov 2025 08:16:38 +0000
Message-ID: <20251117081640.555-1-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Moves all repo specific data to a 'Globals' section, and simplifies the
structure so that it can be common across all drivers.

Also seperates DVL log generation from SDV build, so that DVL logs
can be created for CodeQL builds without SDV.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 43 insertions(+), 20 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index 15c5fc1..c889426 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -12,6 +12,16 @@ param(
 	[switch]$CodeAnalysis
 )
 
+#
+# Globals
+#
+$SolutionName = "xenhid.sln"
+$ArchivePath = "xenhid"
+$ProjectList = @( "xenhid" )
+
+#
+# Functions
+#
 Function Run-MSBuild {
 	param(
 		[string]$SolutionPath,
@@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
 	Run-MSBuild $projpath $project $Configuration $Platform "Build"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
+
+	Set-Location $basepath
+}
+
+Function Run-MSBuildDVL {
+	param(
+		[string]$SolutionPath,
+		[string]$Name,
+		[string]$Configuration,
+		[string]$Platform
+	)
+
+	$basepath = Get-Location
+	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
+	Set-Location $projpath
+
+	$project = [string]::Format("{0}.vcxproj", $Name)
 	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
 	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
 
@@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase Release"; "checked" = "$Configu
 $platform = @{ "x86" = "Win32"; "x64" = "x64" }
 $solutionpath = Resolve-Path $SolutionDir
 
-$archivepath = "xenhid"
-$projectlist = @( "xenhid" )
-
 Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
 
-if ($Type -eq "free") {
-	Run-MSBuild $solutionpath "xenhid.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+if (-Not (Test-Path -Path $archivepath)) {
+	New-Item -Name $archivepath -ItemType Directory | Out-Null
 }
-elseif ($Type -eq "checked") {
-	Run-MSBuild $solutionpath "xenhid.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+
+if (($Type -eq "free") -or ($Type -eq "checked")) {
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
 }
-elseif ($Type -eq "codeql") {
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
-	}
 
+if ($Type -eq "codeql") {
 	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
 		$searchpath = Resolve-Path ".."
 	} else {
@@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database" | Out-Null
 
-	$projectlist | ForEach {
-		Run-CodeQL $solutionpath $_ $configuration["codeql"] $platform[$Arch] $searchpath
+	ForEach ($project in $ProjectList) {
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
 	}
-
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
-elseif ($Type -eq "sdv") {
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
-	}
 
-	$projectlist | ForEach {
-		Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] $platform[$Arch]
+if ($Type -eq "sdv") {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
 	}
+}
 
+if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
+	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:16:46 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:16:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163336.1490514 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuPm-0004ZN-9c; Mon, 17 Nov 2025 08:16:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163336.1490514; Mon, 17 Nov 2025 08:16:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuPm-0004ZC-6k; Mon, 17 Nov 2025 08:16:46 +0000
Received: by outflank-mailman (input) for mailman id 1163336;
 Mon, 17 Nov 2025 08:16:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuPl-0004X7-5q
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:16:45 +0000
Received: from na1pdmzitismtp01.tibco.com (na1pdmzitismtp01.tibco.com
 [160.101.131.8]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c069622b-c38d-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 09:16:44 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 0BCAB40EE298;
 Mon, 17 Nov 2025 03:15:23 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c069622b-c38d-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [xenhid PATCH 2/3] Add support for CodeQL 2.20.1
Date: Mon, 17 Nov 2025 08:16:39 +0000
Message-ID: <20251117081640.555-2-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251117081640.555-1-owen.smith@citrix.com>
References: <20251117081640.555-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

CodeQL 2.20.1 uses a different query file to previous versions, and relies
on using different query packs, which need to be present on the system.

Adds CODEQL_QUERY_FILE environment variable to force a specific query file, if set.

Also adds "--threads=0" parameter, to use alll available CPUs.

https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/static-tools-and-codeql

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 msbuild.ps1 | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index c889426..d813586 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -109,7 +109,8 @@ Function Run-CodeQL {
 		[string]$Name,
 		[string]$Configuration,
 		[string]$Platform,
-		[string]$SearchPath
+		[string]$SearchPath,
+		[string]$QueryFile
 	)
 
 	$projpath = Resolve-Path (Join-Path $SolutionPath $Name)
@@ -153,8 +154,10 @@ Function Run-CodeQL {
 	$c += " database"
 	$c += " analyze "
 	$c += $database
-	$c += " windows_driver_recommended.qls"
+	$c += " "
+	$c += $QueryFile
 	$c += " --format=sarifv2.1.0"
+	$c += " --threads=0"
 	$c += " --output="
 	$c += $sarif
 	$c += " --search-path="
@@ -198,8 +201,22 @@ if ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database" | Out-Null
 
+	$queryfile = "windows_driver_recommended.qls"
+	Try {
+		$ver = New-Object System.Version((& "codeql" "--version")[0].Split(" ")[-1] + "0")
+		Write-Host -ForegroundColor Cyan "INFO: CodeQL version " $ver
+		$minver = New-Object System.Version("2.20.1.0")
+		if ($ver -ge $minver) {
+			$queryfile = "mustfix.qls"
+		}
+	} Catch {
+	}
+	if (-not [string]::IsNullOrEmpty($Env:CODEQL_QUERY_FILE)) {
+		$queryfile = $Env:CODEQL_QUERY_FILE
+		Write-Host -ForegroundColor Cyan "INFO: Overwriting codeql query file to " $queryfile
+	}
 	ForEach ($project in $ProjectList) {
-		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath $queryfile
 	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:16:47 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:16:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163337.1490518 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuPn-0004ay-AM; Mon, 17 Nov 2025 08:16:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163337.1490518; Mon, 17 Nov 2025 08:16:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuPn-0004ar-7p; Mon, 17 Nov 2025 08:16:47 +0000
Received: by outflank-mailman (input) for mailman id 1163337;
 Mon, 17 Nov 2025 08:16:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuPm-0004X7-68
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:16:46 +0000
Received: from na1pdmzitismtp01.tibco.com (na1pdmzitismtp01.tibco.com
 [160.101.131.8]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c0cfb1ce-c38d-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 09:16:44 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 99EF740EE29C;
 Mon, 17 Nov 2025 03:15:24 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c0cfb1ce-c38d-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>,
	david ambu <david.preetham@cloud.com>
Subject: [xenhid PATCH 3/3] Enable KASAN build support
Date: Mon, 17 Nov 2025 08:16:40 +0000
Message-ID: <20251117081640.555-3-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251117081640.555-1-owen.smith@citrix.com>
References: <20251117081640.555-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

KASAN (Kernel Address Sanitizer)
(see https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/kasan)
builds can be enabled when using the WDK 10.0.26100.2161 or later, and can be
used on specially prepared Windows 11 24H2 / Server 2025, or later, OSs.

KASAN enabled drivers should not generally deployed, as the OS needs to be
enabled, but these drivers can help track down illegal memory accesses and
similar issues.

Signed-off-by: david ambu <david.preetham@cloud.com>
---
 build.ps1   |  6 ++++--
 msbuild.ps1 | 11 ++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/build.ps1 b/build.ps1
index 42bbdde..1ec30ee 100644
--- a/build.ps1
+++ b/build.ps1
@@ -9,7 +9,8 @@ param(
 	[string]$SignMode = "TestSign",
 	[switch]$CodeQL,
 	[switch]$Sdv,
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -32,7 +33,8 @@ Function Build {
 		Arch = $Arch;
 		Type = $Type;
 		SignMode = $SignMode;
-		CodeAnalysis = $CodeAnalysis
+		CodeAnalysis = $CodeAnalysis;
+		Kasan = $Kasan
 		}
 	& ".\msbuild.ps1" @params
 	if ($LASTEXITCODE -ne 0) {
diff --git a/msbuild.ps1 b/msbuild.ps1
index d813586..331546f 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -9,7 +9,8 @@ param(
 	[Parameter(Mandatory = $true)]
 	[string]$Type,
 	[string]$SignMode = "TestSign",
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -30,7 +31,8 @@ Function Run-MSBuild {
 		[string]$Platform,
 		[string]$Target = "Build",
 		[string]$Inputs = "",
-		[switch]$CodeAnalysis
+		[switch]$CodeAnalysis,
+		[switch]$Kasan
 	)
 
 	$c = "msbuild.exe"
@@ -46,6 +48,9 @@ Function Run-MSBuild {
 		$c += "/p:RunCodeAnalysis=true "
 		$c += "/p:EnablePREFast=true "
 	}
+	if ($Kasan) {
+		$c += "/p:EnableKASAN=true "
+	}
 
 	$c += Join-Path -Path $SolutionPath -ChildPath $Name
 
@@ -186,7 +191,7 @@ if (-Not (Test-Path -Path $archivepath)) {
 }
 
 if (($Type -eq "free") -or ($Type -eq "checked")) {
-	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis -Kasan:$Kasan
 }
 
 if ($Type -eq "codeql") {
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:20:33 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:20:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163359.1490521 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuTQ-0005j2-Jw; Mon, 17 Nov 2025 08:20:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163359.1490521; Mon, 17 Nov 2025 08:20:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuTQ-0005iv-H9; Mon, 17 Nov 2025 08:20:32 +0000
Received: by outflank-mailman (input) for mailman id 1163359;
 Mon, 17 Nov 2025 08:20:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuTP-0005ik-9j
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:20:31 +0000
Received: from na1pdmzitismtp02.tibco.com (unknown [160.101.131.9])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4738f232-c38e-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 09:20:30 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id EE0DF80C6B8F;
 Mon, 17 Nov 2025 03:19:06 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4738f232-c38e-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [xeniface PATCH 1/3] Refactor msbuild.ps1
Date: Mon, 17 Nov 2025 08:20:24 +0000
Message-ID: <20251117082026.1179-1-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Moves all repo specific data to a 'Globals' section, and simplifies the
structure so that it can be common across all drivers.

Also seperates DVL log generation from SDV build, so that DVL logs
can be created for CodeQL builds without SDV.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 43 insertions(+), 20 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index 794cb6f..04dceba 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -12,6 +12,16 @@ param(
 	[switch]$CodeAnalysis
 )
 
+#
+# Globals
+#
+$SolutionName = "xeniface.sln"
+$ArchivePath = "xeniface"
+$ProjectList = @( "xeniface" )
+
+#
+# Functions
+#
 Function Run-MSBuild {
 	param(
 		[string]$SolutionPath,
@@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
 	Run-MSBuild $projpath $project $Configuration $Platform "Build"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
+
+	Set-Location $basepath
+}
+
+Function Run-MSBuildDVL {
+	param(
+		[string]$SolutionPath,
+		[string]$Name,
+		[string]$Configuration,
+		[string]$Platform
+	)
+
+	$basepath = Get-Location
+	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
+	Set-Location $projpath
+
+	$project = [string]::Format("{0}.vcxproj", $Name)
 	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
 	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
 
@@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase Release"; "checked" = "$Configu
 $platform = @{ "x86" = "Win32"; "x64" = "x64" }
 $solutionpath = Resolve-Path $SolutionDir
 
-$archivepath = "xeniface"
-$projectlist = @( "xeniface" )
-
 Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
 
-if ($Type -eq "free") {
-	Run-MSBuild $solutionpath "xeniface.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+if (-Not (Test-Path -Path $archivepath)) {
+	New-Item -Name $archivepath -ItemType Directory | Out-Null
 }
-elseif ($Type -eq "checked") {
-	Run-MSBuild $solutionpath "xeniface.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+
+if (($Type -eq "free") -or ($Type -eq "checked")) {
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
 }
-elseif ($Type -eq "codeql") {
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
-	}
 
+if ($Type -eq "codeql") {
 	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
 		$searchpath = Resolve-Path ".."
 	} else {
@@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database" | Out-Null
 
-	$projectlist | ForEach {
-		Run-CodeQL $solutionpath $_ $configuration["codeql"] $platform[$Arch] $searchpath
+	ForEach ($project in $ProjectList) {
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
 	}
-
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
-elseif ($Type -eq "sdv") {
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
-	}
 
-	$projectlist | ForEach {
-		Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] $platform[$Arch]
+if ($Type -eq "sdv") {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
 	}
+}
 
+if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
+	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:20:33 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:20:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163360.1490528 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuTQ-0005jN-Np; Mon, 17 Nov 2025 08:20:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163360.1490528; Mon, 17 Nov 2025 08:20:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuTQ-0005j6-ID; Mon, 17 Nov 2025 08:20:32 +0000
Received: by outflank-mailman (input) for mailman id 1163360;
 Mon, 17 Nov 2025 08:20:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuTP-0005ik-UT
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:20:31 +0000
Received: from na1pdmzitismtp02.tibco.com (unknown [160.101.131.9])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 47921fac-c38e-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 09:20:31 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 850A980C67E2;
 Mon, 17 Nov 2025 03:19:07 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 47921fac-c38e-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [xeniface PATCH 2/3] Add support for CodeQL 2.20.1
Date: Mon, 17 Nov 2025 08:20:25 +0000
Message-ID: <20251117082026.1179-2-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251117082026.1179-1-owen.smith@citrix.com>
References: <20251117082026.1179-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

CodeQL 2.20.1 uses a different query file to previous versions, and relies
on using different query packs, which need to be present on the system.

Adds CODEQL_QUERY_FILE environment variable to force a specific query file, if set.

Also adds "--threads=0" parameter, to use alll available CPUs.

https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/static-tools-and-codeql

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 msbuild.ps1 | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index 04dceba..864bb41 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -109,7 +109,8 @@ Function Run-CodeQL {
 		[string]$Name,
 		[string]$Configuration,
 		[string]$Platform,
-		[string]$SearchPath
+		[string]$SearchPath,
+		[string]$QueryFile
 	)
 
 	$projpath = Resolve-Path (Join-Path $SolutionPath $Name)
@@ -153,8 +154,10 @@ Function Run-CodeQL {
 	$c += " database"
 	$c += " analyze "
 	$c += $database
-	$c += " windows_driver_recommended.qls"
+	$c += " "
+	$c += $QueryFile
 	$c += " --format=sarifv2.1.0"
+	$c += " --threads=0"
 	$c += " --output="
 	$c += $sarif
 	$c += " --search-path="
@@ -198,9 +201,24 @@ if ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database" | Out-Null
 
+	$queryfile = "windows_driver_recommended.qls"
+	Try {
+		$ver = New-Object System.Version((& "codeql" "--version")[0].Split(" ")[-1] + "0")
+		Write-Host -ForegroundColor Cyan "INFO: CodeQL version " $ver
+		$minver = New-Object System.Version("2.20.1.0")
+		if ($ver -ge $minver) {
+			$queryfile = "mustfix.qls"
+		}
+	} Catch {
+	}
+	if (-not [string]::IsNullOrEmpty($Env:CODEQL_QUERY_FILE)) {
+		$queryfile = $Env:CODEQL_QUERY_FILE
+		Write-Host -ForegroundColor Cyan "INFO: Overwriting codeql query file to " $queryfile
+	}
 	ForEach ($project in $ProjectList) {
-		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath $queryfile
 	}
+
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
 
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:20:34 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:20:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163361.1490530 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuTS-0005mG-Mf; Mon, 17 Nov 2025 08:20:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163361.1490530; Mon, 17 Nov 2025 08:20:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuTS-0005m9-Jw; Mon, 17 Nov 2025 08:20:34 +0000
Received: by outflank-mailman (input) for mailman id 1163361;
 Mon, 17 Nov 2025 08:20:33 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuTR-0005lL-KI
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:20:33 +0000
Received: from na1pdmzitismtp02.tibco.com (unknown [160.101.131.9])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 480542ac-c38e-11f0-980a-7dc792cee155;
 Mon, 17 Nov 2025 09:20:31 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 1CED680C6B90;
 Mon, 17 Nov 2025 03:19:08 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 480542ac-c38e-11f0-980a-7dc792cee155
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>,
	david ambu <david.preetham@cloud.com>
Subject: [xeniface PATCH 3/3] Enable KASAN build support
Date: Mon, 17 Nov 2025 08:20:26 +0000
Message-ID: <20251117082026.1179-3-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251117082026.1179-1-owen.smith@citrix.com>
References: <20251117082026.1179-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

KASAN (Kernel Address Sanitizer)
(see https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/kasan)
builds can be enabled when using the WDK 10.0.26100.2161 or later, and can be
used on specially prepared Windows 11 24H2 / Server 2025, or later, OSs.

KASAN enabled drivers should not generally deployed, as the OS needs to be
enabled, but these drivers can help track down illegal memory accesses and
similar issues.

Signed-off-by: david ambu <david.preetham@cloud.com>
---
 build.ps1   |  6 ++++--
 msbuild.ps1 | 11 ++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/build.ps1 b/build.ps1
index bacda67..bf9bb69 100644
--- a/build.ps1
+++ b/build.ps1
@@ -9,7 +9,8 @@ param(
 	[string]$SignMode = "TestSign",
 	[switch]$CodeQL,
 	[switch]$Sdv,
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -32,7 +33,8 @@ Function Build {
 		Arch = $Arch;
 		Type = $Type;
 		SignMode = $SignMode;
-		CodeAnalysis = $CodeAnalysis
+		CodeAnalysis = $CodeAnalysis;
+		Kasan = $Kasan
 		}
 	& ".\msbuild.ps1" @params
 	if ($LASTEXITCODE -ne 0) {
diff --git a/msbuild.ps1 b/msbuild.ps1
index 864bb41..fd3f3c8 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -9,7 +9,8 @@ param(
 	[Parameter(Mandatory = $true)]
 	[string]$Type,
 	[string]$SignMode = "TestSign",
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -30,7 +31,8 @@ Function Run-MSBuild {
 		[string]$Platform,
 		[string]$Target = "Build",
 		[string]$Inputs = "",
-		[switch]$CodeAnalysis
+		[switch]$CodeAnalysis,
+		[switch]$Kasan
 	)
 
 	$c = "msbuild.exe"
@@ -46,6 +48,9 @@ Function Run-MSBuild {
 		$c += "/p:RunCodeAnalysis=true "
 		$c += "/p:EnablePREFast=true "
 	}
+	if ($Kasan) {
+		$c += "/p:EnableKASAN=true "
+	}
 
 	$c += Join-Path -Path $SolutionPath -ChildPath $Name
 
@@ -186,7 +191,7 @@ if (-Not (Test-Path -Path $archivepath)) {
 }
 
 if (($Type -eq "free") -or ($Type -eq "checked")) {
-	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis -Kasan:$Kasan
 }
 
 if ($Type -eq "codeql") {
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:23:39 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:23:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163386.1490533 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuWQ-0005wc-UA; Mon, 17 Nov 2025 08:23:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163386.1490533; Mon, 17 Nov 2025 08:23:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuWQ-0005wV-Rk; Mon, 17 Nov 2025 08:23:38 +0000
Received: by outflank-mailman (input) for mailman id 1163386;
 Mon, 17 Nov 2025 08:23:37 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuWP-0005wK-Pk
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:23:37 +0000
Received: from na1pdmzitismtp01.tibco.com (na1pdmzitismtp01.corp.cloud.com
 [160.101.131.8]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b58913d2-c38e-11f0-980a-7dc792cee155;
 Mon, 17 Nov 2025 09:23:35 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 3097840EE2A3;
 Mon, 17 Nov 2025 03:22:15 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b58913d2-c38e-11f0-980a-7dc792cee155
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [xennet PATCH 1/3] Refactor msbuild.ps1
Date: Mon, 17 Nov 2025 08:23:29 +0000
Message-ID: <20251117082332.1088-1-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Moves all repo specific data to a 'Globals' section, and simplifies the
structure so that it can be common across all drivers.

Also seperates DVL log generation from SDV build, so that DVL logs
can be created for CodeQL builds without SDV.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 43 insertions(+), 20 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index 9df9495..59bb98a 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -12,6 +12,16 @@ param(
 	[switch]$CodeAnalysis
 )
 
+#
+# Globals
+#
+$SolutionName = "xennet.sln"
+$ArchivePath = "xennet"
+$ProjectList = @( "xennet" )
+
+#
+# Functions
+#
 Function Run-MSBuild {
 	param(
 		[string]$SolutionPath,
@@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
 	Run-MSBuild $projpath $project $Configuration $Platform "Build"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
+
+	Set-Location $basepath
+}
+
+Function Run-MSBuildDVL {
+	param(
+		[string]$SolutionPath,
+		[string]$Name,
+		[string]$Configuration,
+		[string]$Platform
+	)
+
+	$basepath = Get-Location
+	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
+	Set-Location $projpath
+
+	$project = [string]::Format("{0}.vcxproj", $Name)
 	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
 	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
 
@@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase Release"; "checked" = "$Configu
 $platform = @{ "x86" = "Win32"; "x64" = "x64" }
 $solutionpath = Resolve-Path $SolutionDir
 
-$archivepath = "xennet"
-$projectlist = @( "xennet" )
-
 Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
 
-if ($Type -eq "free") {
-	Run-MSBuild $solutionpath "xennet.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+if (-Not (Test-Path -Path $archivepath)) {
+	New-Item -Name $archivepath -ItemType Directory | Out-Null
 }
-elseif ($Type -eq "checked") {
-	Run-MSBuild $solutionpath "xennet.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+
+if (($Type -eq "free") -or ($Type -eq "checked")) {
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
 }
-elseif ($Type -eq "codeql") {
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
-	}
 
+if ($Type -eq "codeql") {
 	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
 		$searchpath = Resolve-Path ".."
 	} else {
@@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database" | Out-Null
 
-	$projectlist | ForEach {
-		Run-CodeQL $solutionpath $_ $configuration["codeql"] $platform[$Arch] $searchpath
+	ForEach ($project in $ProjectList) {
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
 	}
-
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
-elseif ($Type -eq "sdv") {
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
-	}
 
-	$projectlist | ForEach {
-		Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] $platform[$Arch]
+if ($Type -eq "sdv") {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
 	}
+}
 
+if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
+	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:23:40 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:23:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163387.1490538 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuWR-0005y5-Vf; Mon, 17 Nov 2025 08:23:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163387.1490538; Mon, 17 Nov 2025 08:23:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuWR-0005xy-Sv; Mon, 17 Nov 2025 08:23:39 +0000
Received: by outflank-mailman (input) for mailman id 1163387;
 Mon, 17 Nov 2025 08:23:38 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuWQ-0005wK-El
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:23:38 +0000
Received: from na1pdmzitismtp01.tibco.com (na1pdmzitismtp01.corp.cloud.com
 [160.101.131.8]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b5e14019-c38e-11f0-980a-7dc792cee155;
 Mon, 17 Nov 2025 09:23:36 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id BECD340EE2B1;
 Mon, 17 Nov 2025 03:22:15 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b5e14019-c38e-11f0-980a-7dc792cee155
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [xennet PATCH 2/3] Add support for CodeQL 2.20.1
Date: Mon, 17 Nov 2025 08:23:30 +0000
Message-ID: <20251117082332.1088-2-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251117082332.1088-1-owen.smith@citrix.com>
References: <20251117082332.1088-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

CodeQL 2.20.1 uses a different query file to previous versions, and relies
on using different query packs, which need to be present on the system.

Adds CODEQL_QUERY_FILE environment variable to force a specific query file, if set.

Also adds "--threads=0" parameter, to use alll available CPUs.

https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/static-tools-and-codeql

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 msbuild.ps1 | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index 59bb98a..d410acd 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -109,7 +109,8 @@ Function Run-CodeQL {
 		[string]$Name,
 		[string]$Configuration,
 		[string]$Platform,
-		[string]$SearchPath
+		[string]$SearchPath,
+		[string]$QueryFile
 	)
 
 	$projpath = Resolve-Path (Join-Path $SolutionPath $Name)
@@ -153,8 +154,10 @@ Function Run-CodeQL {
 	$c += " database"
 	$c += " analyze "
 	$c += $database
-	$c += " windows_driver_recommended.qls"
+	$c += " "
+	$c += $QueryFile
 	$c += " --format=sarifv2.1.0"
+	$c += " --threads=0"
 	$c += " --output="
 	$c += $sarif
 	$c += " --search-path="
@@ -198,8 +201,22 @@ if ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database" | Out-Null
 
+	$queryfile = "windows_driver_recommended.qls"
+	Try {
+		$ver = New-Object System.Version((& "codeql" "--version")[0].Split(" ")[-1] + "0")
+		Write-Host -ForegroundColor Cyan "INFO: CodeQL version " $ver
+		$minver = New-Object System.Version("2.20.1.0")
+		if ($ver -ge $minver) {
+			$queryfile = "mustfix.qls"
+		}
+	} Catch {
+	}
+	if (-not [string]::IsNullOrEmpty($Env:CODEQL_QUERY_FILE)) {
+		$queryfile = $Env:CODEQL_QUERY_FILE
+		Write-Host -ForegroundColor Cyan "INFO: Overwriting codeql query file to " $queryfile
+	}
 	ForEach ($project in $ProjectList) {
-		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath $queryfile
 	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:23:41 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:23:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163388.1490541 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuWT-0005zl-08; Mon, 17 Nov 2025 08:23:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163388.1490541; Mon, 17 Nov 2025 08:23:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuWS-0005ze-Tz; Mon, 17 Nov 2025 08:23:40 +0000
Received: by outflank-mailman (input) for mailman id 1163388;
 Mon, 17 Nov 2025 08:23:39 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuWR-0005wK-Ev
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:23:39 +0000
Received: from na1pdmzitismtp01.tibco.com (na1pdmzitismtp01.corp.cloud.com
 [160.101.131.8]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b64519d3-c38e-11f0-980a-7dc792cee155;
 Mon, 17 Nov 2025 09:23:36 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 5979440EE2B2;
 Mon, 17 Nov 2025 03:22:16 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b64519d3-c38e-11f0-980a-7dc792cee155
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>,
	david ambu <david.preetham@cloud.com>
Subject: [xennet PATCH 3/3] Enable KASAN build support
Date: Mon, 17 Nov 2025 08:23:31 +0000
Message-ID: <20251117082332.1088-3-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251117082332.1088-1-owen.smith@citrix.com>
References: <20251117082332.1088-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

KASAN (Kernel Address Sanitizer)
(see https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/kasan)
builds can be enabled when using the WDK 10.0.26100.2161 or later, and can be
used on specially prepared Windows 11 24H2 / Server 2025, or later, OSs.

KASAN enabled drivers should not generally deployed, as the OS needs to be
enabled, but these drivers can help track down illegal memory accesses and
similar issues.

Signed-off-by: david ambu <david.preetham@cloud.com>
---
 build.ps1   |  6 ++++--
 msbuild.ps1 | 11 ++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/build.ps1 b/build.ps1
index 42bbdde..1ec30ee 100644
--- a/build.ps1
+++ b/build.ps1
@@ -9,7 +9,8 @@ param(
 	[string]$SignMode = "TestSign",
 	[switch]$CodeQL,
 	[switch]$Sdv,
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -32,7 +33,8 @@ Function Build {
 		Arch = $Arch;
 		Type = $Type;
 		SignMode = $SignMode;
-		CodeAnalysis = $CodeAnalysis
+		CodeAnalysis = $CodeAnalysis;
+		Kasan = $Kasan
 		}
 	& ".\msbuild.ps1" @params
 	if ($LASTEXITCODE -ne 0) {
diff --git a/msbuild.ps1 b/msbuild.ps1
index d410acd..01f6303 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -9,7 +9,8 @@ param(
 	[Parameter(Mandatory = $true)]
 	[string]$Type,
 	[string]$SignMode = "TestSign",
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -30,7 +31,8 @@ Function Run-MSBuild {
 		[string]$Platform,
 		[string]$Target = "Build",
 		[string]$Inputs = "",
-		[switch]$CodeAnalysis
+		[switch]$CodeAnalysis,
+		[switch]$Kasan
 	)
 
 	$c = "msbuild.exe"
@@ -46,6 +48,9 @@ Function Run-MSBuild {
 		$c += "/p:RunCodeAnalysis=true "
 		$c += "/p:EnablePREFast=true "
 	}
+	if ($Kasan) {
+		$c += "/p:EnableKASAN=true "
+	}
 
 	$c += Join-Path -Path $SolutionPath -ChildPath $Name
 
@@ -186,7 +191,7 @@ if (-Not (Test-Path -Path $archivepath)) {
 }
 
 if (($Type -eq "free") -or ($Type -eq "checked")) {
-	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis -Kasan:$Kasan
 }
 
 if ($Type -eq "codeql") {
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:30:04 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:30:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163411.1490551 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKucd-0006aq-JH; Mon, 17 Nov 2025 08:30:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163411.1490551; Mon, 17 Nov 2025 08:30:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKucd-0006aU-DR; Mon, 17 Nov 2025 08:30:03 +0000
Received: by outflank-mailman (input) for mailman id 1163411;
 Mon, 17 Nov 2025 08:30:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKucc-0006El-Cm
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:30:02 +0000
Received: from na1pdmzitismtp02.tibco.com (na1pdmzitismtp02.tibco.com
 [160.101.131.9]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9b85f24e-c38f-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 09:30:01 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id CAB2680C6BAE;
 Mon, 17 Nov 2025 03:28:37 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9b85f24e-c38f-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [xenvbd PATCH 2/3] Add support for CodeQL 2.20.1
Date: Mon, 17 Nov 2025 08:29:55 +0000
Message-ID: <20251117082957.494-2-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251117082957.494-1-owen.smith@citrix.com>
References: <20251117082957.494-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

CodeQL 2.20.1 uses a different query file to previous versions, and relies
on using different query packs, which need to be present on the system.

Adds CODEQL_QUERY_FILE environment variable to force a specific query file, if set.

Also adds "--threads=0" parameter, to use alll available CPUs.

https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/static-tools-and-codeql

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 msbuild.ps1 | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index 3226610..de7df27 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -109,7 +109,8 @@ Function Run-CodeQL {
 		[string]$Name,
 		[string]$Configuration,
 		[string]$Platform,
-		[string]$SearchPath
+		[string]$SearchPath,
+		[string]$QueryFile
 	)
 
 	$projpath = Resolve-Path (Join-Path $SolutionPath $Name)
@@ -153,8 +154,10 @@ Function Run-CodeQL {
 	$c += " database"
 	$c += " analyze "
 	$c += $database
-	$c += " windows_driver_recommended.qls"
+	$c += " "
+	$c += $QueryFile
 	$c += " --format=sarifv2.1.0"
+	$c += " --threads=0"
 	$c += " --output="
 	$c += $sarif
 	$c += " --search-path="
@@ -198,8 +201,22 @@ if ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database" | Out-Null
 
+	$queryfile = "windows_driver_recommended.qls"
+	Try {
+		$ver = New-Object System.Version((& "codeql" "--version")[0].Split(" ")[-1] + "0")
+		Write-Host -ForegroundColor Cyan "INFO: CodeQL version " $ver
+		$minver = New-Object System.Version("2.20.1.0")
+		if ($ver -ge $minver) {
+			$queryfile = "mustfix.qls"
+		}
+	} Catch {
+	}
+	if (-not [string]::IsNullOrEmpty($Env:CODEQL_QUERY_FILE)) {
+		$queryfile = $Env:CODEQL_QUERY_FILE
+		Write-Host -ForegroundColor Cyan "INFO: Overwriting codeql query file to " $queryfile
+	}
 	ForEach ($project in $ProjectList) {
-		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath $queryfile
 	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:30:05 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:30:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163412.1490553 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKucf-00070L-IW; Mon, 17 Nov 2025 08:30:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163412.1490553; Mon, 17 Nov 2025 08:30:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKucf-0006zu-Fo; Mon, 17 Nov 2025 08:30:05 +0000
Received: by outflank-mailman (input) for mailman id 1163412;
 Mon, 17 Nov 2025 08:30:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKucd-0006eE-WF
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:30:04 +0000
Received: from na1pdmzitismtp02.tibco.com (unknown [160.101.131.9])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9bf08f41-c38f-11f0-980a-7dc792cee155;
 Mon, 17 Nov 2025 09:30:01 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 65EE380C6B9A;
 Mon, 17 Nov 2025 03:28:38 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9bf08f41-c38f-11f0-980a-7dc792cee155
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>,
	david ambu <david.preetham@cloud.com>
Subject: [xenvbd PATCH 3/3] Enable KASAN build support
Date: Mon, 17 Nov 2025 08:29:56 +0000
Message-ID: <20251117082957.494-3-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251117082957.494-1-owen.smith@citrix.com>
References: <20251117082957.494-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

KASAN (Kernel Address Sanitizer)
(see https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/kasan)
builds can be enabled when using the WDK 10.0.26100.2161 or later, and can be
used on specially prepared Windows 11 24H2 / Server 2025, or later, OSs.

KASAN enabled drivers should not generally deployed, as the OS needs to be
enabled, but these drivers can help track down illegal memory accesses and
similar issues.

Signed-off-by: david ambu <david.preetham@cloud.com>
---
 build.ps1   |  6 ++++--
 msbuild.ps1 | 11 ++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/build.ps1 b/build.ps1
index 42bbdde..1ec30ee 100644
--- a/build.ps1
+++ b/build.ps1
@@ -9,7 +9,8 @@ param(
 	[string]$SignMode = "TestSign",
 	[switch]$CodeQL,
 	[switch]$Sdv,
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -32,7 +33,8 @@ Function Build {
 		Arch = $Arch;
 		Type = $Type;
 		SignMode = $SignMode;
-		CodeAnalysis = $CodeAnalysis
+		CodeAnalysis = $CodeAnalysis;
+		Kasan = $Kasan
 		}
 	& ".\msbuild.ps1" @params
 	if ($LASTEXITCODE -ne 0) {
diff --git a/msbuild.ps1 b/msbuild.ps1
index de7df27..f904873 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -9,7 +9,8 @@ param(
 	[Parameter(Mandatory = $true)]
 	[string]$Type,
 	[string]$SignMode = "TestSign",
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -30,7 +31,8 @@ Function Run-MSBuild {
 		[string]$Platform,
 		[string]$Target = "Build",
 		[string]$Inputs = "",
-		[switch]$CodeAnalysis
+		[switch]$CodeAnalysis,
+		[switch]$Kasan
 	)
 
 	$c = "msbuild.exe"
@@ -46,6 +48,9 @@ Function Run-MSBuild {
 		$c += "/p:RunCodeAnalysis=true "
 		$c += "/p:EnablePREFast=true "
 	}
+	if ($Kasan) {
+		$c += "/p:EnableKASAN=true "
+	}
 
 	$c += Join-Path -Path $SolutionPath -ChildPath $Name
 
@@ -186,7 +191,7 @@ if (-Not (Test-Path -Path $archivepath)) {
 }
 
 if (($Type -eq "free") -or ($Type -eq "checked")) {
-	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis -Kasan:$Kasan
 }
 
 if ($Type -eq "codeql") {
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:30:04 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:30:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163410.1490546 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKucd-0006aO-Fu; Mon, 17 Nov 2025 08:30:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163410.1490546; Mon, 17 Nov 2025 08:30:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKucd-0006a3-CI; Mon, 17 Nov 2025 08:30:03 +0000
Received: by outflank-mailman (input) for mailman id 1163410;
 Mon, 17 Nov 2025 08:30:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKucb-0006El-Ov
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:30:01 +0000
Received: from na1pdmzitismtp02.tibco.com (na1pdmzitismtp02.tibco.com
 [160.101.131.9]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9b26852b-c38f-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 09:30:00 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 3CF4380C6BA4;
 Mon, 17 Nov 2025 03:28:37 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9b26852b-c38f-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [xenvbd PATCH 1/3] Refactor msbuild.ps1
Date: Mon, 17 Nov 2025 08:29:54 +0000
Message-ID: <20251117082957.494-1-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Moves all repo specific data to a 'Globals' section, and simplifies the
structure so that it can be common across all drivers.

Also seperates DVL log generation from SDV build, so that DVL logs
can be created for CodeQL builds without SDV.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 43 insertions(+), 20 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index 8028f25..3226610 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -12,6 +12,16 @@ param(
 	[switch]$CodeAnalysis
 )
 
+#
+# Globals
+#
+$SolutionName = "xenvbd.sln"
+$ArchivePath = "xenvbd"
+$ProjectList = @( "xencrsh", "xendisk", "xenvbd" )
+
+#
+# Functions
+#
 Function Run-MSBuild {
 	param(
 		[string]$SolutionPath,
@@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
 	Run-MSBuild $projpath $project $Configuration $Platform "Build"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
+
+	Set-Location $basepath
+}
+
+Function Run-MSBuildDVL {
+	param(
+		[string]$SolutionPath,
+		[string]$Name,
+		[string]$Configuration,
+		[string]$Platform
+	)
+
+	$basepath = Get-Location
+	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
+	Set-Location $projpath
+
+	$project = [string]::Format("{0}.vcxproj", $Name)
 	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
 	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
 
@@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase Release"; "checked" = "$Configu
 $platform = @{ "x86" = "Win32"; "x64" = "x64" }
 $solutionpath = Resolve-Path $SolutionDir
 
-$archivepath = "xenvbd"
-$projectlist = @( "xencrsh", "xendisk", "xenvbd" )
-
 Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
 
-if ($Type -eq "free") {
-	Run-MSBuild $solutionpath "xenvbd.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+if (-Not (Test-Path -Path $archivepath)) {
+	New-Item -Name $archivepath -ItemType Directory | Out-Null
 }
-elseif ($Type -eq "checked") {
-	Run-MSBuild $solutionpath "xenvbd.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+
+if (($Type -eq "free") -or ($Type -eq "checked")) {
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
 }
-elseif ($Type -eq "codeql") {
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
-	}
 
+if ($Type -eq "codeql") {
 	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
 		$searchpath = Resolve-Path ".."
 	} else {
@@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database" | Out-Null
 
-	$projectlist | ForEach {
-		Run-CodeQL $solutionpath $_ $configuration["codeql"] $platform[$Arch] $searchpath
+	ForEach ($project in $ProjectList) {
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
 	}
-
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
-elseif ($Type -eq "sdv") {
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
-	}
 
-	$projectlist | ForEach {
-		Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] $platform[$Arch]
+if ($Type -eq "sdv") {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
 	}
+}
 
+if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
+	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:36:36 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:36:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163448.1490571 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuiy-00083t-Dy; Mon, 17 Nov 2025 08:36:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163448.1490571; Mon, 17 Nov 2025 08:36:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuiy-00083l-BE; Mon, 17 Nov 2025 08:36:36 +0000
Received: by outflank-mailman (input) for mailman id 1163448;
 Mon, 17 Nov 2025 08:36:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuiw-0007kS-VA
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:36:34 +0000
Received: from na1pdmzitismtp01.tibco.com (na1pdmzitismtp01.tibco.com
 [160.101.131.8]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 85e28eb9-c390-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 09:36:34 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id 576D940EE14D;
 Mon, 17 Nov 2025 03:35:14 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 85e28eb9-c390-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [xenvif PATCH 2/3] Add support for CodeQL 2.20.1
Date: Mon, 17 Nov 2025 08:36:28 +0000
Message-ID: <20251117083629.1498-2-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251117083629.1498-1-owen.smith@citrix.com>
References: <20251117083629.1498-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

CodeQL 2.20.1 uses a different query file to previous versions, and relies
on using different query packs, which need to be present on the system.

Adds CODEQL_QUERY_FILE environment variable to force a specific query file, if set.

Also adds "--threads=0" parameter, to use alll available CPUs.

https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/static-tools-and-codeql

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 msbuild.ps1 | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index 4149225..21548a0 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -109,7 +109,8 @@ Function Run-CodeQL {
 		[string]$Name,
 		[string]$Configuration,
 		[string]$Platform,
-		[string]$SearchPath
+		[string]$SearchPath,
+		[string]$QueryFile
 	)
 
 	$projpath = Resolve-Path (Join-Path $SolutionPath $Name)
@@ -153,8 +154,10 @@ Function Run-CodeQL {
 	$c += " database"
 	$c += " analyze "
 	$c += $database
-	$c += " windows_driver_recommended.qls"
+	$c += " "
+	$c += $QueryFile
 	$c += " --format=sarifv2.1.0"
+	$c += " --threads=0"
 	$c += " --output="
 	$c += $sarif
 	$c += " --search-path="
@@ -198,8 +201,22 @@ if ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database" | Out-Null
 
+	$queryfile = "windows_driver_recommended.qls"
+	Try {
+		$ver = New-Object System.Version((& "codeql" "--version")[0].Split(" ")[-1] + "0")
+		Write-Host -ForegroundColor Cyan "INFO: CodeQL version " $ver
+		$minver = New-Object System.Version("2.20.1.0")
+		if ($ver -ge $minver) {
+			$queryfile = "mustfix.qls"
+		}
+	} Catch {
+	}
+	if (-not [string]::IsNullOrEmpty($Env:CODEQL_QUERY_FILE)) {
+		$queryfile = $Env:CODEQL_QUERY_FILE
+		Write-Host -ForegroundColor Cyan "INFO: Overwriting codeql query file to " $queryfile
+	}
 	ForEach ($project in $ProjectList) {
-		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath $queryfile
 	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:36:36 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:36:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163447.1490567 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuix-00082Y-CZ; Mon, 17 Nov 2025 08:36:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163447.1490567; Mon, 17 Nov 2025 08:36:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuix-00082R-A5; Mon, 17 Nov 2025 08:36:35 +0000
Received: by outflank-mailman (input) for mailman id 1163447;
 Mon, 17 Nov 2025 08:36:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuiv-0007kS-J3
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:36:33 +0000
Received: from na1pdmzitismtp01.tibco.com (na1pdmzitismtp01.tibco.com
 [160.101.131.8]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 85012593-c390-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 09:36:33 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id CC1A440EE14F;
 Mon, 17 Nov 2025 03:35:12 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 85012593-c390-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [xenvif PATCH 1/3] Refactor msbuild.ps1
Date: Mon, 17 Nov 2025 08:36:27 +0000
Message-ID: <20251117083629.1498-1-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Moves all repo specific data to a 'Globals' section, and simplifies the
structure so that it can be common across all drivers.

Also seperates DVL log generation from SDV build, so that DVL logs
can be created for CodeQL builds without SDV.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 43 insertions(+), 20 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index 46dc8cb..4149225 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -12,6 +12,16 @@ param(
 	[switch]$CodeAnalysis
 )
 
+#
+# Globals
+#
+$SolutionName = "xenvif.sln"
+$ArchivePath = "xenvif"
+$ProjectList = @( "xenvif" )
+
+#
+# Functions
+#
 Function Run-MSBuild {
 	param(
 		[string]$SolutionPath,
@@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
 	Run-MSBuild $projpath $project $Configuration $Platform "Build"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
+
+	Set-Location $basepath
+}
+
+Function Run-MSBuildDVL {
+	param(
+		[string]$SolutionPath,
+		[string]$Name,
+		[string]$Configuration,
+		[string]$Platform
+	)
+
+	$basepath = Get-Location
+	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
+	Set-Location $projpath
+
+	$project = [string]::Format("{0}.vcxproj", $Name)
 	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
 	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
 
@@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase Release"; "checked" = "$Configu
 $platform = @{ "x86" = "Win32"; "x64" = "x64" }
 $solutionpath = Resolve-Path $SolutionDir
 
-$archivepath = "xenvif"
-$projectlist = @( "xenvif" )
-
 Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
 
-if ($Type -eq "free") {
-	Run-MSBuild $solutionpath "xenvif.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+if (-Not (Test-Path -Path $archivepath)) {
+	New-Item -Name $archivepath -ItemType Directory | Out-Null
 }
-elseif ($Type -eq "checked") {
-	Run-MSBuild $solutionpath "xenvif.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+
+if (($Type -eq "free") -or ($Type -eq "checked")) {
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
 }
-elseif ($Type -eq "codeql") {
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
-	}
 
+if ($Type -eq "codeql") {
 	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
 		$searchpath = Resolve-Path ".."
 	} else {
@@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database" | Out-Null
 
-	$projectlist | ForEach {
-		Run-CodeQL $solutionpath $_ $configuration["codeql"] $platform[$Arch] $searchpath
+	ForEach ($project in $ProjectList) {
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
 	}
-
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
-elseif ($Type -eq "sdv") {
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
-	}
 
-	$projectlist | ForEach {
-		Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] $platform[$Arch]
+if ($Type -eq "sdv") {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
 	}
+}
 
+if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
+	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:36:37 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:36:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163449.1490576 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuiz-00085c-F2; Mon, 17 Nov 2025 08:36:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163449.1490576; Mon, 17 Nov 2025 08:36:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuiz-00085V-CJ; Mon, 17 Nov 2025 08:36:37 +0000
Received: by outflank-mailman (input) for mailman id 1163449;
 Mon, 17 Nov 2025 08:36:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuix-0007kS-Mk
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:36:35 +0000
Received: from na1pdmzitismtp01.tibco.com (na1pdmzitismtp01.tibco.com
 [160.101.131.8]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 864a082c-c390-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 09:36:35 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp01.tibco.com (Postfix) with ESMTP id E247740EE14F;
 Mon, 17 Nov 2025 03:35:14 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 864a082c-c390-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>,
	david ambu <david.preetham@cloud.com>
Subject: [xenvif PATCH 3/3] Enable KASAN build support
Date: Mon, 17 Nov 2025 08:36:29 +0000
Message-ID: <20251117083629.1498-3-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251117083629.1498-1-owen.smith@citrix.com>
References: <20251117083629.1498-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

KASAN (Kernel Address Sanitizer)
(see https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/kasan)
builds can be enabled when using the WDK 10.0.26100.2161 or later, and can be
used on specially prepared Windows 11 24H2 / Server 2025, or later, OSs.

KASAN enabled drivers should not generally deployed, as the OS needs to be
enabled, but these drivers can help track down illegal memory accesses and
similar issues.

Signed-off-by: david ambu <david.preetham@cloud.com>
---
 build.ps1   |  6 ++++--
 msbuild.ps1 | 11 ++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/build.ps1 b/build.ps1
index 42bbdde..1ec30ee 100644
--- a/build.ps1
+++ b/build.ps1
@@ -9,7 +9,8 @@ param(
 	[string]$SignMode = "TestSign",
 	[switch]$CodeQL,
 	[switch]$Sdv,
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -32,7 +33,8 @@ Function Build {
 		Arch = $Arch;
 		Type = $Type;
 		SignMode = $SignMode;
-		CodeAnalysis = $CodeAnalysis
+		CodeAnalysis = $CodeAnalysis;
+		Kasan = $Kasan
 		}
 	& ".\msbuild.ps1" @params
 	if ($LASTEXITCODE -ne 0) {
diff --git a/msbuild.ps1 b/msbuild.ps1
index 21548a0..707ec05 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -9,7 +9,8 @@ param(
 	[Parameter(Mandatory = $true)]
 	[string]$Type,
 	[string]$SignMode = "TestSign",
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -30,7 +31,8 @@ Function Run-MSBuild {
 		[string]$Platform,
 		[string]$Target = "Build",
 		[string]$Inputs = "",
-		[switch]$CodeAnalysis
+		[switch]$CodeAnalysis,
+		[switch]$Kasan
 	)
 
 	$c = "msbuild.exe"
@@ -46,6 +48,9 @@ Function Run-MSBuild {
 		$c += "/p:RunCodeAnalysis=true "
 		$c += "/p:EnablePREFast=true "
 	}
+	if ($Kasan) {
+		$c += "/p:EnableKASAN=true "
+	}
 
 	$c += Join-Path -Path $SolutionPath -ChildPath $Name
 
@@ -186,7 +191,7 @@ if (-Not (Test-Path -Path $archivepath)) {
 }
 
 if (($Type -eq "free") -or ($Type -eq "checked")) {
-	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis -Kasan:$Kasan
 }
 
 if ($Type -eq "codeql") {
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:49:23 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:49:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163485.1490590 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuvK-0001fw-Ii; Mon, 17 Nov 2025 08:49:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163485.1490590; Mon, 17 Nov 2025 08:49:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuvK-0001fp-FT; Mon, 17 Nov 2025 08:49:22 +0000
Received: by outflank-mailman (input) for mailman id 1163485;
 Mon, 17 Nov 2025 08:49:21 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuvJ-0001fT-9M
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:49:21 +0000
Received: from na1pdmzitismtp02.tibco.com (na1pdmzitismtp02.tibco.com
 [160.101.131.9]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4da843c7-c392-11f0-980a-7dc792cee155;
 Mon, 17 Nov 2025 09:49:19 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 9F92C80C6CBC;
 Mon, 17 Nov 2025 03:47:55 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4da843c7-c392-11f0-980a-7dc792cee155
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [xenvkbd PATCH 1/3] Refactor msbuild.ps1
Date: Mon, 17 Nov 2025 08:49:13 +0000
Message-ID: <20251117084915.869-1-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Moves all repo specific data to a 'Globals' section, and simplifies the
structure so that it can be common across all drivers.

Also seperates DVL log generation from SDV build, so that DVL logs
can be created for CodeQL builds without SDV.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 43 insertions(+), 20 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index 7228f42..24b61c1 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -12,6 +12,16 @@ param(
 	[switch]$CodeAnalysis
 )
 
+#
+# Globals
+#
+$SolutionName = "xenvkbd.sln"
+$ArchivePath = "xenvkbd"
+$ProjectList = @( "xenvkbd" )
+
+#
+# Functions
+#
 Function Run-MSBuild {
 	param(
 		[string]$SolutionPath,
@@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
 	Run-MSBuild $projpath $project $Configuration $Platform "Build"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
 	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
+
+	Set-Location $basepath
+}
+
+Function Run-MSBuildDVL {
+	param(
+		[string]$SolutionPath,
+		[string]$Name,
+		[string]$Configuration,
+		[string]$Platform
+	)
+
+	$basepath = Get-Location
+	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
+	Set-Location $projpath
+
+	$project = [string]::Format("{0}.vcxproj", $Name)
 	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
 	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
 
@@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase Release"; "checked" = "$Configu
 $platform = @{ "x86" = "Win32"; "x64" = "x64" }
 $solutionpath = Resolve-Path $SolutionDir
 
-$archivepath = "xenvkbd"
-$projectlist = @( "xenvkbd" )
-
 Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
 
-if ($Type -eq "free") {
-	Run-MSBuild $solutionpath "xenvkbd.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+if (-Not (Test-Path -Path $archivepath)) {
+	New-Item -Name $archivepath -ItemType Directory | Out-Null
 }
-elseif ($Type -eq "checked") {
-	Run-MSBuild $solutionpath "xenvkbd.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+
+if (($Type -eq "free") -or ($Type -eq "checked")) {
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
 }
-elseif ($Type -eq "codeql") {
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
-	}
 
+if ($Type -eq "codeql") {
 	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
 		$searchpath = Resolve-Path ".."
 	} else {
@@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database" | Out-Null
 
-	$projectlist | ForEach {
-		Run-CodeQL $solutionpath $_ $configuration["codeql"] $platform[$Arch] $searchpath
+	ForEach ($project in $ProjectList) {
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
 	}
-
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
-elseif ($Type -eq "sdv") {
-	if (-Not (Test-Path -Path $archivepath)) {
-		New-Item -Name $archivepath -ItemType Directory | Out-Null
-	}
 
-	$projectlist | ForEach {
-		Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] $platform[$Arch]
+if ($Type -eq "sdv") {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
 	}
+}
 
+if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
+	ForEach ($project in $ProjectList) {
+		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
+	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:49:23 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:49:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163486.1490593 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuvK-0001gE-M2; Mon, 17 Nov 2025 08:49:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163486.1490593; Mon, 17 Nov 2025 08:49:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuvK-0001g0-H3; Mon, 17 Nov 2025 08:49:22 +0000
Received: by outflank-mailman (input) for mailman id 1163486;
 Mon, 17 Nov 2025 08:49:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuvJ-0001fU-ET
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:49:21 +0000
Received: from na1pdmzitismtp02.tibco.com (unknown [160.101.131.9])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4e5d7cb8-c392-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 09:49:20 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id C17D880C67CF;
 Mon, 17 Nov 2025 03:47:56 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e5d7cb8-c392-11f0-9d18-b5c5bf9af7f9
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>,
	david ambu <david.preetham@cloud.com>
Subject: [xenvkbd PATCH 3/3] Enable KASAN build support
Date: Mon, 17 Nov 2025 08:49:15 +0000
Message-ID: <20251117084915.869-3-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251117084915.869-1-owen.smith@citrix.com>
References: <20251117084915.869-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

KASAN (Kernel Address Sanitizer)
(see https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/kasan)
builds can be enabled when using the WDK 10.0.26100.2161 or later, and can be
used on specially prepared Windows 11 24H2 / Server 2025, or later, OSs.

KASAN enabled drivers should not generally deployed, as the OS needs to be
enabled, but these drivers can help track down illegal memory accesses and
similar issues.

Signed-off-by: david ambu <david.preetham@cloud.com>
---
 build.ps1   |  6 ++++--
 msbuild.ps1 | 11 ++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/build.ps1 b/build.ps1
index 42bbdde..1ec30ee 100644
--- a/build.ps1
+++ b/build.ps1
@@ -9,7 +9,8 @@ param(
 	[string]$SignMode = "TestSign",
 	[switch]$CodeQL,
 	[switch]$Sdv,
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -32,7 +33,8 @@ Function Build {
 		Arch = $Arch;
 		Type = $Type;
 		SignMode = $SignMode;
-		CodeAnalysis = $CodeAnalysis
+		CodeAnalysis = $CodeAnalysis;
+		Kasan = $Kasan
 		}
 	& ".\msbuild.ps1" @params
 	if ($LASTEXITCODE -ne 0) {
diff --git a/msbuild.ps1 b/msbuild.ps1
index 89befd3..25616ba 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -9,7 +9,8 @@ param(
 	[Parameter(Mandatory = $true)]
 	[string]$Type,
 	[string]$SignMode = "TestSign",
-	[switch]$CodeAnalysis
+	[switch]$CodeAnalysis,
+	[switch]$Kasan
 )
 
 #
@@ -30,7 +31,8 @@ Function Run-MSBuild {
 		[string]$Platform,
 		[string]$Target = "Build",
 		[string]$Inputs = "",
-		[switch]$CodeAnalysis
+		[switch]$CodeAnalysis,
+		[switch]$Kasan
 	)
 
 	$c = "msbuild.exe"
@@ -46,6 +48,9 @@ Function Run-MSBuild {
 		$c += "/p:RunCodeAnalysis=true "
 		$c += "/p:EnablePREFast=true "
 	}
+	if ($Kasan) {
+		$c += "/p:EnableKASAN=true "
+	}
 
 	$c += Join-Path -Path $SolutionPath -ChildPath $Name
 
@@ -186,7 +191,7 @@ if (-Not (Test-Path -Path $archivepath)) {
 }
 
 if (($Type -eq "free") -or ($Type -eq "checked")) {
-	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
+	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis -Kasan:$Kasan
 }
 
 if ($Type -eq "codeql") {
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 08:49:23 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 08:49:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163487.1490594 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuvK-0001gx-MM; Mon, 17 Nov 2025 08:49:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163487.1490594; Mon, 17 Nov 2025 08:49:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKuvK-0001gD-IS; Mon, 17 Nov 2025 08:49:22 +0000
Received: by outflank-mailman (input) for mailman id 1163487;
 Mon, 17 Nov 2025 08:49:22 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sDzA=5Z=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vKuvJ-0001fT-Uy
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 08:49:21 +0000
Received: from na1pdmzitismtp02.tibco.com (na1pdmzitismtp02.tibco.com
 [160.101.131.9]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4dff6d4a-c392-11f0-980a-7dc792cee155;
 Mon, 17 Nov 2025 09:49:19 +0100 (CET)
Received: from mewpvdipd2033.citrite.net (unknown [10.113.48.64])
 by na1pdmzitismtp02.tibco.com (Postfix) with ESMTP id 3676A80C6CBD;
 Mon, 17 Nov 2025 03:47:56 -0500 (EST)
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4dff6d4a-c392-11f0-980a-7dc792cee155
From: Owen Smith <owen.smith@citrix.com>
To: win-pv-devel@lists.xenproject.org
Cc: Owen Smith <owen.smith@citrix.com>
Subject: [xenvkbd PATCH 2/3] Add support for CodeQL 2.20.1
Date: Mon, 17 Nov 2025 08:49:14 +0000
Message-ID: <20251117084915.869-2-owen.smith@citrix.com>
X-Mailer: git-send-email 2.51.2.windows.1
In-Reply-To: <20251117084915.869-1-owen.smith@citrix.com>
References: <20251117084915.869-1-owen.smith@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

CodeQL 2.20.1 uses a different query file to previous versions, and relies
on using different query packs, which need to be present on the system.

Adds CODEQL_QUERY_FILE environment variable to force a specific query file, if set.

Also adds "--threads=0" parameter, to use alll available CPUs.

https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/static-tools-and-codeql

Signed-off-by: Owen Smith <owen.smith@citrix.com>
---
 msbuild.ps1 | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/msbuild.ps1 b/msbuild.ps1
index 24b61c1..89befd3 100644
--- a/msbuild.ps1
+++ b/msbuild.ps1
@@ -109,7 +109,8 @@ Function Run-CodeQL {
 		[string]$Name,
 		[string]$Configuration,
 		[string]$Platform,
-		[string]$SearchPath
+		[string]$SearchPath,
+		[string]$QueryFile
 	)
 
 	$projpath = Resolve-Path (Join-Path $SolutionPath $Name)
@@ -153,8 +154,10 @@ Function Run-CodeQL {
 	$c += " database"
 	$c += " analyze "
 	$c += $database
-	$c += " windows_driver_recommended.qls"
+	$c += " "
+	$c += $QueryFile
 	$c += " --format=sarifv2.1.0"
+	$c += " --threads=0"
 	$c += " --output="
 	$c += $sarif
 	$c += " --search-path="
@@ -198,8 +201,22 @@ if ($Type -eq "codeql") {
 	}
 	New-Item -ItemType Directory "database" | Out-Null
 
+	$queryfile = "windows_driver_recommended.qls"
+	Try {
+		$ver = New-Object System.Version((& "codeql" "--version")[0].Split(" ")[-1] + "0")
+		Write-Host -ForegroundColor Cyan "INFO: CodeQL version " $ver
+		$minver = New-Object System.Version("2.20.1.0")
+		if ($ver -ge $minver) {
+			$queryfile = "mustfix.qls"
+		}
+	} Catch {
+	}
+	if (-not [string]::IsNullOrEmpty($Env:CODEQL_QUERY_FILE)) {
+		$queryfile = $Env:CODEQL_QUERY_FILE
+		Write-Host -ForegroundColor Cyan "INFO: Overwriting codeql query file to " $queryfile
+	}
 	ForEach ($project in $ProjectList) {
-		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
+		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath $queryfile
 	}
 	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
 }
-- 
2.51.2.windows.1



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 10:38:16 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 10:38:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163595.1490672 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKwcg-0002rA-Nk; Mon, 17 Nov 2025 10:38:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163595.1490672; Mon, 17 Nov 2025 10:38:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKwcg-0002r3-LK; Mon, 17 Nov 2025 10:38:14 +0000
Received: by outflank-mailman (input) for mailman id 1163595;
 Mon, 17 Nov 2025 10:38:14 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8jka=5Z=bounce.vates.tech=bounce-md_30504962.691afb0d.v1-77528cbcf0c942138bf24435b63a96e6@srs-se1.protection.inumbo.net>)
 id 1vKwcf-0002qx-Sf
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 10:38:14 +0000
Received: from mail180-15.suw31.mandrillapp.com
 (mail180-15.suw31.mandrillapp.com [198.2.180.15])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 80842940-c3a1-11f0-980a-7dc792cee155;
 Mon, 17 Nov 2025 11:38:06 +0100 (CET)
Received: from pmta11.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail180-15.suw31.mandrillapp.com (Mailchimp) with ESMTP id
 4d942j40KNzPm0tWd
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Nov 2025 10:38:05 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 77528cbcf0c942138bf24435b63a96e6; Mon, 17 Nov 2025 10:38:05 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 80842940-c3a1-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1763375885; x=1763645885;
	bh=TD09Ne3kQJ/XhurbOaSlRkHPV35k2DM4bsT0G/s+oGo=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=JOSsFr3eUcMpiFcIJCUN2T9rGjj5vSTyEZm6RzFCY2csJcfqjVqffW1uzy2A/m6en
	 E7Yo4sQSEasaTaPs4IhfndEmvoqnXThVwbc9oB1IildeAwlzF0wwYus+C1w9j9bWjY
	 O5UbGoBgwIL9TmAQo+o8NXXX2A5z6QOuzg+DjK8T5yfAyPeO99YaR2+N48IveUCNFe
	 Eff7jIFCGY1dgl4ZFZq9FduppwlM0sACGcJRngUrL+M5YhkwFsh/sSL8zRIYe3DUOm
	 0yZGOyvc54fZNwwvFIajOhbdA1PEjvu3uu8jTGKdEvXdQEYTu8VQ89WmoZonKnp3kq
	 MYw7aolUwIlzQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1763375885; x=1763636385; i=ngoc-tu.dinh@vates.tech;
	bh=TD09Ne3kQJ/XhurbOaSlRkHPV35k2DM4bsT0G/s+oGo=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=j4/gXzp+dnkhAZF7wAJ2wLCY30reCFT3zP1yaUFN+vPhsOLKnsT5VqHkQbSRTw2Ui
	 fjwiwnzFov+P+x4OG2hkUtLKCdodqDlKfAqRUQpjatfB4lnw2mhSccEHz7+ID58nB3
	 k8MWjXLcfFlMgA+UD/hXUVoOhwtTgdI624wwqNNH3TzGbrlMyXryWSdsQRW2miuVEC
	 jewtDpzBhyHRvKTHgXysDiyVBE71pQnVs5LEz5zZb3SZTFdFN0HIVzRRjqsSGaQiS+
	 hZgNjo33wX6hBbds8Ure6Tkcd4WuuY5jGv0jrsiOg1wTP8ntXpIeHgxIticHamC7Mw
	 st6H465aae8MQ==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[xencons=20PATCH=201/3]=20Refactor=20msbuild.ps1?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1763375884636
Message-Id: <2028d95b-b07f-4d28-a64d-e41b68c4876a@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251117081241.1832-1-owen.smith@citrix.com>
In-Reply-To: <20251117081241.1832-1-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.77528cbcf0c942138bf24435b63a96e6?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251117:md
Date: Mon, 17 Nov 2025 10:38:05 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 17/11/2025 09:13, Owen Smith wrote:
> Moves all repo specific data to a 'Globals' section, and simplifies the
> structure so that it can be common across all drivers.
> 
> Also seperates DVL log generation from SDV build, so that DVL logs
> can be created for CodeQL builds without SDV.
> 
> Signed-off-by: Owen Smith <owen.smith@citrix.com>

Reviewed-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

> ---
>   msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
>   1 file changed, 43 insertions(+), 20 deletions(-)
> 
> diff --git a/msbuild.ps1 b/msbuild.ps1
> index 6f55a5f..f258781 100644
> --- a/msbuild.ps1
> +++ b/msbuild.ps1
> @@ -12,6 +12,16 @@ param(
>   	[switch]$CodeAnalysis
>   )
>   
> +#
> +# Globals
> +#
> +$SolutionName = "xencons.sln"
> +$ArchivePath = "xencons"
> +$ProjectList = @( "xencons" )
> +
> +#
> +# Functions
> +#
>   Function Run-MSBuild {
>   	param(
>   		[string]$SolutionPath,
> @@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
> +
> +	Set-Location $basepath
> +}
> +
> +Function Run-MSBuildDVL {
> +	param(
> +		[string]$SolutionPath,
> +		[string]$Name,
> +		[string]$Configuration,
> +		[string]$Platform
> +	)
> +
> +	$basepath = Get-Location
> +	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
> +	Set-Location $projpath
> +
> +	$project = [string]::Format("{0}.vcxproj", $Name)
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
>   	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
>   
> @@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase Release"; "checked" = "$Configu
>   $platform = @{ "x86" = "Win32"; "x64" = "x64" }
>   $solutionpath = Resolve-Path $SolutionDir
>   
> -$archivepath = "xencons"
> -$projectlist = @( "xencons" )
> -
>   Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
>   
> -if ($Type -eq "free") {
> -	Run-MSBuild $solutionpath "xencons.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +if (-Not (Test-Path -Path $archivepath)) {
> +	New-Item -Name $archivepath -ItemType Directory | Out-Null
>   }
> -elseif ($Type -eq "checked") {
> -	Run-MSBuild $solutionpath "xencons.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +
> +if (($Type -eq "free") -or ($Type -eq "checked")) {
> +	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
>   }
> -elseif ($Type -eq "codeql") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> +if ($Type -eq "codeql") {
>   	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
>   		$searchpath = Resolve-Path ".."
>   	} else {
> @@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
>   	}
>   	New-Item -ItemType Directory "database" | Out-Null
>   
> -	$projectlist | ForEach {
> -		Run-CodeQL $solutionpath $_ $configuration["codeql"] $platform[$Arch] $searchpath
> +	ForEach ($project in $ProjectList) {
> +		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
>   	}
> -
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
>   }
> -elseif ($Type -eq "sdv") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> -	$projectlist | ForEach {
> -		Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] $platform[$Arch]
> +if ($Type -eq "sdv") {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
>   	}
> +}
>   
> +if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
> +	}
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
>   }



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 11:42:50 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 11:42:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163622.1490695 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKxd9-0003zq-K4; Mon, 17 Nov 2025 11:42:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163622.1490695; Mon, 17 Nov 2025 11:42:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKxd9-0003zj-HY; Mon, 17 Nov 2025 11:42:47 +0000
Received: by outflank-mailman (input) for mailman id 1163622;
 Mon, 17 Nov 2025 11:42:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=fEik=5Z=bounce.vates.tech=bounce-md_30504962.691b0a2d.v1-f8a2db63605c453bb9be851cdc4ec936@srs-se1.protection.inumbo.net>)
 id 1vKxd8-0003zd-DQ
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 11:42:46 +0000
Received: from mail128-17.atl41.mandrillapp.com
 (mail128-17.atl41.mandrillapp.com [198.2.128.17])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 84a7d30e-c3aa-11f0-980a-7dc792cee155;
 Mon, 17 Nov 2025 12:42:39 +0100 (CET)
Received: from pmta08.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail128-17.atl41.mandrillapp.com (Mailchimp) with ESMTP id
 4d95T92vNKzCfDYPr
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Nov 2025 11:42:37 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 f8a2db63605c453bb9be851cdc4ec936; Mon, 17 Nov 2025 11:42:37 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 84a7d30e-c3aa-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1763379757; x=1763649757;
	bh=tP3VGOXSc8M7rbejLHXCPWZ+aWBS+Cmtgmh34t8dszI=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=s/8bsHkd6eTTTinLjT5ZH2wJEmpfKu1vZYwEV/Pu7DPg0hR7XSzPqjslR/bwAvvKi
	 mgQyBwperhLdD4QlECwq3hT+/TV3hKsWoS4DSmwoZPjKvibIq2zAMkGPRzMXEvGiXY
	 hecDW533An3C2gzjJwkvqBrmvo5LtzaPgHbPC7XWJ/b3D/PdTXchdU9bx7dV8Nt+xr
	 qNpTDb4okqqzzmAZg//k2xaqt/rZAom1DcsJjlg+cqiMhyFrbhOfwD/NmDycs+Cn35
	 4KFp4jcjQMCEd3Z3D48JNRirJtJFDqkkpe7OfMnnMf33+B7an7OhdNpx7qCyrvU4DE
	 Y738gdPWvlcZw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1763379757; x=1763640257; i=ngoc-tu.dinh@vates.tech;
	bh=tP3VGOXSc8M7rbejLHXCPWZ+aWBS+Cmtgmh34t8dszI=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=P0AfRin8FtkmsKJ+3+ftz2QlsG4Ol+GQY923KOL2NYJLyHTTkmrqC3xAwVR+aBwvO
	 g/rfWPnnffitXplgtTbWa2e5qh3p1ikEzQ3sblPmr1W08E42cNd/yG4nxQ7mFHZkxl
	 JRyfioZBXXUg5LwaKuF/lrP90H7kmkEBTWVgEaw0fiU9jiAdiURKomwPdePJHh8+it
	 +n8EMVz0ZLOTh6ugkq9KSD3de/T8P6GIqJCGsdtYeMY5AxvnZmvdSP0NlSTzTUdP7B
	 CbBUFcJeHkdvUdUNhLrSgYfSTO2CpvbMTDZxGmOfxToAZ9QPBqDllOIsXvm5brI+jz
	 rtDQBmQfJQmRQ==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[xencons=20PATCH=201/3]=20Refactor=20msbuild.ps1?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1763379756515
Message-Id: <bb761e5c-b3d4-4740-b027-b38f9a6f5f0c@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251117081241.1832-1-owen.smith@citrix.com>
In-Reply-To: <20251117081241.1832-1-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.f8a2db63605c453bb9be851cdc4ec936?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251117:md
Date: Mon, 17 Nov 2025 11:42:37 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 17/11/2025 09:13, Owen Smith wrote:
> Moves all repo specific data to a 'Globals' section, and simplifies the
> structure so that it can be common across all drivers.
> 
> Also seperates DVL log generation from SDV build, so that DVL logs
> can be created for CodeQL builds without SDV.
> 
> Signed-off-by: Owen Smith <owen.smith@citrix.com>

All 3 patches:

Reviewed-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

> ---
>   msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
>   1 file changed, 43 insertions(+), 20 deletions(-)
> 
> diff --git a/msbuild.ps1 b/msbuild.ps1
> index 6f55a5f..f258781 100644
> --- a/msbuild.ps1
> +++ b/msbuild.ps1
> @@ -12,6 +12,16 @@ param(
>   	[switch]$CodeAnalysis
>   )
>   
> +#
> +# Globals
> +#
> +$SolutionName = "xencons.sln"
> +$ArchivePath = "xencons"
> +$ProjectList = @( "xencons" )
> +
> +#
> +# Functions
> +#
>   Function Run-MSBuild {
>   	param(
>   		[string]$SolutionPath,
> @@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
> +
> +	Set-Location $basepath
> +}
> +
> +Function Run-MSBuildDVL {
> +	param(
> +		[string]$SolutionPath,
> +		[string]$Name,
> +		[string]$Configuration,
> +		[string]$Platform
> +	)
> +
> +	$basepath = Get-Location
> +	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
> +	Set-Location $projpath
> +
> +	$project = [string]::Format("{0}.vcxproj", $Name)
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
>   	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
>   
> @@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase Release"; "checked" = "$Configu
>   $platform = @{ "x86" = "Win32"; "x64" = "x64" }
>   $solutionpath = Resolve-Path $SolutionDir
>   
> -$archivepath = "xencons"
> -$projectlist = @( "xencons" )
> -
>   Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
>   
> -if ($Type -eq "free") {
> -	Run-MSBuild $solutionpath "xencons.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +if (-Not (Test-Path -Path $archivepath)) {
> +	New-Item -Name $archivepath -ItemType Directory | Out-Null
>   }
> -elseif ($Type -eq "checked") {
> -	Run-MSBuild $solutionpath "xencons.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +
> +if (($Type -eq "free") -or ($Type -eq "checked")) {
> +	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
>   }
> -elseif ($Type -eq "codeql") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> +if ($Type -eq "codeql") {
>   	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
>   		$searchpath = Resolve-Path ".."
>   	} else {
> @@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
>   	}
>   	New-Item -ItemType Directory "database" | Out-Null
>   
> -	$projectlist | ForEach {
> -		Run-CodeQL $solutionpath $_ $configuration["codeql"] $platform[$Arch] $searchpath
> +	ForEach ($project in $ProjectList) {
> +		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
>   	}
> -
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
>   }
> -elseif ($Type -eq "sdv") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> -	$projectlist | ForEach {
> -		Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] $platform[$Arch]
> +if ($Type -eq "sdv") {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
>   	}
> +}
>   
> +if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
> +	}
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
>   }



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 11:44:49 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 11:44:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163623.1490700 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKxf7-00044m-PS; Mon, 17 Nov 2025 11:44:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163623.1490700; Mon, 17 Nov 2025 11:44:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKxf7-00044f-Mi; Mon, 17 Nov 2025 11:44:49 +0000
Received: by outflank-mailman (input) for mailman id 1163623;
 Mon, 17 Nov 2025 11:44:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DuNY=5Z=bounce.vates.tech=bounce-md_30504962.691b0aad.v1-d4ed2139288e41cd8d6943280b93a81e@srs-se1.protection.inumbo.net>)
 id 1vKxf6-00044Z-Nl
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 11:44:48 +0000
Received: from mail180-15.suw31.mandrillapp.com
 (mail180-15.suw31.mandrillapp.com [198.2.180.15])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d0aee79f-c3aa-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 12:44:47 +0100 (CET)
Received: from pmta11.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail180-15.suw31.mandrillapp.com (Mailchimp) with ESMTP id
 4d95Wd1ctxzPm0bxB
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Nov 2025 11:44:45 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 d4ed2139288e41cd8d6943280b93a81e; Mon, 17 Nov 2025 11:44:45 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d0aee79f-c3aa-11f0-9d18-b5c5bf9af7f9
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1763379885; x=1763649885;
	bh=InJEbBkREF9CWDaxepFhVk4cpzmiZ8sSYs36cXcNDjU=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=wKi00HH5K/EsB4kJGw6m7Q/0eQs4l7/OanhzatHxyglG4ZTBEC5idWuuzr3RJIvUK
	 xxnqUYpgJnZjOeRdsrq/Ep7c4MRFST67y/5sLc0UThJmILyoDJeWkpTA9ru/ZlCc9p
	 4RVrcHTQnKtvujjZXcSPel0Y/MeTcDyM3NeObL54OJybeRIqwsxFrdG4PdkoLMHrt6
	 MH1IuQ7SL5IhDUy72IUs1ahrymkLpBH+rwYSSdBiFipXY8Z0z52y/4Kz+wMnkBfplu
	 Y9HRfBd0ZH3lcH32XJlE0+fBRzZ0xnGsq80+AkkmX9FeZzWXOHEfPUB06FqF1HvgvP
	 3fXI/Ue8VM3XQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1763379885; x=1763640385; i=ngoc-tu.dinh@vates.tech;
	bh=InJEbBkREF9CWDaxepFhVk4cpzmiZ8sSYs36cXcNDjU=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=WIqW7zyn9FVr0it/wIndlA9dIezsK+7nuXQBDC7mUaTHe0TOgJ1VkecojCaiE1f9d
	 e9qSOgWCx3nQx3zNEeaGxfSys24FMQjVxwrEcQ7TQSsR4dkmdsvkDVhARQcCPhcqe4
	 KI7xABWi8EAWIJRKKTxHjFw4P7uiQKGJMaQMAVnfzoMdHv9K6XdLGSbQEc8ZH91y5h
	 QCnvH5hE4OGu1hmmOn6xYtIgm5y9p9CsZUonmJMZXcMrzWY3pYqprdY3PI8G1x7uZz
	 gePiBUhav2yv2UBBs4DrRH+ZcOmSyBAxBurn70oTCJt5WlvdslEOF4QqB5cVxttrOG
	 +//7ie9c0E94A==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[xenhid=20PATCH=201/3]=20Refactor=20msbuild.ps1?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1763379884423
Message-Id: <c67a5492-86fb-470e-bbaf-12c77f2635f2@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251117081640.555-1-owen.smith@citrix.com>
In-Reply-To: <20251117081640.555-1-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.d4ed2139288e41cd8d6943280b93a81e?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251117:md
Date: Mon, 17 Nov 2025 11:44:45 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 17/11/2025 09:16, Owen Smith wrote:
> Moves all repo specific data to a 'Globals' section, and simplifies the
> structure so that it can be common across all drivers.
> 
> Also seperates DVL log generation from SDV build, so that DVL logs
> can be created for CodeQL builds without SDV.
> 
> Signed-off-by: Owen Smith <owen.smith@citrix.com>

All 3 patches:

Acked-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

> ---
>   msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
>   1 file changed, 43 insertions(+), 20 deletions(-)
> 
> diff --git a/msbuild.ps1 b/msbuild.ps1
> index 15c5fc1..c889426 100644
> --- a/msbuild.ps1
> +++ b/msbuild.ps1
> @@ -12,6 +12,16 @@ param(
>   	[switch]$CodeAnalysis
>   )
>   
> +#
> +# Globals
> +#
> +$SolutionName = "xenhid.sln"
> +$ArchivePath = "xenhid"
> +$ProjectList = @( "xenhid" )
> +
> +#
> +# Functions
> +#
>   Function Run-MSBuild {
>   	param(
>   		[string]$SolutionPath,
> @@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
> +
> +	Set-Location $basepath
> +}
> +
> +Function Run-MSBuildDVL {
> +	param(
> +		[string]$SolutionPath,
> +		[string]$Name,
> +		[string]$Configuration,
> +		[string]$Platform
> +	)
> +
> +	$basepath = Get-Location
> +	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
> +	Set-Location $projpath
> +
> +	$project = [string]::Format("{0}.vcxproj", $Name)
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
>   	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
>   
> @@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase Release"; "checked" = "$Configu
>   $platform = @{ "x86" = "Win32"; "x64" = "x64" }
>   $solutionpath = Resolve-Path $SolutionDir
>   
> -$archivepath = "xenhid"
> -$projectlist = @( "xenhid" )
> -
>   Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
>   
> -if ($Type -eq "free") {
> -	Run-MSBuild $solutionpath "xenhid.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +if (-Not (Test-Path -Path $archivepath)) {
> +	New-Item -Name $archivepath -ItemType Directory | Out-Null
>   }
> -elseif ($Type -eq "checked") {
> -	Run-MSBuild $solutionpath "xenhid.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +
> +if (($Type -eq "free") -or ($Type -eq "checked")) {
> +	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
>   }
> -elseif ($Type -eq "codeql") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> +if ($Type -eq "codeql") {
>   	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
>   		$searchpath = Resolve-Path ".."
>   	} else {
> @@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
>   	}
>   	New-Item -ItemType Directory "database" | Out-Null
>   
> -	$projectlist | ForEach {
> -		Run-CodeQL $solutionpath $_ $configuration["codeql"] $platform[$Arch] $searchpath
> +	ForEach ($project in $ProjectList) {
> +		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
>   	}
> -
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
>   }
> -elseif ($Type -eq "sdv") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> -	$projectlist | ForEach {
> -		Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] $platform[$Arch]
> +if ($Type -eq "sdv") {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
>   	}
> +}
>   
> +if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
> +	}
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
>   }



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 11:45:02 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 11:45:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163624.1490705 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKxfK-00047L-SF; Mon, 17 Nov 2025 11:45:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163624.1490705; Mon, 17 Nov 2025 11:45:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKxfK-00047B-ON; Mon, 17 Nov 2025 11:45:02 +0000
Received: by outflank-mailman (input) for mailman id 1163624;
 Mon, 17 Nov 2025 11:45:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TmXG=5Z=bounce.vates.tech=bounce-md_30504962.691b0abb.v1-a1eb0f596db54136bae8919a2b49a744@srs-se1.protection.inumbo.net>)
 id 1vKxfJ-00044Z-Kl
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 11:45:01 +0000
Received: from mail128-17.atl41.mandrillapp.com
 (mail128-17.atl41.mandrillapp.com [198.2.128.17])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d9036684-c3aa-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 12:45:00 +0100 (CET)
Received: from pmta08.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail128-17.atl41.mandrillapp.com (Mailchimp) with ESMTP id
 4d95Wv2D3bzCf9P12
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Nov 2025 11:44:59 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 a1eb0f596db54136bae8919a2b49a744; Mon, 17 Nov 2025 11:44:59 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d9036684-c3aa-11f0-9d18-b5c5bf9af7f9
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1763379899; x=1763649899;
	bh=ZLFmVtmFLFAHnpzp5I35OzQ9xztpw5kou+EYS8mN9MY=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=SQUbivCNp7+KxDFhrkRF8qlYvoY/NWl/NV6Nm9D4t+NJYBV4fR/CEXIcrKFVHzMam
	 WDdulk6MF38bZsDLNrlmv82CE9LRyIFYiVb/ZfM7qt9MNc3qd2qWJAZKaH7X5t8tbM
	 nEiLjdjJXCisFPBqER11beg+hznU8RdIGmi70rd+zuQdU+LT9+/BDTbAn1nJlKQxaS
	 UNPv5cvodAjLNaw2xHTTKDCZLI9wiak5DAWVlMaxibUHI/dpU/pa2+IATpyqWDWgYR
	 Cci8r09PXAroNbBuQDyyXBiHD2pf1wFQBLoar0JuHrspr8H1ho9BmDsdEPFUCUZDy6
	 84p7oDmO8Zvng==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1763379899; x=1763640399; i=ngoc-tu.dinh@vates.tech;
	bh=ZLFmVtmFLFAHnpzp5I35OzQ9xztpw5kou+EYS8mN9MY=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=uR4ZNRXSs3ky1NnKD5W4NEsqiSDX08h8cUHAuZiz8+Z1p/h20nsGQiqcrrJETDTll
	 bOy3TFqMLFiGARijFa/0XImPsQswpl7WO+3tOGKroiDJ/KiYJByssVhHcVKA8K9aet
	 SNK/KGtUwZswZLOTuMBIU76IVHyHnTmDZm4CC/VyVPXZjfB4TjoJed6v7hua2R7IDs
	 dQcdQ8EiP/sO4u30U5Q/4ZIY3JzNF7CToqyE9eNT43za6XIQfNWHdyicrOeFnCnrRE
	 fohmaY0IzQk1/ZdC5+Nmg9C0vyurDm7Hnw0pd9uqUgNmvxrgxLQHLg/XhbJ1PFidoF
	 cR66vuYqYE2Sw==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[xenvkbd=20PATCH=201/3]=20Refactor=20msbuild.ps1?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1763379897012
Message-Id: <3e6c2895-a0ea-4f4c-8f12-d24f9c79f0bd@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251117084915.869-1-owen.smith@citrix.com>
In-Reply-To: <20251117084915.869-1-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.a1eb0f596db54136bae8919a2b49a744?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251117:md
Date: Mon, 17 Nov 2025 11:44:59 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 17/11/2025 09:49, Owen Smith wrote:
> Moves all repo specific data to a 'Globals' section, and simplifies the
> structure so that it can be common across all drivers.
> 
> Also seperates DVL log generation from SDV build, so that DVL logs
> can be created for CodeQL builds without SDV.
> 
> Signed-off-by: Owen Smith <owen.smith@citrix.com>

All 3 patches:

Acked-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

> ---
>   msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
>   1 file changed, 43 insertions(+), 20 deletions(-)
> 
> diff --git a/msbuild.ps1 b/msbuild.ps1
> index 7228f42..24b61c1 100644
> --- a/msbuild.ps1
> +++ b/msbuild.ps1
> @@ -12,6 +12,16 @@ param(
>   	[switch]$CodeAnalysis
>   )
>   
> +#
> +# Globals
> +#
> +$SolutionName = "xenvkbd.sln"
> +$ArchivePath = "xenvkbd"
> +$ProjectList = @( "xenvkbd" )
> +
> +#
> +# Functions
> +#
>   Function Run-MSBuild {
>   	param(
>   		[string]$SolutionPath,
> @@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
> +
> +	Set-Location $basepath
> +}
> +
> +Function Run-MSBuildDVL {
> +	param(
> +		[string]$SolutionPath,
> +		[string]$Name,
> +		[string]$Configuration,
> +		[string]$Platform
> +	)
> +
> +	$basepath = Get-Location
> +	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
> +	Set-Location $projpath
> +
> +	$project = [string]::Format("{0}.vcxproj", $Name)
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
>   	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
>   
> @@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase Release"; "checked" = "$Configu
>   $platform = @{ "x86" = "Win32"; "x64" = "x64" }
>   $solutionpath = Resolve-Path $SolutionDir
>   
> -$archivepath = "xenvkbd"
> -$projectlist = @( "xenvkbd" )
> -
>   Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
>   
> -if ($Type -eq "free") {
> -	Run-MSBuild $solutionpath "xenvkbd.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +if (-Not (Test-Path -Path $archivepath)) {
> +	New-Item -Name $archivepath -ItemType Directory | Out-Null
>   }
> -elseif ($Type -eq "checked") {
> -	Run-MSBuild $solutionpath "xenvkbd.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +
> +if (($Type -eq "free") -or ($Type -eq "checked")) {
> +	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
>   }
> -elseif ($Type -eq "codeql") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> +if ($Type -eq "codeql") {
>   	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
>   		$searchpath = Resolve-Path ".."
>   	} else {
> @@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
>   	}
>   	New-Item -ItemType Directory "database" | Out-Null
>   
> -	$projectlist | ForEach {
> -		Run-CodeQL $solutionpath $_ $configuration["codeql"] $platform[$Arch] $searchpath
> +	ForEach ($project in $ProjectList) {
> +		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
>   	}
> -
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
>   }
> -elseif ($Type -eq "sdv") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> -	$projectlist | ForEach {
> -		Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] $platform[$Arch]
> +if ($Type -eq "sdv") {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
>   	}
> +}
>   
> +if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
> +	}
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
>   }



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 11:59:34 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 11:59:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163634.1490717 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKxtN-00061M-2l; Mon, 17 Nov 2025 11:59:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163634.1490717; Mon, 17 Nov 2025 11:59:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKxtN-00061F-0B; Mon, 17 Nov 2025 11:59:33 +0000
Received: by outflank-mailman (input) for mailman id 1163634;
 Mon, 17 Nov 2025 11:59:31 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=B2dI=5Z=bounce.vates.tech=bounce-md_30504962.691b0e1c.v1-a5fd59783142476e9c772f21ec74c44f@srs-se1.protection.inumbo.net>)
 id 1vKxtL-0005v6-H0
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 11:59:31 +0000
Received: from mail128-17.atl41.mandrillapp.com
 (mail128-17.atl41.mandrillapp.com [198.2.128.17])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dcd6d77b-c3ac-11f0-980a-7dc792cee155;
 Mon, 17 Nov 2025 12:59:26 +0100 (CET)
Received: from pmta08.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail128-17.atl41.mandrillapp.com (Mailchimp) with ESMTP id
 4d95rX6xpZzCf9RlB
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Nov 2025 11:59:24 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 a5fd59783142476e9c772f21ec74c44f; Mon, 17 Nov 2025 11:59:24 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dcd6d77b-c3ac-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1763380765; x=1763650765;
	bh=iFgI/XOIybUPmh/W6tKtXC0jDV70tiZ9hoAVkDJTOl0=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=xMJgj/zYgpVFNMHmBNUC6utVawKRDZkFPqrkT+yjXb1yzVpxF4dNoJEPh0KTk6T46
	 T4JenVlX5kDlLumeVvG4bqrbpXWnSVRHHVDQl5WaK1i1knp09kblsDk2NKDGQw0Ut7
	 yGZmpZ8SmNklGX9uJ7b/TDkTr140zRK2NjDmJVJ5CnbEZznm1ggCPyXpepgsPHjxUc
	 K5VyJY259zhAK3HEXgu33Z/6Do3ipDKVY3uEj+bU0fTyfk6tXufYJCi9JFY/vqx5+9
	 +GC4A7cPtckyxTxe0TlK1xW8jqO00i49uWAnhJTPydfGR/gs+MX+Ps3+6HCWGLgXmk
	 OiixvoEEcCuGA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1763380765; x=1763641265; i=ngoc-tu.dinh@vates.tech;
	bh=iFgI/XOIybUPmh/W6tKtXC0jDV70tiZ9hoAVkDJTOl0=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=KxCG4Bny7bcoPHbJWpwn08Hmhftaapq/ZmQ2s5RGhISChl641ausB3jtrjPblDrbw
	 JsfbXhLd3MavOugd/B5yLPcVPHmMES8Ju/zD2U0bdutm5IbU2pFXRWbF1xudfv+Et2
	 gqmuE59T+a3E4G7IgSSl0uWAcP1tgKVotTDUoh/mb2cGyqNAEhbKC/y24RTX3vseKa
	 qKrAB0mHOU63hNvbMNgF4kqQrLNyjzshKlSMAuxybggq0lFn1Z2wvj3PUlCSuveqw+
	 FoG1YdP1+39V11ZMJ+2FnzTI+gufsMcwlRmArGevX6MyssDzks1cvc0MsTzo1G7EZg
	 Sdx/RT0gla0sg==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[xenvbd=20PATCH=201/3]=20Refactor=20msbuild.ps1?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1763380764165
Message-Id: <8c6ac259-b1c1-4b13-84a4-116fdb34a1d4@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251117082957.494-1-owen.smith@citrix.com>
In-Reply-To: <20251117082957.494-1-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.a5fd59783142476e9c772f21ec74c44f?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251117:md
Date: Mon, 17 Nov 2025 11:59:24 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 17/11/2025 09:30, Owen Smith wrote:
> Moves all repo specific data to a 'Globals' section, and simplifies the
> structure so that it can be common across all drivers.
> 
> Also seperates DVL log generation from SDV build, so that DVL logs
> can be created for CodeQL builds without SDV.
> 
> Signed-off-by: Owen Smith <owen.smith@citrix.com>

All 3 patches:

Reviewed-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

> ---
>   msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
>   1 file changed, 43 insertions(+), 20 deletions(-)
> 
> diff --git a/msbuild.ps1 b/msbuild.ps1
> index 8028f25..3226610 100644
> --- a/msbuild.ps1
> +++ b/msbuild.ps1
> @@ -12,6 +12,16 @@ param(
>   	[switch]$CodeAnalysis
>   )
>   
> +#
> +# Globals
> +#
> +$SolutionName = "xenvbd.sln"
> +$ArchivePath = "xenvbd"
> +$ProjectList = @( "xencrsh", "xendisk", "xenvbd" )
> +
> +#
> +# Functions
> +#
>   Function Run-MSBuild {
>   	param(
>   		[string]$SolutionPath,
> @@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
> +
> +	Set-Location $basepath
> +}
> +
> +Function Run-MSBuildDVL {
> +	param(
> +		[string]$SolutionPath,
> +		[string]$Name,
> +		[string]$Configuration,
> +		[string]$Platform
> +	)
> +
> +	$basepath = Get-Location
> +	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
> +	Set-Location $projpath
> +
> +	$project = [string]::Format("{0}.vcxproj", $Name)
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
>   	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
>   
> @@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase Release"; "checked" = "$Configu
>   $platform = @{ "x86" = "Win32"; "x64" = "x64" }
>   $solutionpath = Resolve-Path $SolutionDir
>   
> -$archivepath = "xenvbd"
> -$projectlist = @( "xencrsh", "xendisk", "xenvbd" )
> -
>   Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
>   
> -if ($Type -eq "free") {
> -	Run-MSBuild $solutionpath "xenvbd.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +if (-Not (Test-Path -Path $archivepath)) {
> +	New-Item -Name $archivepath -ItemType Directory | Out-Null
>   }
> -elseif ($Type -eq "checked") {
> -	Run-MSBuild $solutionpath "xenvbd.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +
> +if (($Type -eq "free") -or ($Type -eq "checked")) {
> +	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
>   }
> -elseif ($Type -eq "codeql") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> +if ($Type -eq "codeql") {
>   	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
>   		$searchpath = Resolve-Path ".."
>   	} else {
> @@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
>   	}
>   	New-Item -ItemType Directory "database" | Out-Null
>   
> -	$projectlist | ForEach {
> -		Run-CodeQL $solutionpath $_ $configuration["codeql"] $platform[$Arch] $searchpath
> +	ForEach ($project in $ProjectList) {
> +		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
>   	}
> -
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
>   }
> -elseif ($Type -eq "sdv") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> -	$projectlist | ForEach {
> -		Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] $platform[$Arch]
> +if ($Type -eq "sdv") {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
>   	}
> +}
>   
> +if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
> +	}
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
>   }



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 12:14:17 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 12:14:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163651.1490732 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKy7c-0000ga-FB; Mon, 17 Nov 2025 12:14:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163651.1490732; Mon, 17 Nov 2025 12:14:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKy7c-0000gT-Cb; Mon, 17 Nov 2025 12:14:16 +0000
Received: by outflank-mailman (input) for mailman id 1163651;
 Mon, 17 Nov 2025 12:14:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=JorN=5Z=bounce.vates.tech=bounce-md_30504962.691b1194.v1-5b2660df98324f0f93b5cfd41084666c@srs-se1.protection.inumbo.net>)
 id 1vKy7b-0000gL-Br
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 12:14:15 +0000
Received: from mail128-17.atl41.mandrillapp.com
 (mail128-17.atl41.mandrillapp.com [198.2.128.17])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ee0c8add-c3ae-11f0-9d18-b5c5bf9af7f9;
 Mon, 17 Nov 2025 13:14:14 +0100 (CET)
Received: from pmta08.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail128-17.atl41.mandrillapp.com (Mailchimp) with ESMTP id
 4d969c14TFzCf9RlB
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Nov 2025 12:14:12 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 5b2660df98324f0f93b5cfd41084666c; Mon, 17 Nov 2025 12:14:12 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ee0c8add-c3ae-11f0-9d18-b5c5bf9af7f9
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1763381652; x=1763651652;
	bh=qhsGm0cEKLl5eO3RvF4tdPHYzHtsiRVooOJWooGQEFg=;
	h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=pugruxO225jBnFe39IzjRdEYx4sW9PE5vGJ1gO8gKkUcCALuRCubWs072C/h7uz2U
	 8MJiXWnO7lfrU66nbJDHjb0ImFmTGaRq6a/KPF7YJNN2KT4hLnXDyVEd1Qt3w2cNmu
	 eWUNaOmz/iw3Ex/rUFTGRCewe9OwWMsSN0FOCAR7Vy+hKC4/WY7iUlHanx9b+jnGH0
	 nRT2QhyzLgz+FStn1xJG8v9sIr+N+qO1gtsEWO4/YhXXsaPtzmPMgK9xzreMwPoN7m
	 4MGe1yN4rOXnQFmUtKJ2Fzo5iI8cpHRGzaMRd5wpZH6qrr5HiBYCpPGv79pKIuS+DD
	 lXWIXXBInZqDA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1763381652; x=1763642152; i=ngoc-tu.dinh@vates.tech;
	bh=qhsGm0cEKLl5eO3RvF4tdPHYzHtsiRVooOJWooGQEFg=;
	h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=TXC9Q+SRAY1t9He6kTODj4PMmT8eKQ4kEg2JAtNK1T8AkbZDbUnIndvWKnnMNuvLo
	 F12aEdLC7jfRP+seFSLBeyXPxY+sJ9ms4TsgPzyTmcxzJTmQUDtCr2X8H8IsomDJ+n
	 8fgs2jV0SP3dmP+UDugqw/yC4S9OavyGqKFnzDMWXGOfnmWiJN42e4dSZf0gBVRci4
	 oK21w/Q7YkOcze6S3U1skx4WkdLDtz66e50ZstA2jFga2WRupIPNE0h8eAmq3cmunF
	 IrD6NLuDFimGpd6KX7dJ0hN/RUAQz+FkiFpexUax6IaoqCXvZzE9ba0iAxXxoZ00Rr
	 dair/tskt6Yzg==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[xenvif=20PATCH=203/3]=20Enable=20KASAN=20build=20support?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1763381650987
Message-Id: <b82d119b-228e-4464-a243-3b65e3339f9a@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
Cc: "david ambu" <david.preetham@cloud.com>
References: <20251117083629.1498-1-owen.smith@citrix.com> <20251117083629.1498-3-owen.smith@citrix.com>
In-Reply-To: <20251117083629.1498-3-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.5b2660df98324f0f93b5cfd41084666c?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251117:md
Date: Mon, 17 Nov 2025 12:14:12 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 17/11/2025 09:36, Owen Smith wrote:
> KASAN (Kernel Address Sanitizer)
> (see https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/kasan)
> builds can be enabled when using the WDK 10.0.26100.2161 or later, and can be
> used on specially prepared Windows 11 24H2 / Server 2025, or later, OSs.
> 
> KASAN enabled drivers should not generally deployed, as the OS needs to be
> enabled, but these drivers can help track down illegal memory accesses and
> similar issues.
> 
> Signed-off-by: david ambu <david.preetham@cloud.com>

Installing Xenvif + Xennet in KASAN + Verifier mode causes Windows 
Server 2025 26100.7171 to hang upon a BSOD (e.g. when triggered by 
NotMyFault) instead of successfully rebooting, although minidump is 
still generated. I haven't verified this behavior without 
KASAN/Verifier. Other drivers (including Xenvbd) worked fine.

> ---
>   build.ps1   |  6 ++++--
>   msbuild.ps1 | 11 ++++++++---
>   2 files changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/build.ps1 b/build.ps1
> index 42bbdde..1ec30ee 100644
> --- a/build.ps1
> +++ b/build.ps1
> @@ -9,7 +9,8 @@ param(
>   	[string]$SignMode = "TestSign",
>   	[switch]$CodeQL,
>   	[switch]$Sdv,
> -	[switch]$CodeAnalysis
> +	[switch]$CodeAnalysis,
> +	[switch]$Kasan
>   )
>   
>   #
> @@ -32,7 +33,8 @@ Function Build {
>   		Arch = $Arch;
>   		Type = $Type;
>   		SignMode = $SignMode;
> -		CodeAnalysis = $CodeAnalysis
> +		CodeAnalysis = $CodeAnalysis;
> +		Kasan = $Kasan
>   		}
>   	& ".\msbuild.ps1" @params
>   	if ($LASTEXITCODE -ne 0) {
> diff --git a/msbuild.ps1 b/msbuild.ps1
> index 21548a0..707ec05 100644
> --- a/msbuild.ps1
> +++ b/msbuild.ps1
> @@ -9,7 +9,8 @@ param(
>   	[Parameter(Mandatory = $true)]
>   	[string]$Type,
>   	[string]$SignMode = "TestSign",
> -	[switch]$CodeAnalysis
> +	[switch]$CodeAnalysis,
> +	[switch]$Kasan
>   )
>   
>   #
> @@ -30,7 +31,8 @@ Function Run-MSBuild {
>   		[string]$Platform,
>   		[string]$Target = "Build",
>   		[string]$Inputs = "",
> -		[switch]$CodeAnalysis
> +		[switch]$CodeAnalysis,
> +		[switch]$Kasan
>   	)
>   
>   	$c = "msbuild.exe"
> @@ -46,6 +48,9 @@ Function Run-MSBuild {
>   		$c += "/p:RunCodeAnalysis=true "
>   		$c += "/p:EnablePREFast=true "
>   	}
> +	if ($Kasan) {
> +		$c += "/p:EnableKASAN=true "
> +	}
>   
>   	$c += Join-Path -Path $SolutionPath -ChildPath $Name
>   
> @@ -186,7 +191,7 @@ if (-Not (Test-Path -Path $archivepath)) {
>   }
>   
>   if (($Type -eq "free") -or ($Type -eq "checked")) {
> -	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis -Kasan:$Kasan
>   }
>   
>   if ($Type -eq "codeql") {



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 12:15:00 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 12:15:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163653.1490735 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKy8K-0000mF-Ho; Mon, 17 Nov 2025 12:15:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163653.1490735; Mon, 17 Nov 2025 12:15:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKy8K-0000m8-FM; Mon, 17 Nov 2025 12:15:00 +0000
Received: by outflank-mailman (input) for mailman id 1163653;
 Mon, 17 Nov 2025 12:14:59 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8VzL=5Z=bounce.vates.tech=bounce-md_30504962.691b11bc.v1-282112c456ae4462956373b27c9dea9c@srs-se1.protection.inumbo.net>)
 id 1vKy8J-0000m0-8a
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 12:14:59 +0000
Received: from mail180-15.suw31.mandrillapp.com
 (mail180-15.suw31.mandrillapp.com [198.2.180.15])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 05c4bb4c-c3af-11f0-980a-7dc792cee155;
 Mon, 17 Nov 2025 13:14:53 +0100 (CET)
Received: from pmta11.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail180-15.suw31.mandrillapp.com (Mailchimp) with ESMTP id
 4d96BN3mHszPm0Q3L
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Nov 2025 12:14:52 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 282112c456ae4462956373b27c9dea9c; Mon, 17 Nov 2025 12:14:52 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 05c4bb4c-c3af-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1763381692; x=1763651692;
	bh=juiOoEeiyxxNSSpSdEF9tvlBRYMYlt50sRCrDB/DSfQ=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=xpBmN8+H1Ix9C4iZ68CG+G10J73M/a8idVS2smu6Q4dvnNyUlKUj6co9q15SNN/Rw
	 Fzyri5kkFGdYVsT8FDU9T9UHDl5tuGPP4mLlrHxa+UyvaUEPNGNW35viEnIpB78FHO
	 dKsU3riKblheizUwtaLhQtXMY1/3LgQEvyfeYjJEyCgdIHiLubTjdI2gWiPeD2lnOJ
	 DPbktWF6JAmGldzA/7Bslrv5p1dxS1SGxVWTQH5zLZ7kTorfLFDcSb4yt7mLNgHAN+
	 7nvyWx6QuPNxTNEQzI0/H0wdjeg648g5Yb3fAhAR0hCJZe+B1k/665OoRDj/9eZf9n
	 Uf5Zy8aYbe3OQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1763381692; x=1763642192; i=ngoc-tu.dinh@vates.tech;
	bh=juiOoEeiyxxNSSpSdEF9tvlBRYMYlt50sRCrDB/DSfQ=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=jeD6jv7h+21CkjSLBkig/DcPqbHdrPZxwdSCxNY5th4HoBq/S447hN0s/ob70s3Pm
	 9KK5eTIrPdMsyrEWumY+mCokrC7aS5jXJYCWs1Hhktgm6ODTdXV7A0KGXqPH9hhuRW
	 ynba4gG5249q9rZtPUien4CYgvGSGcWrBwXNlTw2T/HTxgVVUeS2BIo3VG1jG8lVfv
	 CEcfSw6nhBW8kjNQQzLW7bB4BDnmJK9ngnNedRDnWH7L/c6vR7Ev7wi0r4Vf8W5igj
	 /qbtAS4J7a9UfEne+x326jfuOGD1GoNJndew1zmkLyf5itMBxod8UfiJLnMOC+dbii
	 qOJ0rAemWh39g==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[xeniface=20PATCH=201/3]=20Refactor=20msbuild.ps1?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1763381691736
Message-Id: <d7b33a01-6447-47e7-87ce-f14030240386@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251117082026.1179-1-owen.smith@citrix.com>
In-Reply-To: <20251117082026.1179-1-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.282112c456ae4462956373b27c9dea9c?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251117:md
Date: Mon, 17 Nov 2025 12:14:52 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 17/11/2025 09:20, Owen Smith wrote:
> Moves all repo specific data to a 'Globals' section, and simplifies the
> structure so that it can be common across all drivers.
> 
> Also seperates DVL log generation from SDV build, so that DVL logs
> can be created for CodeQL builds without SDV.
> 
> Signed-off-by: Owen Smith <owen.smith@citrix.com>

All 3 patches:

Reviewed-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

> ---
>   msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
>   1 file changed, 43 insertions(+), 20 deletions(-)
> 
> diff --git a/msbuild.ps1 b/msbuild.ps1
> index 794cb6f..04dceba 100644
> --- a/msbuild.ps1
> +++ b/msbuild.ps1
> @@ -12,6 +12,16 @@ param(
>   	[switch]$CodeAnalysis
>   )
>   
> +#
> +# Globals
> +#
> +$SolutionName = "xeniface.sln"
> +$ArchivePath = "xeniface"
> +$ProjectList = @( "xeniface" )
> +
> +#
> +# Functions
> +#
>   Function Run-MSBuild {
>   	param(
>   		[string]$SolutionPath,
> @@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
> +
> +	Set-Location $basepath
> +}
> +
> +Function Run-MSBuildDVL {
> +	param(
> +		[string]$SolutionPath,
> +		[string]$Name,
> +		[string]$Configuration,
> +		[string]$Platform
> +	)
> +
> +	$basepath = Get-Location
> +	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
> +	Set-Location $projpath
> +
> +	$project = [string]::Format("{0}.vcxproj", $Name)
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
>   	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
>   
> @@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase Release"; "checked" = "$Configu
>   $platform = @{ "x86" = "Win32"; "x64" = "x64" }
>   $solutionpath = Resolve-Path $SolutionDir
>   
> -$archivepath = "xeniface"
> -$projectlist = @( "xeniface" )
> -
>   Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
>   
> -if ($Type -eq "free") {
> -	Run-MSBuild $solutionpath "xeniface.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +if (-Not (Test-Path -Path $archivepath)) {
> +	New-Item -Name $archivepath -ItemType Directory | Out-Null
>   }
> -elseif ($Type -eq "checked") {
> -	Run-MSBuild $solutionpath "xeniface.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +
> +if (($Type -eq "free") -or ($Type -eq "checked")) {
> +	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
>   }
> -elseif ($Type -eq "codeql") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> +if ($Type -eq "codeql") {
>   	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
>   		$searchpath = Resolve-Path ".."
>   	} else {
> @@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
>   	}
>   	New-Item -ItemType Directory "database" | Out-Null
>   
> -	$projectlist | ForEach {
> -		Run-CodeQL $solutionpath $_ $configuration["codeql"] $platform[$Arch] $searchpath
> +	ForEach ($project in $ProjectList) {
> +		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
>   	}
> -
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
>   }
> -elseif ($Type -eq "sdv") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> -	$projectlist | ForEach {
> -		Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] $platform[$Arch]
> +if ($Type -eq "sdv") {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
>   	}
> +}
>   
> +if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
> +	}
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
>   }



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 12:51:58 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 12:51:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163766.1490850 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKyi3-00033R-Tp; Mon, 17 Nov 2025 12:51:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163766.1490850; Mon, 17 Nov 2025 12:51:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKyi3-00033J-Qj; Mon, 17 Nov 2025 12:51:55 +0000
Received: by outflank-mailman (input) for mailman id 1163766;
 Mon, 17 Nov 2025 12:51:54 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=6JQ1=5Z=bounce.vates.tech=bounce-md_30504962.691b1a62.v1-09cbb77878af43fd881cc2022cadf6d6@srs-se1.protection.inumbo.net>)
 id 1vKyi2-0001xJ-Fa
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 12:51:54 +0000
Received: from mail180-15.suw31.mandrillapp.com
 (mail180-15.suw31.mandrillapp.com [198.2.180.15])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2d91a019-c3b4-11f0-980a-7dc792cee155;
 Mon, 17 Nov 2025 13:51:48 +0100 (CET)
Received: from pmta11.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail180-15.suw31.mandrillapp.com (Mailchimp) with ESMTP id
 4d970y5crhzPm0tWk
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Nov 2025 12:51:46 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 09cbb77878af43fd881cc2022cadf6d6; Mon, 17 Nov 2025 12:51:46 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2d91a019-c3b4-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1763383906; x=1763653906;
	bh=3w5ahoXUCwpyyaHoR0+iSESG4SUJo1HN4Nbgw8hFgvE=;
	h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=Wt1+bl4cfHu0nvYtKiqpkpmjDM9HFcUxhjbM67IL3/4FEZQ9RzS8FjFAKHq/5xI09
	 RMZ57wHB+kBgATI4rKQkD+ruazEslKVfS52i4awSHnMzHZI/kU6VohVxr3iixMilyc
	 pTU2A6AxCwzhkUqRswsjbkK9qAlEX1rPKtq4+SiIiUzlJE7SzoUpRz43NTpbqi5Fmo
	 B0UDGIyYwKR6ngv0MnByH6CiAXAUVE9PjX4oAVjJ6TsoblJlo7xuwzyo330z7mCj5j
	 bHPBVaF906/y62eGJQjzQ7Aq2PY1DBODn8NOkOychrR1dq5vASBBijZu27adUM2Kg8
	 APaqVRZlNoUdA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1763383906; x=1763644406; i=ngoc-tu.dinh@vates.tech;
	bh=3w5ahoXUCwpyyaHoR0+iSESG4SUJo1HN4Nbgw8hFgvE=;
	h=From:Subject:Message-Id:To:Cc:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=en4SyBYdzb8ZZNSCtaDt+4TxMl5+YP0a/4/t0WpEZRFrR4tWf2oSbju0nxP0vxv4A
	 d34JJZds1Dug7FELYFnehSKTlHQoh1fGW9Fny7j3Ee9OhTc7T4nWG6iDGcFT6IS6Lk
	 7rS0QlYhUb7nTBmzNb0IuAs/7TjsQMkyN68zBf4B/pbyq7SDi2R7lIr6Sn7ywlQIjh
	 2Dw8sUsX5QkuAbdsOOeReg0JRBPOmKvAkTudkeINqvRnJiI7RU4R7B7RW6ukF0KYOZ
	 jmciemDlCqwbB09EDGu+NpwEwRSaLJyJkISmuW8tLNZGe9FU9UE/r2eTgrboxXBYLX
	 e3rkBGmsHnwsw==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[xenvif=20PATCH=203/3]=20Enable=20KASAN=20build=20support?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1763383905738
Message-Id: <04eb2f04-4b15-4fef-a5bf-cda801d7909e@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
Cc: "david ambu" <david.preetham@cloud.com>
References: <20251117083629.1498-1-owen.smith@citrix.com> <20251117083629.1498-3-owen.smith@citrix.com> <b82d119b-228e-4464-a243-3b65e3339f9a@vates.tech>
In-Reply-To: <b82d119b-228e-4464-a243-3b65e3339f9a@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.09cbb77878af43fd881cc2022cadf6d6?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251117:md
Date: Mon, 17 Nov 2025 12:51:46 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 17/11/2025 13:14, Tu Dinh wrote:
> On 17/11/2025 09:36, Owen Smith wrote:
>> KASAN (Kernel Address Sanitizer)
>> (see https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/kasan)
>> builds can be enabled when using the WDK 10.0.26100.2161 or later, and can be
>> used on specially prepared Windows 11 24H2 / Server 2025, or later, OSs.
>>
>> KASAN enabled drivers should not generally deployed, as the OS needs to be
>> enabled, but these drivers can help track down illegal memory accesses and
>> similar issues.
>>
>> Signed-off-by: david ambu <david.preetham@cloud.com>
> 
> Installing Xenvif + Xennet in KASAN + Verifier mode causes Windows
> Server 2025 26100.7171 to hang upon a BSOD (e.g. when triggered by
> NotMyFault) instead of successfully rebooting, although minidump is
> still generated. I haven't verified this behavior without
> KASAN/Verifier. Other drivers (including Xenvbd) worked fine.
> 

Never mind, I think it was KDNET interfering.

>> ---
>>    build.ps1   |  6 ++++--
>>    msbuild.ps1 | 11 ++++++++---
>>    2 files changed, 12 insertions(+), 5 deletions(-)
>>
>> diff --git a/build.ps1 b/build.ps1
>> index 42bbdde..1ec30ee 100644
>> --- a/build.ps1
>> +++ b/build.ps1
>> @@ -9,7 +9,8 @@ param(
>>    	[string]$SignMode = "TestSign",
>>    	[switch]$CodeQL,
>>    	[switch]$Sdv,
>> -	[switch]$CodeAnalysis
>> +	[switch]$CodeAnalysis,
>> +	[switch]$Kasan
>>    )
>>    
>>    #
>> @@ -32,7 +33,8 @@ Function Build {
>>    		Arch = $Arch;
>>    		Type = $Type;
>>    		SignMode = $SignMode;
>> -		CodeAnalysis = $CodeAnalysis
>> +		CodeAnalysis = $CodeAnalysis;
>> +		Kasan = $Kasan
>>    		}
>>    	& ".\msbuild.ps1" @params
>>    	if ($LASTEXITCODE -ne 0) {
>> diff --git a/msbuild.ps1 b/msbuild.ps1
>> index 21548a0..707ec05 100644
>> --- a/msbuild.ps1
>> +++ b/msbuild.ps1
>> @@ -9,7 +9,8 @@ param(
>>    	[Parameter(Mandatory = $true)]
>>    	[string]$Type,
>>    	[string]$SignMode = "TestSign",
>> -	[switch]$CodeAnalysis
>> +	[switch]$CodeAnalysis,
>> +	[switch]$Kasan
>>    )
>>    
>>    #
>> @@ -30,7 +31,8 @@ Function Run-MSBuild {
>>    		[string]$Platform,
>>    		[string]$Target = "Build",
>>    		[string]$Inputs = "",
>> -		[switch]$CodeAnalysis
>> +		[switch]$CodeAnalysis,
>> +		[switch]$Kasan
>>    	)
>>    
>>    	$c = "msbuild.exe"
>> @@ -46,6 +48,9 @@ Function Run-MSBuild {
>>    		$c += "/p:RunCodeAnalysis=true "
>>    		$c += "/p:EnablePREFast=true "
>>    	}
>> +	if ($Kasan) {
>> +		$c += "/p:EnableKASAN=true "
>> +	}
>>    
>>    	$c += Join-Path -Path $SolutionPath -ChildPath $Name
>>    
>> @@ -186,7 +191,7 @@ if (-Not (Test-Path -Path $archivepath)) {
>>    }
>>    
>>    if (($Type -eq "free") -or ($Type -eq "checked")) {
>> -	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
>> +	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis -Kasan:$Kasan
>>    }
>>    
>>    if ($Type -eq "codeql") {
> 
> 
> 
> --
> Ngoc Tu Dinh | Vates XCP-ng Developer
> 
> XCP-ng & Xen Orchestra - Vates solutions
> 
> web: https://vates.tech
> 
> 



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 12:52:06 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 12:52:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163778.1490853 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKyiE-0003Uu-VL; Mon, 17 Nov 2025 12:52:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163778.1490853; Mon, 17 Nov 2025 12:52:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKyiE-0003Ui-Si; Mon, 17 Nov 2025 12:52:06 +0000
Received: by outflank-mailman (input) for mailman id 1163778;
 Mon, 17 Nov 2025 12:52:05 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Oy+O=5Z=bounce.vates.tech=bounce-md_30504962.691b1a71.v1-92d73c7f8019459497d970c5cfbcaeac@srs-se1.protection.inumbo.net>)
 id 1vKyiD-0001xJ-0I
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 12:52:05 +0000
Received: from mail128-17.atl41.mandrillapp.com
 (mail128-17.atl41.mandrillapp.com [198.2.128.17])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3663387f-c3b4-11f0-980a-7dc792cee155;
 Mon, 17 Nov 2025 13:52:03 +0100 (CET)
Received: from pmta08.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail128-17.atl41.mandrillapp.com (Mailchimp) with ESMTP id
 4d971F46t0zCf9S91
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Nov 2025 12:52:01 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 92d73c7f8019459497d970c5cfbcaeac; Mon, 17 Nov 2025 12:52:01 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3663387f-c3b4-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1763383921; x=1763653921;
	bh=X5J4SmdOpcJRlUXgTjkKoixE54d/UIp1WZ9mHgJLB1w=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=DScFRLQmf3xJeP29xSkf6IQThQQp4l28WDTVC9K3QTBudJahe+nRfM60LN4hyBdft
	 b15DlOmyOxRI5ZYOe2N/x+uNtsIN/WTKpIRWiS4UFIrmCqwhIUqDALFk2hT72TS1H7
	 yXKH9Ls1QN7KlNTGjfLLC39wWTT1++90KUdew7ClXvWRDiGHuaNt0xVHMUUClhMVV0
	 Haal/0UkyzXTsq/EgTNBdX6+ahrnZpjSSpYjjH3IQGOC8WR2pT/WOy8WUGrpCF8iWQ
	 knKb063YWkLI4Vs7MQDNEEB1CnoGnAQ7cI8MzQd9LgG7iYa876X0ejJ7zxifDD2XWh
	 wgknfDRo5xi1g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1763383921; x=1763644421; i=ngoc-tu.dinh@vates.tech;
	bh=X5J4SmdOpcJRlUXgTjkKoixE54d/UIp1WZ9mHgJLB1w=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=tJUIJAksudsNggTIS2C48JbN8B6VVa7xk3qkjeFXKA2HHfo1IR93g3PpFM2k7bdID
	 qOFUKOQS0qIoQGKkuxkAiidUdER4cGqcvomy8n35ermbAi6sLfp+NL/10oM0Hp39cV
	 uFZrDYi+LTKuYCw1kURkFUlP0aSQPsUiXnOk09HXn1ObfJwOGx1NOnSUzZ7JJYoilL
	 pQeuyzxJgCpDtTSRfqTN8KEP0IExYZATfy2p/uvgWkWW/q7PldQmOWHL/yaQsjyp1z
	 4hk8kORunbZKZAv5Dd3zgdJZFYj+nimll8Bd067YCTGqbgWXFQvfICoZ3DSUQkqaTE
	 zVHjWA7LI1gBg==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[xenvif=20PATCH=201/3]=20Refactor=20msbuild.ps1?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1763383920684
Message-Id: <1ab0b3e6-9bc4-4ef0-8380-8b06f427d9bb@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251117083629.1498-1-owen.smith@citrix.com>
In-Reply-To: <20251117083629.1498-1-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.92d73c7f8019459497d970c5cfbcaeac?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251117:md
Date: Mon, 17 Nov 2025 12:52:01 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 17/11/2025 09:36, Owen Smith wrote:
> Moves all repo specific data to a 'Globals' section, and simplifies the
> structure so that it can be common across all drivers.
> 
> Also seperates DVL log generation from SDV build, so that DVL logs
> can be created for CodeQL builds without SDV.
> 
> Signed-off-by: Owen Smith <owen.smith@citrix.com>

All 3 patches:

Reviewed-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

> ---
>   msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
>   1 file changed, 43 insertions(+), 20 deletions(-)
> 
> diff --git a/msbuild.ps1 b/msbuild.ps1
> index 46dc8cb..4149225 100644
> --- a/msbuild.ps1
> +++ b/msbuild.ps1
> @@ -12,6 +12,16 @@ param(
>   	[switch]$CodeAnalysis
>   )
>   
> +#
> +# Globals
> +#
> +$SolutionName = "xenvif.sln"
> +$ArchivePath = "xenvif"
> +$ProjectList = @( "xenvif" )
> +
> +#
> +# Functions
> +#
>   Function Run-MSBuild {
>   	param(
>   		[string]$SolutionPath,
> @@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
> +
> +	Set-Location $basepath
> +}
> +
> +Function Run-MSBuildDVL {
> +	param(
> +		[string]$SolutionPath,
> +		[string]$Name,
> +		[string]$Configuration,
> +		[string]$Platform
> +	)
> +
> +	$basepath = Get-Location
> +	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
> +	Set-Location $projpath
> +
> +	$project = [string]::Format("{0}.vcxproj", $Name)
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
>   	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
>   
> @@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase Release"; "checked" = "$Configu
>   $platform = @{ "x86" = "Win32"; "x64" = "x64" }
>   $solutionpath = Resolve-Path $SolutionDir
>   
> -$archivepath = "xenvif"
> -$projectlist = @( "xenvif" )
> -
>   Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
>   
> -if ($Type -eq "free") {
> -	Run-MSBuild $solutionpath "xenvif.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +if (-Not (Test-Path -Path $archivepath)) {
> +	New-Item -Name $archivepath -ItemType Directory | Out-Null
>   }
> -elseif ($Type -eq "checked") {
> -	Run-MSBuild $solutionpath "xenvif.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +
> +if (($Type -eq "free") -or ($Type -eq "checked")) {
> +	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
>   }
> -elseif ($Type -eq "codeql") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> +if ($Type -eq "codeql") {
>   	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
>   		$searchpath = Resolve-Path ".."
>   	} else {
> @@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
>   	}
>   	New-Item -ItemType Directory "database" | Out-Null
>   
> -	$projectlist | ForEach {
> -		Run-CodeQL $solutionpath $_ $configuration["codeql"] $platform[$Arch] $searchpath
> +	ForEach ($project in $ProjectList) {
> +		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
>   	}
> -
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
>   }
> -elseif ($Type -eq "sdv") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> -	$projectlist | ForEach {
> -		Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] $platform[$Arch]
> +if ($Type -eq "sdv") {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
>   	}
> +}
>   
> +if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
> +	}
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
>   }



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 17 13:01:34 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 17 Nov 2025 13:01:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1163829.1490887 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKyrN-0006or-DD; Mon, 17 Nov 2025 13:01:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1163829.1490887; Mon, 17 Nov 2025 13:01:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vKyrN-0006ok-Ak; Mon, 17 Nov 2025 13:01:33 +0000
Received: by outflank-mailman (input) for mailman id 1163829;
 Mon, 17 Nov 2025 13:01:31 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0G7v=5Z=bounce.vates.tech=bounce-md_30504962.691b1a7e.v1-58cc638db94243e89c726b87063dfa2c@srs-se1.protection.inumbo.net>)
 id 1vKyiP-0001xJ-Ih
 for win-pv-devel@lists.xenproject.org; Mon, 17 Nov 2025 12:52:17 +0000
Received: from mail128-17.atl41.mandrillapp.com
 (mail128-17.atl41.mandrillapp.com [198.2.128.17])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3dfe1e1c-c3b4-11f0-980a-7dc792cee155;
 Mon, 17 Nov 2025 13:52:15 +0100 (CET)
Received: from pmta08.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail128-17.atl41.mandrillapp.com (Mailchimp) with ESMTP id
 4d971V5cbNzCf9KR0
 for <win-pv-devel@lists.xenproject.org>; Mon, 17 Nov 2025 12:52:14 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 58cc638db94243e89c726b87063dfa2c; Mon, 17 Nov 2025 12:52:14 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3dfe1e1c-c3b4-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1763383934; x=1763653934;
	bh=3M9M7IcQoV0JdwHmPaEH4+PQ0WR22UO5UZyLPYRSv74=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=yebgb7N/Gz7eFPLn+cMCstwPaabjpizjAlKHfIaFsU+qaZMxtuVTbmR9w/9Bdx9Z3
	 6qWmG44YfcDSoXPO7xelqDb2OIfa5Z3y9Uq7syW5eyQ2JCCXV3jkOj1x94+iqJwT+g
	 o4scVDjudZGrO2qyzR5pZ15UuTHfCWR/BPbL5CNfZcpe872BTTVlkEqxbm22vYnry/
	 Rgp9wWu5/9HcTiz66ZHFkcmAW7/VdYe4+X2iuK3yS0HVnjD2jkp7hmgMKGBF7CX6P9
	 ViLoWczJfSsr2EBBIAp63RgN9IT7+Q+Bg67pxEQSazp/0KfR0sh6o8MvtU2AR/7y7/
	 u1FjZ8dYWawrQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1763383934; x=1763644434; i=ngoc-tu.dinh@vates.tech;
	bh=3M9M7IcQoV0JdwHmPaEH4+PQ0WR22UO5UZyLPYRSv74=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=mJXQPrd5nG6yIdtiMIymgTia5uMsY8tkDh++wMq+sCwYcIz73gC4FV6Qni6u4mDlt
	 a/FuFf6TEwhKsDtLQ6C7+PW0zRun8aUlCw0jv0M8yRTl+f1jfiUwDSFJIDaS4dY+XW
	 Hi75mssvIQzDCsNVXNC8qHUvUjxDn2eU3NGSMo6nh6GJTq5cZf3aaOIfJxSko0fjc4
	 nipAA4KIFDnTJpU0UBEAgy2mrf4zSQusACKn00O+kz8cgdAjjtbBTKDYCcRGVmzcM0
	 Sxsz5kkkPvYJwkY1jAM0g8a3crNRuaTIEnTM1C0MNuPMWQ1qErC9yWxscRTNsPqbxp
	 38/jPVFEYWd9w==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[xennet=20PATCH=201/3]=20Refactor=20msbuild.ps1?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1763383934067
Message-Id: <cb585a10-0bde-4856-806d-20f104a4b029@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251117082332.1088-1-owen.smith@citrix.com>
In-Reply-To: <20251117082332.1088-1-owen.smith@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.58cc638db94243e89c726b87063dfa2c?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251117:md
Date: Mon, 17 Nov 2025 12:52:14 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 17/11/2025 09:23, Owen Smith wrote:
> Moves all repo specific data to a 'Globals' section, and simplifies the
> structure so that it can be common across all drivers.
> 
> Also seperates DVL log generation from SDV build, so that DVL logs
> can be created for CodeQL builds without SDV.
> 
> Signed-off-by: Owen Smith <owen.smith@citrix.com>

All 3 patches:

Reviewed-by: Tu Dinh <ngoc-tu.dinh@vates.tech>

> ---
>   msbuild.ps1 | 63 ++++++++++++++++++++++++++++++++++++-----------------
>   1 file changed, 43 insertions(+), 20 deletions(-)
> 
> diff --git a/msbuild.ps1 b/msbuild.ps1
> index 9df9495..59bb98a 100644
> --- a/msbuild.ps1
> +++ b/msbuild.ps1
> @@ -12,6 +12,16 @@ param(
>   	[switch]$CodeAnalysis
>   )
>   
> +#
> +# Globals
> +#
> +$SolutionName = "xennet.sln"
> +$ArchivePath = "xennet"
> +$ProjectList = @( "xennet" )
> +
> +#
> +# Functions
> +#
>   Function Run-MSBuild {
>   	param(
>   		[string]$SolutionPath,
> @@ -63,6 +73,23 @@ Function Run-MSBuildSDV {
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/clean"
>   	Run-MSBuild $projpath $project $Configuration $Platform "sdv" "/check:default.sdv /debug"
> +
> +	Set-Location $basepath
> +}
> +
> +Function Run-MSBuildDVL {
> +	param(
> +		[string]$SolutionPath,
> +		[string]$Name,
> +		[string]$Configuration,
> +		[string]$Platform
> +	)
> +
> +	$basepath = Get-Location
> +	$projpath = Join-Path -Path $SolutionPath -ChildPath $Name
> +	Set-Location $projpath
> +
> +	$project = [string]::Format("{0}.vcxproj", $Name)
>   	Run-MSBuild $projpath $project $Configuration $Platform "Build" -CodeAnalysis
>   	Run-MSBuild $projpath $project $Configuration $Platform "dvl"
>   
> @@ -149,22 +176,17 @@ $configuration = @{ "free" = "$ConfigurationBase Release"; "checked" = "$Configu
>   $platform = @{ "x86" = "Win32"; "x64" = "x64" }
>   $solutionpath = Resolve-Path $SolutionDir
>   
> -$archivepath = "xennet"
> -$projectlist = @( "xennet" )
> -
>   Set-ExecutionPolicy -Scope CurrentUser -Force Bypass
>   
> -if ($Type -eq "free") {
> -	Run-MSBuild $solutionpath "xennet.sln" $configuration["free"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +if (-Not (Test-Path -Path $archivepath)) {
> +	New-Item -Name $archivepath -ItemType Directory | Out-Null
>   }
> -elseif ($Type -eq "checked") {
> -	Run-MSBuild $solutionpath "xennet.sln" $configuration["checked"] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
> +
> +if (($Type -eq "free") -or ($Type -eq "checked")) {
> +	Run-MSBuild $solutionpath $SolutionName $configuration[$Type] $platform[$Arch] -CodeAnalysis:$CodeAnalysis
>   }
> -elseif ($Type -eq "codeql") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> +if ($Type -eq "codeql") {
>   	if ([string]::IsNullOrEmpty($Env:CODEQL_QUERY_SUITE)) {
>   		$searchpath = Resolve-Path ".."
>   	} else {
> @@ -176,20 +198,21 @@ elseif ($Type -eq "codeql") {
>   	}
>   	New-Item -ItemType Directory "database" | Out-Null
>   
> -	$projectlist | ForEach {
> -		Run-CodeQL $solutionpath $_ $configuration["codeql"] $platform[$Arch] $searchpath
> +	ForEach ($project in $ProjectList) {
> +		Run-CodeQL $solutionpath $project $configuration["codeql"] $platform[$Arch] $searchpath
>   	}
> -
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*.sarif") -Destination $archivepath
>   }
> -elseif ($Type -eq "sdv") {
> -	if (-Not (Test-Path -Path $archivepath)) {
> -		New-Item -Name $archivepath -ItemType Directory | Out-Null
> -	}
>   
> -	$projectlist | ForEach {
> -		Run-MSBuildSDV $solutionpath $_ $configuration["sdv"] $platform[$Arch]
> +if ($Type -eq "sdv") {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildSDV $solutionpath $project $configuration["sdv"] $platform[$Arch]
>   	}
> +}
>   
> +if (($Type -eq "codeql") -or ($Type -eq "sdv")) {
> +	ForEach ($project in $ProjectList) {
> +		Run-MSBuildDVL $solutionpath $project $configuration["sdv"] $platform[$Arch]
> +	}
>   	Copy-Item -Path (Join-Path -Path $SolutionPath -ChildPath "*DVL*") -Destination $archivepath
>   }



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 24 13:50:43 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 24 Nov 2025 13:50:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1171099.1496112 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNWxk-00030G-JQ; Mon, 24 Nov 2025 13:50:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1171099.1496112; Mon, 24 Nov 2025 13:50:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNWxk-000309-H1; Mon, 24 Nov 2025 13:50:40 +0000
Received: by outflank-mailman (input) for mailman id 1171099;
 Mon, 24 Nov 2025 13:50:39 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=b2Fg=6A=bounce.vates.tech=bounce-md_30504962.692462ab.v1-d748a36428ec465fa98804be2763c9a6@srs-se1.protection.inumbo.net>)
 id 1vNWxj-000303-Gr
 for win-pv-devel@lists.xenproject.org; Mon, 24 Nov 2025 13:50:39 +0000
Received: from mail136-9.atl41.mandrillapp.com
 (mail136-9.atl41.mandrillapp.com [198.2.136.9])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8d7f665f-c93c-11f0-980a-7dc792cee155;
 Mon, 24 Nov 2025 14:50:37 +0100 (CET)
Received: from pmta11.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail136-9.atl41.mandrillapp.com (Mailchimp) with ESMTP id 4dFRzb195szHXYVyQ
 for <win-pv-devel@lists.xenproject.org>; Mon, 24 Nov 2025 13:50:35 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 d748a36428ec465fa98804be2763c9a6; Mon, 24 Nov 2025 13:50:35 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8d7f665f-c93c-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1763992235; x=1764262235;
	bh=smAPntFPNGkc/do2FxuIL63rsnbDWxXLJBPDteRG1eE=;
	h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From;
	b=vTryrZbiEU9+LJq5JE8W3eahX4W5HaTJTEe7gQ6/yc5Yuv4vAXNSoJqQLtCLSm+W2
	 QmlFo7XyJhmX68V2YyBGHvqJOw/IcESmiL68srEt8Y80BKbSygVqyKRsRj6ZfpfUE0
	 PeQ2UZ01KC2lxoXJ3+upIkY3xUwh79Mi5Tnqnq/9/zt9o4WgeKvOyy/IDfIO5N3Hqm
	 LL/7hDATRc+ESQwQLkdOU3S1jdwWFxLm+baH2R2OWxW40MaK47jgn3FLosbbYg2T1D
	 erlowpXSR+IaUhoZn4os/guqAOK8jK2AyH1WCqQ664gEi0BQpoIQ6ATcDFMcQEwBDT
	 Y9/8pvvSrGLOA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1763992235; x=1764252735; i=ngoc-tu.dinh@vates.tech;
	bh=smAPntFPNGkc/do2FxuIL63rsnbDWxXLJBPDteRG1eE=;
	h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From;
	b=DfLJ+Tt5Cg2d1cDk6TrPlTQXrQh0zT1YQS6xGhFetd6g1cA/VMt8n8vviYScrKyEy
	 AJN/+8IkjQ+rrIM1Xj+5qndu9Vy1WS3vnUS8JCUYt/gX38FrrBAK9RGu+PhfhlKjrY
	 7Rs9fcQOEr8Cf2vMTJKuXFTFFZxs9j1hCpsP4FMGf856ELLs/54IX2ook0sEIQ64yP
	 lr8/BMb6LCwtWGTH1CfFX2xAdHrfPAg2c4AcJj3eelIovRC0sMX8+zoQmrSUUcRNWh
	 kkGaFNsVyx3EPRUTtDcsJTNwiTOcQVKMaU+dXADfoUgU7Ox8Tojy46keHPU5+QElI9
	 Y0mDGFX73jLwg==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?[PATCH]=20Use=20BootFlags=20directive=20on=20build=2025398=20and=20later?=
X-Mailer: git-send-email 2.51.2.windows.1
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1763992234161
To: win-pv-devel@lists.xenproject.org
Cc: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Message-Id: <20251124135009.1003-1-ngoc-tu.dinh@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.d748a36428ec465fa98804be2763c9a6?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251124:md
Date: Mon, 24 Nov 2025 13:50:35 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Setting BootFlags in an AddReg section is no longer allowed by INFVerif.

This requires duplication of some INF sections upstream from
XenCons_Service.

Link: https://techcommunity.microsoft.com/blog/hardware-dev-center/driver-isolation-ruleset-changes-for-whcp-and-attestation-submissions/4461580
Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xencons.inf | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/src/xencons.inf b/src/xencons.inf
index bae7624..4e8d274 100644
--- a/src/xencons.inf
+++ b/src/xencons.inf
@@ -62,7 +62,7 @@ xencons_monitor_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.d
 xencons_tty_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.exe,xencons_tty.exe
 
 [Manufacturer]
-%Vendor%=Inst,NT@INF_ARCH@
+%Vendor%=Inst,NT@INF_ARCH@,NT@INF_ARCH@.10.0...25398
 
 [Inst.NT@INF_ARCH@]
 %XenConsName%=XenCons_Inst,\
@@ -70,6 +70,12 @@ XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_CONS&REV_0900000A,\
 XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_CONS&REV_0900000A,\
 XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_CONS&REV_0900000A
 
+[Inst.NT@INF_ARCH@.10.0...25398]
+%XenConsName%=XenCons_Inst_25H2,\
+XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_CONS&REV_0900000A,\
+XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_CONS&REV_0900000A,\
+XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_CONS&REV_0900000A
+
 [XenCons_Inst]
 CopyFiles=XenCons_Copyfiles
 CopyFiles=Monitor_Copyfiles
@@ -77,6 +83,13 @@ CopyFiles=Tty_Copyfiles
 ; TODO: Remove during next PDO version bump
 FeatureScore=0xFE
 
+[XenCons_Inst_25H2]
+CopyFiles=XenCons_Copyfiles
+CopyFiles=Monitor_Copyfiles
+CopyFiles=Tty_Copyfiles
+; TODO: Remove during next PDO version bump
+FeatureScore=0xFE
+
 [XenCons_Copyfiles]
 xencons.sys
 
@@ -84,6 +97,10 @@ xencons.sys
 AddService=xencons_monitor,%SPSVCSINST_STARTSERVICE%,Monitor_Service,Monitor_EventLog
 AddService=xencons,%SPSVCINST_ASSOCSERVICE%,XenCons_Service
 
+[XenCons_Inst_25H2.Services]
+AddService=xencons_monitor,%SPSVCSINST_STARTSERVICE%,Monitor_Service,Monitor_EventLog
+AddService=xencons,%SPSVCINST_ASSOCSERVICE%,XenCons_Service_25H2
+
 [XenCons_Service]
 DisplayName=%XenConsName%
 ServiceType=%SERVICE_KERNEL_DRIVER%
@@ -93,6 +110,16 @@ ServiceBinary=%12%\xencons.sys
 LoadOrderGroup="Extended Base"
 AddReg = XenCons_BootFlags, XenCons_Parameters
 
+[XenCons_Service_25H2]
+DisplayName=%XenConsName%
+ServiceType=%SERVICE_KERNEL_DRIVER%
+StartType=%SERVICE_DEMAND_START%
+ErrorControl=%SERVICE_ERROR_NORMAL%
+ServiceBinary=%12%\xencons.sys
+LoadOrderGroup="Extended Base"
+AddReg = XenCons_Parameters
+BootFlags = 0x81
+
 [XenCons_BootFlags]
 HKR,,"BootFlags",0x00010003,0x81
 
-- 
2.51.2.windows.1



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 24 13:51:10 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 24 Nov 2025 13:51:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1171100.1496117 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNWyE-00033G-MG; Mon, 24 Nov 2025 13:51:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1171100.1496117; Mon, 24 Nov 2025 13:51:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNWyE-000338-JF; Mon, 24 Nov 2025 13:51:10 +0000
Received: by outflank-mailman (input) for mailman id 1171100;
 Mon, 24 Nov 2025 13:51:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=MPek=6A=bounce.vates.tech=bounce-md_30504962.692462c7.v1-5055c928fb7346148cd327479d658fca@srs-se1.protection.inumbo.net>)
 id 1vNWyC-000332-JL
 for win-pv-devel@lists.xenproject.org; Mon, 24 Nov 2025 13:51:08 +0000
Received: from mail8.wdc04.mandrillapp.com (mail8.wdc04.mandrillapp.com
 [205.201.139.8]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9ecf6a5a-c93c-11f0-9d18-b5c5bf9af7f9;
 Mon, 24 Nov 2025 14:51:07 +0100 (CET)
Received: from pmta16.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail8.wdc04.mandrillapp.com (Mailchimp) with ESMTP id 4dFS072RFjz3sN9sR
 for <win-pv-devel@lists.xenproject.org>; Mon, 24 Nov 2025 13:51:03 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 5055c928fb7346148cd327479d658fca; Mon, 24 Nov 2025 13:51:03 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9ecf6a5a-c93c-11f0-9d18-b5c5bf9af7f9
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1763992263; x=1764262263;
	bh=DB8sXq/CrxHTPzPSFOhsdN1TgnttMSV6RIPkQuhFtGk=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=qS/cq3+4RgB2ersEZ3k91tMFYJG+4/G3iu+WibFXasQpj1ggpxFr/ohUMgeGiIiF7
	 TEfb5fXR7aMZzbxtDpiDHat88xq/PmtjFyRBf2xcKd4EYD0g2+VD5cyWOtdUKK4tv/
	 nVXjN9E6D5h0dYuAuM47k1f/P9Roua0Vl9QdwtybHI9xrv/G4GJLLUP9tgAjnrRfsV
	 FuLpdb74R10HnOzJBjsf6oFBrS6vA82HeazUjsYuk+n8lIR/UUumkaEFLL5AMpHni6
	 rD/7J8mZrx9mymTO+4SknR+jOI4Z7Jw3v7SwT4nRuik6yJjc0riQw3nIRBjrrX+EIq
	 7rBz9AYom2omg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1763992263; x=1764252763; i=ngoc-tu.dinh@vates.tech;
	bh=DB8sXq/CrxHTPzPSFOhsdN1TgnttMSV6RIPkQuhFtGk=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=nEbomN/tatsdoSGRB4tv2O236MjxN0AJPOVvIU5O7u0MJA7399akxnIuSDui8fqfi
	 ntYI2ZwPYtbnjcQffJR1OrgQUqxhVPjCCX7CDPJYXAlM78DB5bnobrK7jRyWJ4XL2g
	 Il5LMnDnO2MEaCR76gUxIFAZvntdm9VyiYHox2ZeP53ryy6kPHP5DbgHrOcjn2bUes
	 vXAN7ZSWwQkjPPaErPbsDgjJLWmnFq/zbbCfCajZz2SmjlDihQnBlpzoOirJ/A2brz
	 p1snRr6pV4WV7kp5A2XQrk1KeUSv0+YLpPU5KueRPqQkQwKXMVkn1/cw2JTRQzBgAt
	 7vICuCRMUEMdg==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?[PATCH]=20Use=20BootFlags=20directive=20on=20build=2025398=20and=20later?=
X-Mailer: git-send-email 2.51.2.windows.1
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1763992262680
To: win-pv-devel@lists.xenproject.org
Cc: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Message-Id: <20251124135057.705-1-ngoc-tu.dinh@vates.tech>
In-Reply-To: <20251124135009.1003-1-ngoc-tu.dinh@vates.tech>
References: <20251124135009.1003-1-ngoc-tu.dinh@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.5055c928fb7346148cd327479d658fca?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251124:md
Date: Mon, 24 Nov 2025 13:51:03 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Setting BootFlags in an AddReg section is no longer allowed by INFVerif.

This requires duplication of some INF sections upstream from
XenVif_Service.

Link: https://techcommunity.microsoft.com/blog/hardware-dev-center/driver-isolation-ruleset-changes-for-whcp-and-attestation-submissions/4461580
Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xenvif.inf | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/src/xenvif.inf b/src/xenvif.inf
index a5abe4e..304bf13 100644
--- a/src/xenvif.inf
+++ b/src/xenvif.inf
@@ -50,7 +50,7 @@ DefaultDestDir=12
 xenvif.sys=0,,
 
 [Manufacturer] 
-%Vendor%=Inst,NT@INF_ARCH@
+%Vendor%=Inst,NT@INF_ARCH@,NT@INF_ARCH@.10.0...25398
 
 [Inst.NT@INF_ARCH@]
 %XenVifName%=XenVif_Inst,\
@@ -58,17 +58,31 @@ XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_VIF&REV_0900000B,\
 XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_VIF&REV_0900000B,\
 XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_VIF&REV_0900000B
 
+[Inst.NT@INF_ARCH@.10.0...25398]
+%XenVifName%=XenVif_Inst_25H2,\
+XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_VIF&REV_0900000B,\
+XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_VIF&REV_0900000B,\
+XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_VIF&REV_0900000B
+
 [XenVif_Inst] 
 CopyFiles=XenVif_Copyfiles
 ; TODO: Remove during next PDO version bump
 FeatureScore=0xFE
 
+[XenVif_Inst_25H2]
+CopyFiles=XenVif_Copyfiles
+; TODO: Remove during next PDO version bump
+FeatureScore=0xFE
+
 [XenVif_Copyfiles]
 xenvif.sys
 
 [XenVif_Inst.Services] 
 AddService=xenvif,0x02,XenVif_Service,
 
+[XenVif_Inst_25H2.Services]
+AddService=xenvif,0x02,XenVif_Service_25H2,
+
 [XenVif_Service]
 DisplayName=%XenVifName%
 ServiceType=%SERVICE_KERNEL_DRIVER% 
@@ -78,6 +92,16 @@ ServiceBinary=%12%\xenvif.sys
 LoadOrderGroup="NDIS"
 AddReg = XenVif_BootFlags, XenVif_Parameters, XenVif_Unplug
 
+[XenVif_Service_25H2]
+DisplayName=%XenVifName%
+ServiceType=%SERVICE_KERNEL_DRIVER%
+StartType=%SERVICE_DEMAND_START%
+ErrorControl=%SERVICE_ERROR_NORMAL%
+ServiceBinary=%12%\xenvif.sys
+LoadOrderGroup="NDIS"
+AddReg = XenVif_Parameters, XenVif_Unplug
+BootFlags = 0x81
+
 [XenVif_BootFlags]
 HKR,,"BootFlags",0x00010003,0x81
 
-- 
2.51.2.windows.1



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Mon Nov 24 13:51:20 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Mon, 24 Nov 2025 13:51:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1171101.1496120 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNWyO-00035r-NL; Mon, 24 Nov 2025 13:51:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1171101.1496120; Mon, 24 Nov 2025 13:51:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNWyO-00035k-Kp; Mon, 24 Nov 2025 13:51:20 +0000
Received: by outflank-mailman (input) for mailman id 1171101;
 Mon, 24 Nov 2025 13:51:19 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=qpjk=6A=bounce.vates.tech=bounce-md_30504962.692462d2.v1-e1387442ad0d457c9175d79fbf17358d@srs-se1.protection.inumbo.net>)
 id 1vNWyN-00035M-0i
 for win-pv-devel@lists.xenproject.org; Mon, 24 Nov 2025 13:51:19 +0000
Received: from mail8.wdc04.mandrillapp.com (mail8.wdc04.mandrillapp.com
 [205.201.139.8]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a52d9965-c93c-11f0-980a-7dc792cee155;
 Mon, 24 Nov 2025 14:51:16 +0100 (CET)
Received: from pmta16.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail8.wdc04.mandrillapp.com (Mailchimp) with ESMTP id 4dFS0L6wfdz3sN7WZ
 for <win-pv-devel@lists.xenproject.org>; Mon, 24 Nov 2025 13:51:14 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 e1387442ad0d457c9175d79fbf17358d; Mon, 24 Nov 2025 13:51:14 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a52d9965-c93c-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1763992275; x=1764262275;
	bh=uHs53lsv5FAP+i26k6Uf4FrOsjrOqaa17ku60cW4kJ8=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=c0H35GZdpaahs+6BuSswxHLC3jazkdoPJRBiXSPfBE/TJbs1quolUGaaIt0h9BU9F
	 B4NYHbMpd3zwXGheAUcjlmiB1FV1K5dWrT7cjapieLRDK5O+cJ9zc27PoHcHGXZgMe
	 uY0jUIq7WhWM+6+jsqQRS3F3/LaZN3B15LaDhmX+HzM9k/vXAs+KJXhc6WsNfoWk63
	 dTJANwsvPl80cRFTE/4pBJVVX9j1Lzbmz/iql1nfNLccjXQTDVJtWEFobEGRNviqBP
	 c4Hz4WhNiR3nM3Z3ZPyeNydR9cPfWDYUIw7rHw7MeFzFT9Kk7WXrBsJoUm+tKpMX7p
	 LnT3IzZcQ0WjQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1763992275; x=1764252775; i=ngoc-tu.dinh@vates.tech;
	bh=uHs53lsv5FAP+i26k6Uf4FrOsjrOqaa17ku60cW4kJ8=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=W/UidfkTJv/S8xvesb2bTiS4PI+QFLJGzwQIbfUFupSjdbIPGZiad17YT+xCdSmKS
	 auTE508DCDDvQIVwwmB1ZSOYmIrgVRgU4Xsk73543zEuNfwMdksw0NqJIiTiR2yUPO
	 OtRAnl4Wk7MkdXk+bkgPU6V1de8CWFrn0c34kVBpq12v/CNEqIn5kHON1kE9/39UUz
	 RMwRodl56EQlGHVaUr5r5DZUyB1zKrj+v3NPUU245cSIYpNtK1s3l6gueZOLTiEMsG
	 0s0uKanAIu0qbx4cyDL6WohCd7Dva2akLDmLc0oitt8weqK3Ggd7NarE6eWepI4AOd
	 oFCGCwPdOXjAw==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?[PATCH]=20Use=20BootFlags=20directive=20on=20build=2025398=20and=20later?=
X-Mailer: git-send-email 2.51.2.windows.1
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1763992274334
To: win-pv-devel@lists.xenproject.org
Cc: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Message-Id: <20251124135112.1248-1-ngoc-tu.dinh@vates.tech>
In-Reply-To: <20251124135009.1003-1-ngoc-tu.dinh@vates.tech>
References: <20251124135009.1003-1-ngoc-tu.dinh@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.e1387442ad0d457c9175d79fbf17358d?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251124:md
Date: Mon, 24 Nov 2025 13:51:14 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Setting BootFlags in an AddReg section is no longer allowed by INFVerif.

This requires duplication of some INF sections upstream from
XenNet_Service.

Link: https://techcommunity.microsoft.com/blog/hardware-dev-center/driver-isolation-ruleset-changes-for-whcp-and-attestation-submissions/4461580
Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xennet.inf | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/src/xennet.inf b/src/xennet.inf
index 1f6f182..55e11a2 100644
--- a/src/xennet.inf
+++ b/src/xennet.inf
@@ -52,7 +52,7 @@ xennet.sys=0,,
 xennet.sys
 
 [Manufacturer] 
-%Vendor%=Inst,NT@INF_ARCH@
+%Vendor%=Inst,NT@INF_ARCH@,NT@INF_ARCH@.10.0...25398
 
 [Inst.NT@INF_ARCH@]
 %XenNetName%=XenNet_Inst,\
@@ -60,6 +60,12 @@ XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_09000005,\
 XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_09000005,\
 XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_09000005
 
+[Inst.NT@INF_ARCH@.10.0...25398]
+%XenNetName%=XenNet_Inst_25H2,\
+XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_09000005,\
+XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_09000005,\
+XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_09000005
+
 [XenNet_Inst] 
 Characteristics=0x84
 BusType=1
@@ -71,6 +77,17 @@ AddReg=Xennet_Inst_AddReg
 ; TODO: Remove during next PDO version bump
 FeatureScore=0xFE
 
+[XenNet_Inst_25H2]
+Characteristics=0x84
+BusType=1
+*IfType=6             	; IF_TYPE_ETHERNET_CSMACD
+*MediaType=0          	; NdisMedium802_3
+*PhysicalMediaType=14	; NdisPhysicalMedium802_3
+CopyFiles=XenNet_Copyfiles
+AddReg=Xennet_Inst_AddReg
+; TODO: Remove during next PDO version bump
+FeatureScore=0xFE
+
 [XenNet_Inst_AddReg] 
 HKR, Ndi, Service, 0, "xennet"
 HKR, Ndi\Interfaces, UpperRange, 0, "ndis5"
@@ -172,6 +189,9 @@ HKR, Ndi\params\*NumRSSQueues,                    Max,        0, "8"
 [XenNet_Inst.Services] 
 AddService=xennet,0x02,XenNet_Service,XenNet_EventLog
 
+[XenNet_Inst_25H2.Services]
+AddService=xennet,0x02,XenNet_Service_25H2,XenNet_EventLog
+
 [XenNet_Service] 
 DisplayName=%XenNetName%
 ServiceType=%SERVICE_KERNEL_DRIVER% 
@@ -181,6 +201,16 @@ ServiceBinary=%12%\xennet.sys
 LoadOrderGroup="NDIS"
 AddReg = XenNet_BootFlags,XenNet_Unplug
 
+[XenNet_Service_25H2]
+DisplayName=%XenNetName%
+ServiceType=%SERVICE_KERNEL_DRIVER%
+StartType=%SERVICE_DEMAND_START%
+ErrorControl=%SERVICE_ERROR_NORMAL%
+ServiceBinary=%12%\xennet.sys
+LoadOrderGroup="NDIS"
+AddReg = XenNet_Unplug
+BootFlags = 0x81
+
 [XenNet_BootFlags]
 HKR,,"BootFlags",0x00010003,0x81
 
-- 
2.51.2.windows.1



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Tue Nov 25 14:31:48 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 25 Nov 2025 14:31:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1171947.1497017 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNu54-0004Ea-HO; Tue, 25 Nov 2025 14:31:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1171947.1497017; Tue, 25 Nov 2025 14:31:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNu54-0004ES-EV; Tue, 25 Nov 2025 14:31:46 +0000
Received: by outflank-mailman (input) for mailman id 1171947;
 Tue, 25 Nov 2025 14:31:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=9DV6=6B=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vNu52-0004EM-Ry
 for win-pv-devel@lists.xenproject.org; Tue, 25 Nov 2025 14:31:44 +0000
Received: from SN4PR0501CU005.outbound.protection.outlook.com
 (mail-southcentralusazlp170110003.outbound.protection.outlook.com
 [2a01:111:f403:c10d::3])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 75fc769d-ca0b-11f0-9d18-b5c5bf9af7f9;
 Tue, 25 Nov 2025 15:31:43 +0100 (CET)
Received: from SA6PR03MB7760.namprd03.prod.outlook.com (2603:10b6:806:43c::5)
 by BN9PR03MB6203.namprd03.prod.outlook.com (2603:10b6:408:100::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9366.12; Tue, 25 Nov
 2025 14:31:40 +0000
Received: from SA6PR03MB7760.namprd03.prod.outlook.com
 ([fe80::e1c0:3b82:280a:80b2]) by SA6PR03MB7760.namprd03.prod.outlook.com
 ([fe80::e1c0:3b82:280a:80b2%7]) with mapi id 15.20.9366.009; Tue, 25 Nov 2025
 14:31:40 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 75fc769d-ca0b-11f0-9d18-b5c5bf9af7f9
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=nEyRw9xw7mmu2bGwefvQOoiQtGXnBUps1jbdRgYTC1aDRkw8YO/15OZ3/EjpaqnwxYDrEHq81/DYMX5y97GD66nf0wCHenNZ2EUm/HNASBq1G41AQkI+G/yJn91uu3lB7jWcpgnQvK7HBKHhst5ryagiFJGgKPCCbsA1Jxwq5+sS3bGkTENb1GzHjfgaU0KZ9xVjyskCU6QGObh85s3TJo2MryyTHolJpiiuwglfru+P/vwBqrssVwHOBzfZHUYVtczqWfk59yUWPJ9+DlR3uibA78EoJoTPKh85NGGCEzfz9v07ihMooF+8DOBRcPGkOJbCKhMHn5g6JF8xA/i+nQ==
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=QYmNUnPPTDoHkn9qOpoYB4cAJh6R0pLlib+LVae4Zow=;
 b=wxIF5dzNGpzhSbIDM4AYEPVkB0ni+8oyTr0gN2Cj5/qRMVVuh4hMam2ptFjlM22neQ0IU03bRAogKdO3gzGrp42KCtFubZKVe+UOif5hbUb1IfqarKncDq3hVHZMJp70CN5jXJOcbRCbDF7fY+2tZ71bhRrm+3NZl/6kyUqvbD1Z08B5LfxbYkKmjc39hDql/BHderhLkuEWJe6kL1Zgi0R3sbvMHcGQFdPZOn2fnk4Rxt4Z7CXSwQSY6GIlKQimy0wFwY7pBRlWZEb0tg743sy+D6w6dVG7DeoGAzPwPoB4jCA/TMVeaqkkeKnQviQb/RF4DeB7pLEgvxDKFXYwpA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QYmNUnPPTDoHkn9qOpoYB4cAJh6R0pLlib+LVae4Zow=;
 b=Hh+ZGHyfNTebP1aiTX0ivszN74g/AqDN9py04gbNHX2LZN+hsVDlZR8hIX5m453LPjdWjVWYyoNrUut5+T97cvgE1OMIm7LL059iyIbsACgXtm7sRu85Och9aA2BITgOUsSKISv0J/VfVor0qtIlOUba9mZEou4iWEXHPyAtbyk=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [PATCH] Use BootFlags directive on build 25398 and later
Thread-Topic: [PATCH] Use BootFlags directive on build 25398 and later
Thread-Index: AQHcXUlbmtBnLEWOx0alTS3TmhsKyrUB2DkAgAGdcMQ=
Date: Tue, 25 Nov 2025 14:31:40 +0000
Message-ID:
 <SA6PR03MB7760DBEF7E4245E9750E251EFED1A@SA6PR03MB7760.namprd03.prod.outlook.com>
References: <20251124135009.1003-1-ngoc-tu.dinh@vates.tech>
 <20251124135112.1248-1-ngoc-tu.dinh@vates.tech>
In-Reply-To: <20251124135112.1248-1-ngoc-tu.dinh@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA6PR03MB7760:EE_|BN9PR03MB6203:EE_
x-ms-office365-filtering-correlation-id: 4deec790-6c24-4a3d-988c-08de2c2f58ef
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|366016|376014|1800799024|38070700021;
x-microsoft-antispam-message-info:
 =?us-ascii?Q?Ct1I0ShcYHW9RTgibt6qH0BeEPVLGiCykBjwVMmg98bo0mtRzYBpDkZrDHk6?=
 =?us-ascii?Q?tZLHN3XojCOXJpi0oQD7ixZ9BeBk4gy+IowPzUboAm1izejnBj5O10ZWi1LD?=
 =?us-ascii?Q?d84uuadh/7uA9EPhiL45wZEQo0M08WtgxUhV1axNA/F1Q7EQ1g51dNZa4Nd3?=
 =?us-ascii?Q?ptU+5BlMUkIIJRfB0KLt/gm9Sgw2weHWl1BxeDsu5pdXr8zXF4yJsyJswlsR?=
 =?us-ascii?Q?CqBatt6qrSXFNkxPjhi7Pl7d/oo0ILz2twmnqbs6sO4yrbyFuHdvQ7C+9nAL?=
 =?us-ascii?Q?7F0e0QEKFpO0fg6PUqaTT8QXJZBGhy6AD96xyR1p4TndHcx65KaYTx1VPHAM?=
 =?us-ascii?Q?Cyt3FpVwqWHuO9sO5FnSX9h8ArDUXiXnoQgQZk8TL2IVwImGAhBDhytLVA5a?=
 =?us-ascii?Q?YWvyOdqQLzJPxBv8dU8y+sXa6ibkEroFEbjMnQuthbLmvukjjx4F3MiGXr/P?=
 =?us-ascii?Q?3vfqM8gHsCLh+GSjmXZjxQ9hOBe8qz1slYmsuaKheJcqaLcMcqlI9bMfK8bg?=
 =?us-ascii?Q?uyNjnIDIyuuJGJFiwMeBstnSy8iSKIj61t76vS4lnFzL7JfC+amVfDDhKvE5?=
 =?us-ascii?Q?i6UsrR6qRyovK1GeHm1M1VLMfcfAKJXJgqmyfBjaQ/niQFgDXUudH8b+bdFJ?=
 =?us-ascii?Q?DqQla6khWuY3My1zcPwj+6a9a/lK1mTCCybAqXyHU96U0/ZO/c+0cljJd1Xp?=
 =?us-ascii?Q?WxrlQJiXkayjwzRDI7inkGDCTpwObTH+eMT0dupVOXNV5jAC47nIjIP7HXN9?=
 =?us-ascii?Q?WKX3dZu6BttbkYKjFxJtQjLTBrVWYxpmh4dJZd2KovguaIHY+HOrFUAiZ6g1?=
 =?us-ascii?Q?9Qz163i06VQvqB1v5BJmK6zlgFWF4mf3d3INVKL2YHUpuUIOdC9Ot+67OkQR?=
 =?us-ascii?Q?iyKqxftTkuMtQ5dgxxmALYkzmsYOKzsu7CfBLxmUKmJjy5WrAHH1Utd792ge?=
 =?us-ascii?Q?Nm4LzR4sH0bTRTLlyOyLZNNHCYt0Udak7T94XUpLjn27WEJSNhxtfRCIj2zw?=
 =?us-ascii?Q?bUjWhTVoeoDOs0cVcbcFVxdD/p3nltZMZM5yCgLsSu2gDMafu1noFTspmr7M?=
 =?us-ascii?Q?YVxmUNzULNFDm77ainEGYWuV/JL/DHfhXe/Csi/ZTeH1q+LIhAE0Qk+l6QkA?=
 =?us-ascii?Q?54RCgT7UCiBhRZlUHT/WtZmUxK2VZBe/T1wjv/KHcDUuanyCupE8D/QPPTYx?=
 =?us-ascii?Q?sgF8F3DiSlIriG5QeiOEs6k/Me3gQcPcBLdqb7KwDVJlcWiXwsUrkwcfxojv?=
 =?us-ascii?Q?UsL9yZsGSk1Z9/RsUnhrQV5tbuxR5KswYUfJFfWwCmN8RnMtunfAl33/aGWM?=
 =?us-ascii?Q?bb9Ew6Z4P/+jpyKj8kQAGsfcp3ErWB6oZzmsmF5BQkg3UvyXC60o+DijUMaq?=
 =?us-ascii?Q?ztEnSrC7S9b4jgx1rJtpWCEuAP/gPvUnLvN4DRmpimLMfyVh5+fg1rBbto62?=
 =?us-ascii?Q?u3E10nEUgJ4J5e12HCGEgtfsrgBraz4N?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA6PR03MB7760.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(38070700021);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?3E41ahnvtvri2+Tc6S+kpz51vK53IsT6zSdHqslGSwOe5t5kTg7PWrx9FvSp?=
 =?us-ascii?Q?jhToJPapIhmDKq3GiOcajbV3SU9d5E4RTcQXGHVxvaibJ3sSxdZ43Xksd+7G?=
 =?us-ascii?Q?eOv170FuRMnevxf2hbyvZZ18PCcF59NDk92WdxE6Z0j5PBkBqEFj74WeDqVU?=
 =?us-ascii?Q?PqvAQOfX0g6mlEHDlqR9xAtoROtd6TuWFvCHfBcv7qv0DPuOyKZLI10ifn7S?=
 =?us-ascii?Q?AucjldjE/Qk90paj6Wu6sV1SrkvoCRZSr6pI2mo3kyRw+27zEJeVWzQtwbPo?=
 =?us-ascii?Q?FOT1sKN0tvdmtKD7eLKXdnjwBNmY/H0fbEdgwnO1Fj5MeqouwCHR+IHBcxFw?=
 =?us-ascii?Q?q9FLxYgS4y0hUKFlPH4umAmfqk0Icedn269LkBRvVxyBcGefMwZcsUZQK5J7?=
 =?us-ascii?Q?D9CwIzf8Ftz8UfTqgQ8FJlZQjooL2jRf1nTVV+lPmvT6SrmDHkUQ1E9BmcoV?=
 =?us-ascii?Q?t6U5E3Ca32j8I+UTX1m2COqtzNPSs9RguNXGmbe16vICKfNBjVjAhy/OEsMT?=
 =?us-ascii?Q?LPtKJGjTFfZednW4mGQhsGMleSMzHdDg6w3c/C+Pvi59E8bqQ5jEiJbprgxh?=
 =?us-ascii?Q?LTKMLcC6Nuk6Dm1gu/rV2p+OBcwHBlxYpyf2c0CBKF92IWehOTgwrUkdM7Op?=
 =?us-ascii?Q?Dm8t287hB/GjTgxzXF/PDUhqmcC45Zf6PpoR42JJvz37DXb/OJZvpGChUXJ4?=
 =?us-ascii?Q?Fo1o3GnMPXr/mf+fesbmcApNmREa+R7rNKCEAKvaKyyvSIof3YrwhSa7DbWq?=
 =?us-ascii?Q?rMXB71jAsqF82lLdeQ/P/pc8KTf3WkSlJErPGzUwi0SafU78WXRFxJQUbB6U?=
 =?us-ascii?Q?JyncjU8laiYayPAt4wYr52VmLVGUiwH57uYJTkHvQnZk8nze+ymkptY8FWFp?=
 =?us-ascii?Q?gGDjEKpENF6QtPOxVtXZ+5nYuyi5KDPfYh2Xcv5oemYoGiWLorG2BbR4HLAs?=
 =?us-ascii?Q?5UVPgSP115R8lK9c67D5Ond29S16/hZv/j3wQypSgsRP2O4BPaA/UoJ4TlZI?=
 =?us-ascii?Q?/Jp76Z8PvhnxjbgKE2kT8Cv4xtpLU0BkKU0iq96DU/c4UxQ0M9egc8lfKx74?=
 =?us-ascii?Q?qgXFFgWEzT2dUzZnNTuuby86BLg+SYOSbhxQ6u2MMtQwkEjXMop7SSa1sDxe?=
 =?us-ascii?Q?9JFdLcHgpN9Pkzcp9GODw8PPQW0JXTqj/lmOzcuEivRi3a36urnYS4dxkwXV?=
 =?us-ascii?Q?ikgByMtDbAjoQWC7iybY++Elz+yyCC8PBW1YLTn3UIl3SFvsG3grK+BA3+ni?=
 =?us-ascii?Q?3zYbOWnNO0Fl/Q8hgccz6Fbn2yRLAUbGabYOxp9HmpbI/KfpgySLa72NSQEB?=
 =?us-ascii?Q?3pVMSRjwFTSMn2lZSW0s0qzavp5jrprDEu4kx1OmiwZopRxHioR9j5DXziYq?=
 =?us-ascii?Q?Hd0MtOFmfUUQSaKwFaYYWrcRZXA3/mVzHqACb3hyDezG+gkjvqSl1o2/fanh?=
 =?us-ascii?Q?mm9g6R5WPmUSHsp/cXkj8kEogQyWaJKkeEjpP2mm4qFy03fPYkg9uOVdcn/2?=
 =?us-ascii?Q?iCsFhQA//RDjvpC6Hg/SCEt3eCrJLbjfm35vekF25R2UI+n5GOpEZ7suJUN4?=
 =?us-ascii?Q?8tg+C0c/lKu0eYH64qmNdSuYP47uUJ2+Y09aLBWK?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA6PR03MB7760.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4deec790-6c24-4a3d-988c-08de2c2f58ef
X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Nov 2025 14:31:40.0331
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: vElnwb7sLl1vq+LggibAlPwbYq/E9UxiLODJspqJLL+wtPUmoiWWvJLbjbE6FuKGTLXpi32MHJ3ne63ibT9HkA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR03MB6203

Reviewed-by: Owen Smith <owen.smith@citrix.com>

________________________________________
From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf of=
 Tu Dinh <ngoc-tu.dinh@vates.tech>
Sent: 24 November 2025 1:51 PM
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh
Subject: [PATCH] Use BootFlags directive on build 25398 and later

Setting BootFlags in an AddReg section is no longer allowed by INFVerif.

This requires duplication of some INF sections upstream from
XenNet_Service.

Link: https://techcommunity.microsoft.com/blog/hardware-dev-center/driver-i=
solation-ruleset-changes-for-whcp-and-attestation-submissions/4461580
Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xennet.inf | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/src/xennet.inf b/src/xennet.inf
index 1f6f182..55e11a2 100644
--- a/src/xennet.inf
+++ b/src/xennet.inf
@@ -52,7 +52,7 @@ xennet.sys=3D0,,
 xennet.sys

 [Manufacturer]
-%Vendor%=3DInst,NT@INF_ARCH@
+%Vendor%=3DInst,NT@INF_ARCH@,NT@INF_ARCH@.10.0...25398

 [Inst.NT@INF_ARCH@]
 %XenNetName%=3DXenNet_Inst,\
@@ -60,6 +60,12 @@ XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV=
_09000005,\
 XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_09000005,\
 XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_09000005

+[Inst.NT@INF_ARCH@.10.0...25398]
+%XenNetName%=3DXenNet_Inst_25H2,\
+XENVIF\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_NET&REV_09000005,\
+XENVIF\VEN_@VENDOR_PREFIX@0001&DEV_NET&REV_09000005,\
+XENVIF\VEN_@VENDOR_PREFIX@0002&DEV_NET&REV_09000005
+
 [XenNet_Inst]
 Characteristics=3D0x84
 BusType=3D1
@@ -71,6 +77,17 @@ AddReg=3DXennet_Inst_AddReg
 ; TODO: Remove during next PDO version bump
 FeatureScore=3D0xFE

+[XenNet_Inst_25H2]
+Characteristics=3D0x84
+BusType=3D1
+*IfType=3D6              ; IF_TYPE_ETHERNET_CSMACD
+*MediaType=3D0           ; NdisMedium802_3
+*PhysicalMediaType=3D14  ; NdisPhysicalMedium802_3
+CopyFiles=3DXenNet_Copyfiles
+AddReg=3DXennet_Inst_AddReg
+; TODO: Remove during next PDO version bump
+FeatureScore=3D0xFE
+
 [XenNet_Inst_AddReg]
 HKR, Ndi, Service, 0, "xennet"
 HKR, Ndi\Interfaces, UpperRange, 0, "ndis5"
@@ -172,6 +189,9 @@ HKR, Ndi\params\*NumRSSQueues,                    Max, =
       0, "8"
 [XenNet_Inst.Services]
 AddService=3Dxennet,0x02,XenNet_Service,XenNet_EventLog

+[XenNet_Inst_25H2.Services]
+AddService=3Dxennet,0x02,XenNet_Service_25H2,XenNet_EventLog
+
 [XenNet_Service]
 DisplayName=3D%XenNetName%
 ServiceType=3D%SERVICE_KERNEL_DRIVER%
@@ -181,6 +201,16 @@ ServiceBinary=3D%12%\xennet.sys
 LoadOrderGroup=3D"NDIS"
 AddReg =3D XenNet_BootFlags,XenNet_Unplug

+[XenNet_Service_25H2]
+DisplayName=3D%XenNetName%
+ServiceType=3D%SERVICE_KERNEL_DRIVER%
+StartType=3D%SERVICE_DEMAND_START%
+ErrorControl=3D%SERVICE_ERROR_NORMAL%
+ServiceBinary=3D%12%\xennet.sys
+LoadOrderGroup=3D"NDIS"
+AddReg =3D XenNet_Unplug
+BootFlags =3D 0x81
+
 [XenNet_BootFlags]
 HKR,,"BootFlags",0x00010003,0x81

--
2.51.2.windows.1



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




From win-pv-devel-bounces@lists.xenproject.org Tue Nov 25 14:32:14 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 25 Nov 2025 14:32:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1171948.1497020 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNu5W-0004MG-Jp; Tue, 25 Nov 2025 14:32:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1171948.1497020; Tue, 25 Nov 2025 14:32:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNu5W-0004M9-H3; Tue, 25 Nov 2025 14:32:14 +0000
Received: by outflank-mailman (input) for mailman id 1171948;
 Tue, 25 Nov 2025 14:32:13 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=9DV6=6B=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vNu5V-0004M3-HE
 for win-pv-devel@lists.xenproject.org; Tue, 25 Nov 2025 14:32:13 +0000
Received: from SN4PR0501CU005.outbound.protection.outlook.com
 (mail-southcentralusazlp170110003.outbound.protection.outlook.com
 [2a01:111:f403:c10d::3])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 86764845-ca0b-11f0-980a-7dc792cee155;
 Tue, 25 Nov 2025 15:32:11 +0100 (CET)
Received: from SA6PR03MB7760.namprd03.prod.outlook.com (2603:10b6:806:43c::5)
 by BN9PR03MB6203.namprd03.prod.outlook.com (2603:10b6:408:100::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9366.12; Tue, 25 Nov
 2025 14:32:05 +0000
Received: from SA6PR03MB7760.namprd03.prod.outlook.com
 ([fe80::e1c0:3b82:280a:80b2]) by SA6PR03MB7760.namprd03.prod.outlook.com
 ([fe80::e1c0:3b82:280a:80b2%7]) with mapi id 15.20.9366.009; Tue, 25 Nov 2025
 14:32:05 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 86764845-ca0b-11f0-980a-7dc792cee155
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=hNtVs+YWDAWQI0vL6VcjgNuLNLel5vQrEYUTYIFxPXqg9/B0Ia9KAOvn/TKCbfZFYlvFedomobRvP1IsseM2xyQSa7gGaUQtwYZ048xRKhHqO1hkM5l1xZLvfz4Cnp4v9m5cM5PninWIHHTP6LOz7dLhgod1RLI3inX/btT3/tRVXAUvAWTt84txX9AH6YPfLiD1nwzRSMumD6/AIb/TBOziinw56hSF/Qd0rY6h8J0uWXQv4lDv8gVTe1iOmbYjWfOhE20jKIQO+g27Wq8qCzYi9aBjlbR7h6OJ7Ey+cFREyF02bAFNW20vlhuoK6DiV+WkUEOO30NqQfaImdgNxw==
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=jqFCCsQttHbcn+UMGuqQih9ZW2Pjn74WShTNCg11DJA=;
 b=tRNmzUARP50pS5kJtjV9umf6UIILn/bAz4zWeIyJWyQ7yoVoJfEHE++oLdhQlxfosEvzalVY8aGVrTbfpb2q2YUhpCo1YpMvJbkrIPW942grgE749bSP87ruDW6mFTrhbbOpqYnciAIiE7cpJ0q4sAKS20wkR7aHZRxrzURTmqz0iOVpusGW0QTm/TsBF8CMf2E78+A5B4vinfQZmJ/Yg0sNQrxIVGH9QFoHSO0HlaJ5qW79XiYpAgt1NHxg6CLkdi271zCCsr9Wcr/cgKsQ+RuC1V6n0LyFM7NAt+N5rh6h5ExEE1evqdMxHg+VV/7CyEhr2M+lK66aYy5TygZdjw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=jqFCCsQttHbcn+UMGuqQih9ZW2Pjn74WShTNCg11DJA=;
 b=bOnt/uh1GcyV9c0orILlvmSXfevvd4V3MrQlfyYjJilG+1Y/EcyjpD7WA3jPHwmtWbYXW7+JS0ugYizDCuhlmoHeXHXm4APsW2Gcbjp0ms3EUF1XUsMZvUPc7486XQ7baGaB1lH5DJe/wdH10CIE6N5DhQcO1FV0Tp+HRzTJ4FU=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [PATCH] Use BootFlags directive on build 25398 and later
Thread-Topic: [PATCH] Use BootFlags directive on build 25398 and later
Thread-Index: AQHcXUlbmtBnLEWOx0alTS3TmhsKyrUB2CyAgAGdtZg=
Date: Tue, 25 Nov 2025 14:32:05 +0000
Message-ID:
 <SA6PR03MB776072712A5ADC5D7D0AC14BFED1A@SA6PR03MB7760.namprd03.prod.outlook.com>
References: <20251124135009.1003-1-ngoc-tu.dinh@vates.tech>
 <20251124135057.705-1-ngoc-tu.dinh@vates.tech>
In-Reply-To: <20251124135057.705-1-ngoc-tu.dinh@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA6PR03MB7760:EE_|BN9PR03MB6203:EE_
x-ms-office365-filtering-correlation-id: b7b6e348-6f18-4210-375d-08de2c2f67fa
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|366016|376014|1800799024|38070700021;
x-microsoft-antispam-message-info:
 =?us-ascii?Q?QvWM8AA1aCtPzrdGod3Zr9VtwVgChaP7js06TfbS48y5h/SsbHL5NAkctH7R?=
 =?us-ascii?Q?6v69qTSCZRp8r82pCHJd0jhPEZaaDIK57IE03g71N9XnGMpyG/HgOQjnqTp2?=
 =?us-ascii?Q?WDsM0aYZItCgDAvX7jGXjpQrR6w5+HPKvS+XpSNT4M/1PQqnIhN6bifV1qHA?=
 =?us-ascii?Q?E9l6IvjRPwUvsI7C+JEAwVtBeEJ5Qd3NF/zBAhFXuaslYo0kRbLedBNz9bLc?=
 =?us-ascii?Q?oc9KnguRcKpOypAKLafGwMyIfbVLmz8Forc0Y1hAy+a1DuQuQUfL0BxQ3M/c?=
 =?us-ascii?Q?GZLU9sRKayxfig8o5vNnzYAvZOkmWk/F+D3ubBH8wha/IrbXar94utheqVrs?=
 =?us-ascii?Q?ElrZ2gB1G2kz3Mtm4bTE8uRGSTvmf0QRd6oXWklmSK7MwhjFuUdN0UJDJisB?=
 =?us-ascii?Q?dZs87F0JIOpMO+3u1jHZDzmWahA4kalKdPRQwCMbUC0N1fFKABqn+HJaMFUW?=
 =?us-ascii?Q?8c6Z/e0wbN7eVXPFd+dadBxvFwX4YGIWXNhYzePZiei6ljaBbBL3p6UrSDHo?=
 =?us-ascii?Q?1ihERmFWIy70ltU1ZEhtJpJGzPWGeN0m+Ps6F3y5irAKGw9r9IIuyvQwe1HH?=
 =?us-ascii?Q?gTIW1L8bC+SNhccGu0ZcWiyGQQu25Jr60nKa69wyUke1VlKPO7/C1iX7EYx1?=
 =?us-ascii?Q?rvCRSiAMRmu2pMx4lCNEhcGZwL2AFTtOMZmSZg2UykPLma/QMwveEIAQ2jsq?=
 =?us-ascii?Q?hddoBVDqfSCMsC+0kok/atv4mf2i4kAA7cOJDxrT14h9sqhH1ghiYherCjLL?=
 =?us-ascii?Q?wLq6TpkYkVi2YWE2yPwNGsUnrSL6vtiis6riS7zsoIhCIPfG7JUS0qdJu7z4?=
 =?us-ascii?Q?egCPdyJqlbht1bPBI91O3WwEQwY3MANc9dpJEvIa3VOXgBPbvIOq8kQmR2Il?=
 =?us-ascii?Q?elyk7r0HsHJRQ0SbqMUoP/zuYGTNr1gSKhlJVYczaWo5XFxrGGtMWxK0KjjY?=
 =?us-ascii?Q?SqabtATVmzJcoWy40G1t5+G7qOUy9JJYFE575yGHhkOV452uJyiOVhT9s6Ue?=
 =?us-ascii?Q?yO6ZhKsAU+B0LCN82Vzdr2s8p1RioI/zmf3G5xUh7bLwFs/PB4V2A3ffDyIz?=
 =?us-ascii?Q?hLfw131XkF7qJnl3GH3UkdrVPpaZwPxOBtTd0Vv+KPX6q6dzXNT01hVzTKGK?=
 =?us-ascii?Q?u0hxzxp1Nf/d6AJJNspdN7OcK4UQpkvifNoIeJ1CpJU6viccLY6N2ENF2kkB?=
 =?us-ascii?Q?QS6Vl0p/4a1fpIwenT8pARWcUkM5fl31JLmnhsIySTq2PisoYRSQVJRbM28b?=
 =?us-ascii?Q?fdk4GDWxO2A6wsgnK0+rDVPg8oxqrqEL7IpLceM0HmVtURd2rM9nNqQWI3RH?=
 =?us-ascii?Q?/bKLQuwSZGNNPgzK6GkVNj8iuZ8dLu5JiHKTUBBHpo5R9OXn19bpMQsWYRSj?=
 =?us-ascii?Q?17MpQKsxx9fI6TglsQGldaKviaR8WDqgLkQpY9DfWypX/YnkCvqTNF+laFxA?=
 =?us-ascii?Q?urwcu6tzsjjq2qLq53MSBrNFE7JRgpRh?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA6PR03MB7760.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(38070700021);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?1Ct8Ok0Jf2bnL4JsexBCjVFlvCa734Y1jVJ5VsvOIJetVndCbZ6W+qGB5rEk?=
 =?us-ascii?Q?+hriXZGBr7hySVHdHq2K1h/pORFjY5KXXP4ZG7Hsa7D1I5BbGaWiDhX+WgyN?=
 =?us-ascii?Q?zhvM5nzxjKUTKPnAYjsxG9WnDudXPWOuORzIEdODGA+jbfWMgctJnjgi8jbB?=
 =?us-ascii?Q?iGphi5kDsQBjObqWxlkCIhk5K8Rg/+G6eOx1FdgavwL6QFOEnIvMgZf/Xfhk?=
 =?us-ascii?Q?Dh8/hQLO5CeVZS+0bZDM+eMxV4bcxC+YH4lzDeArSWcQOL3s46oltGhfPh6O?=
 =?us-ascii?Q?YgWmrS4/BIyJeMmp7DezzdQu+0JL8lK1YPwMdanZeZIWFFXST+y2ZSVXWGON?=
 =?us-ascii?Q?obDhSWEdZNImWZwr/EmDfMC8I3CDrFA2Y1/bb8srX18sogzhw3si+mx6bwJ6?=
 =?us-ascii?Q?Xxmp5WjMaLiM8RtW5BVkL/HsXRm9gtjjZg1YVh0kRTvMeDHCKA6n+8Ytj9vS?=
 =?us-ascii?Q?EPEFV9bafCtn5hQc7VE9vaz0VxamcaEtpx76sG+odrz2D+Xf1QFkHlqxAy7B?=
 =?us-ascii?Q?/wr8cXCInsQlnkMqps3kkkOc3mWosH6sE7XR3PXpHn3Db7xNIlCYSAIVGDAk?=
 =?us-ascii?Q?V5Kielniz1rWp4KDTk8MJbD2Dzq6Yd1hBypqgwJPrXlhIHZzPl+mHcJjDMZA?=
 =?us-ascii?Q?zqJg6Tjpqp/b3jX8bCCgJefnitkqQJoMiTuROIWrmLEcfewrWKRuXyFqR/wJ?=
 =?us-ascii?Q?5OB5cn0pazjdaLwU9H3Kp0dqD0dR0JqqJ4pJ7rQ9+MVUDMQsmRlVGpkO5TqX?=
 =?us-ascii?Q?OjRl6b6Z4TFfnZ7I0JR2PAltx1A4GiiKPyyam0ptzoHYxCpa09JDIAgsGXRt?=
 =?us-ascii?Q?7XinR2MB/KhdYQ1OS5hAlm5OMdAb7QKWWBBhQGBpiD9CwzLld4dqU0DbzMsG?=
 =?us-ascii?Q?DS/71F3eOgq6LCbb2gk1ezftH5+WLcLXzqy5wi+y+gB4z5wogV6dS2yUMiZq?=
 =?us-ascii?Q?u9YROUFyDat0Dyyz8dJVRVNQ0pTYfPzk4/puJPnfp4uxJgd9QQf5y033uZGc?=
 =?us-ascii?Q?4KgDRmdpk4nxaxpfrNvJVPkSSkMXNEzGeQD35tR25WNrpnjP8EwcM5ZV/Of2?=
 =?us-ascii?Q?PHbymSMpkdSesYCPUGhZzNb4re0hOTXP9d9x0H4MsG3elI7XSebl29iuke0L?=
 =?us-ascii?Q?qAaD8S8Ywt6/ynh8uI6whIgvvQoPHmoxFYVW24uTSXvw8VoxCCWxiAglfcVV?=
 =?us-ascii?Q?ZgKEJ34SGWIFVqwjoGxvR6BA1mN+I3AlUR0z+sd5PSDLb33Fg77Kkx92v+GJ?=
 =?us-ascii?Q?YhTNMDcj9ST9yoJZg1G1puRmjMfFmBols/WMezR/R35YIYWgTi+uB4clmjCr?=
 =?us-ascii?Q?Zb8OXgsxizKdE775knzksRk1Pb1CxpeUG5Hy1nj8dIQ09hLmVzqE4n3lqmrU?=
 =?us-ascii?Q?xxSiyo/eNs/AGQgFbh9ZkeuAOVtxne7L1GUDIF4Aoh4ZcAgXZMZUdAoLZ0AG?=
 =?us-ascii?Q?Yq3/JRwWFDZm9HtwRB7BP5kYG1q6E9FocSKmx3d1f/IGsMdK6iO3Ex1tr8yX?=
 =?us-ascii?Q?/a5LzfEiDzPpoQL+M10YYf/ph77FN6o1ltDx+kyAdUSilPmnpzvxTTVD9+3a?=
 =?us-ascii?Q?y+aAnE2XqeJoEeV0IX0RpU8x6YH3kEtGt/BP3Y7B?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA6PR03MB7760.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b7b6e348-6f18-4210-375d-08de2c2f67fa
X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Nov 2025 14:32:05.2240
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: dmXtIu5/qGqgWcXtG/YGW7ZzYpBxQ82FIRPBCdFwS2KzalCY02+HM7lKBBnBhEKvCULCaPTtIxLNTS9/OWUKtw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR03MB6203

Reviewed-by: Owen Smith <owen.smith@citrix.com>

________________________________________
From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf of=
 Tu Dinh <ngoc-tu.dinh@vates.tech>
Sent: 24 November 2025 1:51 PM
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh
Subject: [PATCH] Use BootFlags directive on build 25398 and later

Setting BootFlags in an AddReg section is no longer allowed by INFVerif.

This requires duplication of some INF sections upstream from
XenVif_Service.

Link: https://techcommunity.microsoft.com/blog/hardware-dev-center/driver-i=
solation-ruleset-changes-for-whcp-and-attestation-submissions/4461580
Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xenvif.inf | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/src/xenvif.inf b/src/xenvif.inf
index a5abe4e..304bf13 100644
--- a/src/xenvif.inf
+++ b/src/xenvif.inf
@@ -50,7 +50,7 @@ DefaultDestDir=3D12
 xenvif.sys=3D0,,

 [Manufacturer]
-%Vendor%=3DInst,NT@INF_ARCH@
+%Vendor%=3DInst,NT@INF_ARCH@,NT@INF_ARCH@.10.0...25398

 [Inst.NT@INF_ARCH@]
 %XenVifName%=3DXenVif_Inst,\
@@ -58,17 +58,31 @@ XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_VIF&RE=
V_0900000B,\
 XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_VIF&REV_0900000B,\
 XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_VIF&REV_0900000B

+[Inst.NT@INF_ARCH@.10.0...25398]
+%XenVifName%=3DXenVif_Inst_25H2,\
+XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_VIF&REV_0900000B,\
+XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_VIF&REV_0900000B,\
+XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_VIF&REV_0900000B
+
 [XenVif_Inst]
 CopyFiles=3DXenVif_Copyfiles
 ; TODO: Remove during next PDO version bump
 FeatureScore=3D0xFE

+[XenVif_Inst_25H2]
+CopyFiles=3DXenVif_Copyfiles
+; TODO: Remove during next PDO version bump
+FeatureScore=3D0xFE
+
 [XenVif_Copyfiles]
 xenvif.sys

 [XenVif_Inst.Services]
 AddService=3Dxenvif,0x02,XenVif_Service,

+[XenVif_Inst_25H2.Services]
+AddService=3Dxenvif,0x02,XenVif_Service_25H2,
+
 [XenVif_Service]
 DisplayName=3D%XenVifName%
 ServiceType=3D%SERVICE_KERNEL_DRIVER%
@@ -78,6 +92,16 @@ ServiceBinary=3D%12%\xenvif.sys
 LoadOrderGroup=3D"NDIS"
 AddReg =3D XenVif_BootFlags, XenVif_Parameters, XenVif_Unplug

+[XenVif_Service_25H2]
+DisplayName=3D%XenVifName%
+ServiceType=3D%SERVICE_KERNEL_DRIVER%
+StartType=3D%SERVICE_DEMAND_START%
+ErrorControl=3D%SERVICE_ERROR_NORMAL%
+ServiceBinary=3D%12%\xenvif.sys
+LoadOrderGroup=3D"NDIS"
+AddReg =3D XenVif_Parameters, XenVif_Unplug
+BootFlags =3D 0x81
+
 [XenVif_BootFlags]
 HKR,,"BootFlags",0x00010003,0x81

--
2.51.2.windows.1



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




From win-pv-devel-bounces@lists.xenproject.org Tue Nov 25 14:34:50 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 25 Nov 2025 14:34:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1171949.1497024 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNu81-0004RY-R5; Tue, 25 Nov 2025 14:34:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1171949.1497024; Tue, 25 Nov 2025 14:34:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNu81-0004RR-OF; Tue, 25 Nov 2025 14:34:49 +0000
Received: by outflank-mailman (input) for mailman id 1171949;
 Tue, 25 Nov 2025 14:34:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=9DV6=6B=citrix.com=owen.smith@srs-se1.protection.inumbo.net>)
 id 1vNu80-0004RL-7o
 for win-pv-devel@lists.xenproject.org; Tue, 25 Nov 2025 14:34:48 +0000
Received: from BL2PR02CU003.outbound.protection.outlook.com
 (mail-eastusazlp17011000f.outbound.protection.outlook.com
 [2a01:111:f403:c100::f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e3ddc4fd-ca0b-11f0-9d18-b5c5bf9af7f9;
 Tue, 25 Nov 2025 15:34:47 +0100 (CET)
Received: from SA6PR03MB7760.namprd03.prod.outlook.com (2603:10b6:806:43c::5)
 by MN2PR03MB5296.namprd03.prod.outlook.com (2603:10b6:208:1e8::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9366.11; Tue, 25 Nov
 2025 14:34:44 +0000
Received: from SA6PR03MB7760.namprd03.prod.outlook.com
 ([fe80::e1c0:3b82:280a:80b2]) by SA6PR03MB7760.namprd03.prod.outlook.com
 ([fe80::e1c0:3b82:280a:80b2%7]) with mapi id 15.20.9366.009; Tue, 25 Nov 2025
 14:34:44 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e3ddc4fd-ca0b-11f0-9d18-b5c5bf9af7f9
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=f7RUDqzehFSBNzVrJc4+NkX7Bds6Dvy+smcpp1cChyFua313hlY3zOt290pE75zq7XRVwqhAzV3biiO5H+jNT3Jyv95QPyNZGOsghuQ6rNdbtD1nElkQ1lXssJFCDfn8AqHDlszntzfzb2CqYN0M+foMUWAaScH6WVDAiQuyV5pxMYU3c5bjYThGuYa/4qzcythQBZIl4el8q6Jeov0uPc8r7uoc3R9JEPQkzIFppCzyhaFm6uLMsLNxKgvK39e9F6Nwx572avdlq2FF90uwe+yZ/+fkK8AogddIQ9URnwvxCCIwLQv9xxy/pEf4EfCqSq48zWUbTPHyTt51ZLu5fw==
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=+NxIhd1ufmH2LrvERvSj4IXcK4suzgrjQmrOEDfBpzE=;
 b=E3nA4G38NegVenoMlqIFkXla48AmaNvfWR9DiD8iUTo9C7sxokf/6Cx6UK3AsgAaVHlUXetPZYQr2fQ7PreDqedkEV4l9CZpcnA5aZFVnGOIgWIjyk014/BiRlaQEmyrxg3C5QAMdt69d6UjWP5dHm9b4DYZOkYzIGWZXGNquuw4QJyAcBItvq6coMhWbUDxqjBQ83Hz0Ah8fD6Vpil0d6Dq9f9Z9Sdbh+4sYtCIlWFR745IER8ZAavnEMsfmLWWqJ/XZvpN4RNhjVLINrBSzprG7eqkF7abiRjxJDcd3V1N6y8in8Rfc1/Y1h6sPh7vnVA15Bj229dwUxKLjleJww==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com;
 dkim=pass header.d=citrix.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com;
 s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+NxIhd1ufmH2LrvERvSj4IXcK4suzgrjQmrOEDfBpzE=;
 b=yazCirgJPrR+p5CqXop3avqF+Qp7HT+9Sc8xKl6wWtiBHQe1dvob67NCQtwMU+2IBZeV59NFqnXU9Nq6p0HIgicrBqUwhVPU3fUXcMgHIZSvslEfoRbNk/TqaAdTVv2IAm4AlVMf+Hh6Q9CXKEGSu6aavJtEqBPxogEcA9Lwwp8=
From: Owen Smith <owen.smith@citrix.com>
To: Tu Dinh <ngoc-tu.dinh@vates.tech>, "win-pv-devel@lists.xenproject.org"
	<win-pv-devel@lists.xenproject.org>
Subject: Re: [PATCH] Use BootFlags directive on build 25398 and later
Thread-Topic: [PATCH] Use BootFlags directive on build 25398 and later
Thread-Index: AQHcXUlbmtBnLEWOx0alTS3TmhsKyrUDdf7X
Date: Tue, 25 Nov 2025 14:34:44 +0000
Message-ID:
 <SA6PR03MB7760300A28B70C6ED61DA39BFED1A@SA6PR03MB7760.namprd03.prod.outlook.com>
References: <20251124135009.1003-1-ngoc-tu.dinh@vates.tech>
In-Reply-To: <20251124135009.1003-1-ngoc-tu.dinh@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=citrix.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SA6PR03MB7760:EE_|MN2PR03MB5296:EE_
x-ms-office365-filtering-correlation-id: d8c480bb-ded9-4954-cc22-08de2c2fc6d1
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|376014|366016|38070700021;
x-microsoft-antispam-message-info:
 =?us-ascii?Q?eb9JmYbtxGWVjBRSYsuk96pdg6MGZE3iWQrGMcjUQlYmjMruqhEpdFZVNowE?=
 =?us-ascii?Q?Cncdrasy0s1ntZDm4xe4mEOD7U4xaN185Y/HnqiElf1zSp62NniIUk/WlF3G?=
 =?us-ascii?Q?ulPRL6d2QM/IXFa+jjQ0nkCKDKOts2mNFrna73rGSfz9HD8lcV3PNepKwgme?=
 =?us-ascii?Q?lJtH8su55rjuAff6krsFyyJScw9j4sOAW8/UUVb13j7Vb4nXhdIwnIifNCRb?=
 =?us-ascii?Q?fGT2rMSekaFjV3K6VoE2krBm2YFnCoFwDBqzhd54Yq5GjfPkDAU0XKMYw1EQ?=
 =?us-ascii?Q?TE0AtkMtHjnVaODIPPFgxZB+0XPod0wP5si14GgnfF91I6c5ZFl9PFUkfkJr?=
 =?us-ascii?Q?sn1UDX7OjHrqjI0vvxzjrFbXVAg2G4MdUkDFxR7V32UgJWLvpjXuTKp2pfN0?=
 =?us-ascii?Q?2X6cty8TvF2PtVlIgWJ5Dmba7td5QGIF8ywHJfp+chS19YLC9XkZT/FwCgiM?=
 =?us-ascii?Q?FsDSUOnL8i/WdeaKRy68IIve8NeSBHULoZSe7uDFRr+1vPqgfDJihuSWyLbV?=
 =?us-ascii?Q?gUsSXbcwq8vcU5zDgJnw9fUxPWRywANn+bMqmBbGg8mGhGRVCfw8ISgrfYqy?=
 =?us-ascii?Q?KStfYV7pwzH+Np/B7Crwpks7W6MTyLR91+PfNbGY6jBPm6ejG2/oeTeRyNje?=
 =?us-ascii?Q?3wHoHZIzl8kSE/MLWtBorgYd+sUdcLx/9K9aMSTtn3XU9iDQw1sGuJPs4IJm?=
 =?us-ascii?Q?nknKy2oeiFxL/LrHIJ/kuPo1wLi8wdDTn2J8QbVYSclC171yq4h43I8QOMO8?=
 =?us-ascii?Q?sIWNtEHEM1k4WS8OkDqcak6Mnenv2sv4hFDYcHAiB34cu+nEotUMC+lR3yGN?=
 =?us-ascii?Q?j4bOHREYcwYrf1zZagapyb/5mfuLHkWLrmvldFqQnAwtR8Mweb0dEntq7Xsl?=
 =?us-ascii?Q?Uf2Px6l7/Jm4XFSN14KnlquFTy2gsYo8CyZRxNgXBVIyDwbLdEMWL94gveFB?=
 =?us-ascii?Q?rGcY+TdOFMoeQsw0vWUy3aRjigRpIzZsrhs6UTxFJO1Xd7/B1ydgC0c+ynQZ?=
 =?us-ascii?Q?RUB5khQrxm3DG0fTeI7g8JDSeYKQncPpbpxXEhUzvjvXRku8VPJaMY5soMk3?=
 =?us-ascii?Q?jZqWIz5XXrLuO2XGfi7D0MtDcenk6dkOPic9ZUVw4gNJiDsczz3O3rpWCXa1?=
 =?us-ascii?Q?4Yk1h8LEKrpHJpjij60j6r81+OtQZCr/Qd6VvPd0/dMi+LBNiYWAkHKD/TC/?=
 =?us-ascii?Q?XFhSJx1d6Xc1uJgcxZTtJLMFg1gfVAgJBR5WOeNN7LZiqDg+7Chkfwy1ipvm?=
 =?us-ascii?Q?V21TZI3ji57vLNS0DFWfSqnBwD0/VF30ZYyhp0FkEMJHwloDq/NKSZP7QEI4?=
 =?us-ascii?Q?W/jDQhMGmiSQmmlayAyOff+mZEZp99jRibZkuQEgEFpMI/sWyxatiIzq/JLY?=
 =?us-ascii?Q?29v/nwoqBlFQR1Yl9tc7Je5Yj9JKr5AAySaa2XJnUwDysPuWuzwhI8kzKLfR?=
 =?us-ascii?Q?sWOLwx5wk+Fpqv9lbRBLSgxtv4gG32n5?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA6PR03MB7760.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(38070700021);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?us-ascii?Q?fZ2qiek0oGxW1B3cqNM+D6ocqKIAb+lCUd6kjnZkw++UMjRQNYCTojXFYIGn?=
 =?us-ascii?Q?qAy3G3c4C2lu7taT3E7MhVyjp1gNJiKrjkRoX9BhGcfU3Bw5wIBySaGaR/nm?=
 =?us-ascii?Q?02htXg1j1Ejwy60gtA+CwF4ggieTZ6vgODQocH3WRys38g/oMs0broOAZCFc?=
 =?us-ascii?Q?sO5r8yVYyVAG6OtE0fJmqYcShvWy68Fm6jEZ1KVpQNkD97xdvELh/VQht+6k?=
 =?us-ascii?Q?cU4wbUDuHWPnkP4gOrZjLuBc3gox+wS/FX3z/0nxAExesIft2PurKrJ8onLq?=
 =?us-ascii?Q?bhJivb5Q4N0+7eWjGbJ4cj6Iqx0Nu64VfmgPJHDPRWXU8kpD7hAHDG8b92T0?=
 =?us-ascii?Q?85eZKCt70F2RrtN64ryvro7UPliYBOT+K0MBy6nhz+l8jB+NBvrketAuHBla?=
 =?us-ascii?Q?xfuEAzXd00qkE0E2GO4CLU8CZW7RodyMOx+2fdBKpIvpaCXxZn0Xb8PmDrgl?=
 =?us-ascii?Q?cQ5u4LREyTieb76fyA3t8IZaeDxJ4/u6O6x7/xI0w5hPdV74Pa6EHvjryzme?=
 =?us-ascii?Q?u5Cckz1RopWfDtPwo5ozloEiMrQ7sztiHqYeHt5EK+HiJ4Ztje66SEaBW6qa?=
 =?us-ascii?Q?W6sFlF0wr/R0rlDTEYtU2iQP7LOL+1wM6zOoCUJHIV6ib8WFlW1zIna94Zca?=
 =?us-ascii?Q?UcqeaOYNGWCBktY5/42B3EFwDhiO/TnwjYdp7lg7NhuyRSg1y7211gaG1zAe?=
 =?us-ascii?Q?NaXeQhmF3zqxJm4lbJsDOupowT8J0GUXNL/Kdms+55wNozfEUSEA92qG1Sow?=
 =?us-ascii?Q?aF1SSfiWGdABuVN9pG+dUsJr74AmaqwetkUkDm/yPpFpXAs5PI3zoBQkwEMr?=
 =?us-ascii?Q?4SorIjCX/toWmueJ6AHthL2/HTKeNUZC6jqcHFeh26A+wvaOKBRe9+aPm+UW?=
 =?us-ascii?Q?19lvQSDY2VNDMb+zLOur84OJa1PHSyJRNYPKUbZCmXnp5Ug1QEXmBmgJxDJP?=
 =?us-ascii?Q?v/UQf2hKO3GhUL6YDFfoYNIdSRmUZ4q+PMm72XrYADyBmGS5IrJAMN/fug69?=
 =?us-ascii?Q?GeTA4cAHWAXMhAUcpaAodEczgXnHnPzTK0AbtqynbbRNT5kkvz999ovuXFSm?=
 =?us-ascii?Q?Z5L9Q2MBIbwuWMk34I76V3beM+5zC4hJcD/cAnpmKnVV6mugHEJEx+0WaKLU?=
 =?us-ascii?Q?35ZCalBYUvOUvtoaUPr4qqFJBEGAcIC2ai+83Zf9BTsiZ2vSNpMiSJxpMrqf?=
 =?us-ascii?Q?LHv/TA69uRCCwtdqYmgB06P+ps7H6+uduzaTXZUX/jts79FjNoW+t/ApS9fa?=
 =?us-ascii?Q?Hqa1s3bLT0Q5yP1h1kxi8qMt1S7JsKiUh8s3aa4Z2DT1AN3UnkUCnDgD7QGS?=
 =?us-ascii?Q?1gRbd9NQfZijQEWN3rEkQEQtgTgSzkT9oHGEOtjc3QImu3rcdvLd836F+S+e?=
 =?us-ascii?Q?O80K5pVYkDw1xVeuhiU+zdwg/fNldQHpYAhlk9f8AcwSKQTgu6WIHlJuoUUF?=
 =?us-ascii?Q?cmjjKioAL3BC1DRopkb+s01gfmBb+prnydyJeHUbxNpEY2WwfkP7SAG3gsNZ?=
 =?us-ascii?Q?zuSPwwp/iBcS/jX059cp5EGvKjgYddrCznPuMrB6sw14RItWBSH7ofxILUNK?=
 =?us-ascii?Q?p/AjBPRhz1bFtI6Mu/RWWZ4xv1VvJGe1RrTUYBNC?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: citrix.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SA6PR03MB7760.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d8c480bb-ded9-4954-cc22-08de2c2fc6d1
X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Nov 2025 14:34:44.3306
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 335836de-42ef-43a2-b145-348c2ee9ca5b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: x0kZ4IrKPFNTuLm5Z7ItckGzDL9QpEdo8PdTzj3vrHHeCLE8VIh6te3nGiIjPiMXKRfVzEs7gEjakepA7eVdFA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR03MB5296


I'm not aware of any use-case where xencons is used as a boot path, so Boot=
Flags in this inf is not required - its likely a copy-paste issue from crea=
tion, when xenvif was used as a template. In most cases, xencons wont be pa=
rticularly useful until xencons_monitor has started, as this spawns xencons=
_tty to create the shell.

Owen

________________________________________
From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf of=
 Tu Dinh <ngoc-tu.dinh@vates.tech>
Sent: 24 November 2025 1:50 PM
To: win-pv-devel@lists.xenproject.org
Cc: Tu Dinh
Subject: [PATCH] Use BootFlags directive on build 25398 and later

Setting BootFlags in an AddReg section is no longer allowed by INFVerif.

This requires duplication of some INF sections upstream from
XenCons_Service.

Link: https://techcommunity.microsoft.com/blog/hardware-dev-center/driver-i=
solation-ruleset-changes-for-whcp-and-attestation-submissions/4461580
Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xencons.inf | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/src/xencons.inf b/src/xencons.inf
index bae7624..4e8d274 100644
--- a/src/xencons.inf
+++ b/src/xencons.inf
@@ -62,7 +62,7 @@ xencons_monitor_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VE=
RSION@_@BUILD_NUMBER@.d
 xencons_tty_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@=
.exe,xencons_tty.exe

 [Manufacturer]
-%Vendor%=3DInst,NT@INF_ARCH@
+%Vendor%=3DInst,NT@INF_ARCH@,NT@INF_ARCH@.10.0...25398

 [Inst.NT@INF_ARCH@]
 %XenConsName%=3DXenCons_Inst,\
@@ -70,6 +70,12 @@ XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_CONS&RE=
V_0900000A,\
 XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_CONS&REV_0900000A,\
 XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_CONS&REV_0900000A

+[Inst.NT@INF_ARCH@.10.0...25398]
+%XenConsName%=3DXenCons_Inst_25H2,\
+XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_CONS&REV_0900000A,\
+XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_CONS&REV_0900000A,\
+XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_CONS&REV_0900000A
+
 [XenCons_Inst]
 CopyFiles=3DXenCons_Copyfiles
 CopyFiles=3DMonitor_Copyfiles
@@ -77,6 +83,13 @@ CopyFiles=3DTty_Copyfiles
 ; TODO: Remove during next PDO version bump
 FeatureScore=3D0xFE

+[XenCons_Inst_25H2]
+CopyFiles=3DXenCons_Copyfiles
+CopyFiles=3DMonitor_Copyfiles
+CopyFiles=3DTty_Copyfiles
+; TODO: Remove during next PDO version bump
+FeatureScore=3D0xFE
+
 [XenCons_Copyfiles]
 xencons.sys

@@ -84,6 +97,10 @@ xencons.sys
 AddService=3Dxencons_monitor,%SPSVCSINST_STARTSERVICE%,Monitor_Service,Mon=
itor_EventLog
 AddService=3Dxencons,%SPSVCINST_ASSOCSERVICE%,XenCons_Service

+[XenCons_Inst_25H2.Services]
+AddService=3Dxencons_monitor,%SPSVCSINST_STARTSERVICE%,Monitor_Service,Mon=
itor_EventLog
+AddService=3Dxencons,%SPSVCINST_ASSOCSERVICE%,XenCons_Service_25H2
+
 [XenCons_Service]
 DisplayName=3D%XenConsName%
 ServiceType=3D%SERVICE_KERNEL_DRIVER%
@@ -93,6 +110,16 @@ ServiceBinary=3D%12%\xencons.sys
 LoadOrderGroup=3D"Extended Base"
 AddReg =3D XenCons_BootFlags, XenCons_Parameters

+[XenCons_Service_25H2]
+DisplayName=3D%XenConsName%
+ServiceType=3D%SERVICE_KERNEL_DRIVER%
+StartType=3D%SERVICE_DEMAND_START%
+ErrorControl=3D%SERVICE_ERROR_NORMAL%
+ServiceBinary=3D%12%\xencons.sys
+LoadOrderGroup=3D"Extended Base"
+AddReg =3D XenCons_Parameters
+BootFlags =3D 0x81
+
 [XenCons_BootFlags]
 HKR,,"BootFlags",0x00010003,0x81

--
2.51.2.windows.1



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




From win-pv-devel-bounces@lists.xenproject.org Tue Nov 25 16:45:58 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 25 Nov 2025 16:45:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1172121.1497216 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNwAt-0005AT-Va; Tue, 25 Nov 2025 16:45:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1172121.1497216; Tue, 25 Nov 2025 16:45:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNwAt-0005AM-T9; Tue, 25 Nov 2025 16:45:55 +0000
Received: by outflank-mailman (input) for mailman id 1172121;
 Tue, 25 Nov 2025 16:45:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YtHZ=6B=bounce.vates.tech=bounce-md_30504962.6925dd3a.v1-4d19fdf180db41ffa5d7c48d7e196b4e@srs-se1.protection.inumbo.net>)
 id 1vNwAt-0005AG-4N
 for win-pv-devel@lists.xenproject.org; Tue, 25 Nov 2025 16:45:55 +0000
Received: from mail8.wdc04.mandrillapp.com (mail8.wdc04.mandrillapp.com
 [205.201.139.8]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 316bf533-ca1e-11f0-980a-7dc792cee155;
 Tue, 25 Nov 2025 17:45:49 +0100 (CET)
Received: from pmta16.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail8.wdc04.mandrillapp.com (Mailchimp) with ESMTP id 4dG7qG5SYjz3sN6Sq
 for <win-pv-devel@lists.xenproject.org>; Tue, 25 Nov 2025 16:45:46 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 4d19fdf180db41ffa5d7c48d7e196b4e; Tue, 25 Nov 2025 16:45:46 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 316bf533-ca1e-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1764089146; x=1764359146;
	bh=cDY3KwCQFVuTUwTDXbIV4nZkyN0EeYLaEIvK7mFKnUE=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=Rj+MnLSXY3VeXkze6tjVw2WGQ5ZiGfp4e3ov0e/wkriraqXUU7mCRjx+BAnzudyil
	 echN+Im/gVD4CMAGgiZOGOV8NWqfq8GD53Qos1hvSyxD7yGIsAYNzcvingSs5qZ2B4
	 kQIr2zWxmXkZR6hhA/NDgA9JdFwZ8TogSyAmcf9DQ/MzqTtFclFKfUT5pTq3YEj8mw
	 wkThwN2bApfPdt6z5hIgf6a6B3mmlPeSsvhNkna7+j3SfpRqH48IOm6pHtoDVpm7uk
	 U+o5acRDY55jQy8Az1Q3zIocIKFjxRwnRkeaOqckZ3b/DxGDeX/7k/ryjlqyI7CIaD
	 nDQB5dLzo9/vw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1764089146; x=1764349646; i=ngoc-tu.dinh@vates.tech;
	bh=cDY3KwCQFVuTUwTDXbIV4nZkyN0EeYLaEIvK7mFKnUE=;
	h=From:Subject:Message-Id:To:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=l4QJmhuN9oaA6Ewv2XLngdHpVZkiRCN9Aqbio08WUeO0JsTCehEOxQBtSzy7aZ7wX
	 sZIAX3pcqh7sQwuLtYcVMjnYP0x374EjoXbYmo16rE95CNYCUZ6QnYnxHiJV3//9cF
	 N5cwK27TJfrz8sPb+hOd1hd978qnFH8Wl3yfcIC3ETgZGDlEXzg8DG9gUlMeZZxmGX
	 CoKvqy9eQiGZyGnax4djCaJ4GjJYugvMhLGTqwpVhGtWHhM4gZrExcJkAlFFTunrOW
	 tC3XRYt+Iy1gU0UESXAqVlPdR4n6qGCDMDnU+6mYjAr+IMC0IRE4i73zoHRrZY1B5h
	 P3VrpS6BsWW+w==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH]=20Use=20BootFlags=20directive=20on=20build=2025398=20and=20later?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1764089145786
Message-Id: <c11170d8-5469-45af-b78c-fea842084fb9@vates.tech>
To: "Owen Smith" <owen.smith@citrix.com>, win-pv-devel@lists.xenproject.org
References: <20251124135009.1003-1-ngoc-tu.dinh@vates.tech> <SA6PR03MB7760300A28B70C6ED61DA39BFED1A@SA6PR03MB7760.namprd03.prod.outlook.com>
In-Reply-To: <SA6PR03MB7760300A28B70C6ED61DA39BFED1A@SA6PR03MB7760.namprd03.prod.outlook.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.4d19fdf180db41ffa5d7c48d7e196b4e?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251125:md
Date: Tue, 25 Nov 2025 16:45:46 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 25/11/2025 15:34, Owen Smith wrote:
> 
> I'm not aware of any use-case where xencons is used as a boot path, so BootFlags in this inf is not required - its likely a copy-paste issue from creation, when xenvif was used as a template. In most cases, xencons wont be particularly useful until xencons_monitor has started, as this spawns xencons_tty to create the shell.

You're right, I did find the use of BootFlags slightly odd, but chalked 
it up to me not knowing the true reason. I'll make a patch to remove it.

On a related note, I'm thinking of adding run-from-driver-store for the 
drivers that could support this next.

 > > Owen
> 
> ________________________________________
> From: win-pv-devel <win-pv-devel-bounces@lists.xenproject.org> on behalf of Tu Dinh <ngoc-tu.dinh@vates.tech>
> Sent: 24 November 2025 1:50 PM
> To: win-pv-devel@lists.xenproject.org
> Cc: Tu Dinh
> Subject: [PATCH] Use BootFlags directive on build 25398 and later
> 
> Setting BootFlags in an AddReg section is no longer allowed by INFVerif.
> 
> This requires duplication of some INF sections upstream from
> XenCons_Service.
> 
> Link: https://techcommunity.microsoft.com/blog/hardware-dev-center/driver-isolation-ruleset-changes-for-whcp-and-attestation-submissions/4461580
> Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
> ---
>   src/xencons.inf | 29 ++++++++++++++++++++++++++++-
>   1 file changed, 28 insertions(+), 1 deletion(-)
> 
> diff --git a/src/xencons.inf b/src/xencons.inf
> index bae7624..4e8d274 100644
> --- a/src/xencons.inf
> +++ b/src/xencons.inf
> @@ -62,7 +62,7 @@ xencons_monitor_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.d
>   xencons_tty_@MAJOR_VERSION@_@MINOR_VERSION@_@MICRO_VERSION@_@BUILD_NUMBER@.exe,xencons_tty.exe
> 
>   [Manufacturer]
> -%Vendor%=Inst,NT@INF_ARCH@
> +%Vendor%=Inst,NT@INF_ARCH@,NT@INF_ARCH@.10.0...25398
> 
>   [Inst.NT@INF_ARCH@]
>   %XenConsName%=XenCons_Inst,\
> @@ -70,6 +70,12 @@ XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_CONS&REV_0900000A,\
>   XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_CONS&REV_0900000A,\
>   XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_CONS&REV_0900000A
> 
> +[Inst.NT@INF_ARCH@.10.0...25398]
> +%XenConsName%=XenCons_Inst_25H2,\
> +XENBUS\VEN_@VENDOR_PREFIX@@VENDOR_DEVICE_ID@&DEV_CONS&REV_0900000A,\
> +XENBUS\VEN_@VENDOR_PREFIX@0001&DEV_CONS&REV_0900000A,\
> +XENBUS\VEN_@VENDOR_PREFIX@0002&DEV_CONS&REV_0900000A
> +
>   [XenCons_Inst]
>   CopyFiles=XenCons_Copyfiles
>   CopyFiles=Monitor_Copyfiles
> @@ -77,6 +83,13 @@ CopyFiles=Tty_Copyfiles
>   ; TODO: Remove during next PDO version bump
>   FeatureScore=0xFE
> 
> +[XenCons_Inst_25H2]
> +CopyFiles=XenCons_Copyfiles
> +CopyFiles=Monitor_Copyfiles
> +CopyFiles=Tty_Copyfiles
> +; TODO: Remove during next PDO version bump
> +FeatureScore=0xFE
> +
>   [XenCons_Copyfiles]
>   xencons.sys
> 
> @@ -84,6 +97,10 @@ xencons.sys
>   AddService=xencons_monitor,%SPSVCSINST_STARTSERVICE%,Monitor_Service,Monitor_EventLog
>   AddService=xencons,%SPSVCINST_ASSOCSERVICE%,XenCons_Service
> 
> +[XenCons_Inst_25H2.Services]
> +AddService=xencons_monitor,%SPSVCSINST_STARTSERVICE%,Monitor_Service,Monitor_EventLog
> +AddService=xencons,%SPSVCINST_ASSOCSERVICE%,XenCons_Service_25H2
> +
>   [XenCons_Service]
>   DisplayName=%XenConsName%
>   ServiceType=%SERVICE_KERNEL_DRIVER%
> @@ -93,6 +110,16 @@ ServiceBinary=%12%\xencons.sys
>   LoadOrderGroup="Extended Base"
>   AddReg = XenCons_BootFlags, XenCons_Parameters
> 
> +[XenCons_Service_25H2]
> +DisplayName=%XenConsName%
> +ServiceType=%SERVICE_KERNEL_DRIVER%
> +StartType=%SERVICE_DEMAND_START%
> +ErrorControl=%SERVICE_ERROR_NORMAL%
> +ServiceBinary=%12%\xencons.sys
> +LoadOrderGroup="Extended Base"
> +AddReg = XenCons_Parameters
> +BootFlags = 0x81
> +
>   [XenCons_BootFlags]
>   HKR,,"BootFlags",0x00010003,0x81
> 
> --
> 2.51.2.windows.1
> 
> 
> 
> --
> Ngoc Tu Dinh | Vates XCP-ng Developer
> 
> XCP-ng & Xen Orchestra - Vates solutions
> 
> web: https://vates.tech
> 
> 
> 



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From win-pv-devel-bounces@lists.xenproject.org Tue Nov 25 17:34:10 2025
Return-path: <win-pv-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xenproject.org
Delivery-date: Tue, 25 Nov 2025 17:34:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1172168.1497262 (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNwvZ-0004xf-4K; Tue, 25 Nov 2025 17:34:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1172168.1497262; Tue, 25 Nov 2025 17:34:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <win-pv-devel-bounces@lists.xenproject.org>)
	id 1vNwvZ-0004xY-0v; Tue, 25 Nov 2025 17:34:09 +0000
Received: by outflank-mailman (input) for mailman id 1172168;
 Tue, 25 Nov 2025 17:34:08 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=XAdv=6B=bounce.vates.tech=bounce-md_30504962.6925e88b.v1-dbb97b9b26f6431f8495725eaba36bbc@srs-se1.protection.inumbo.net>)
 id 1vNwvX-0004xS-R6
 for win-pv-devel@lists.xenproject.org; Tue, 25 Nov 2025 17:34:07 +0000
Received: from mail136-9.atl41.mandrillapp.com
 (mail136-9.atl41.mandrillapp.com [198.2.136.9])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id efdec5a0-ca24-11f0-980a-7dc792cee155;
 Tue, 25 Nov 2025 18:34:04 +0100 (CET)
Received: from pmta11.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail136-9.atl41.mandrillapp.com (Mailchimp) with ESMTP id 4dG8tz0ZK7zHXYc59
 for <win-pv-devel@lists.xenproject.org>; Tue, 25 Nov 2025 17:34:03 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 dbb97b9b26f6431f8495725eaba36bbc; Tue, 25 Nov 2025 17:34:03 +0000
X-BeenThere: win-pv-devel@lists.xenproject.org
List-Id: Developer list for the Windows PV Drivers subproject
 <win-pv-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:win-pv-devel@lists.xenproject.org>
List-Help: <mailto:win-pv-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/win-pv-devel>, 
 <mailto:win-pv-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: win-pv-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "win-pv-devel" <win-pv-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: efdec5a0-ca24-11f0-980a-7dc792cee155
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1764092043; x=1764362043;
	bh=dDCLvhKn0F6llaooGTlOiIJ3rP/GTTZJ1gQ8duoJ1vs=;
	h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From;
	b=y3OcljajoohkbXikLVk+0gZ7aRNsnjUmdtzNA2o9MR0FrslA6y4cjpH5sxxph/t/L
	 Bnl1BR4SDl6rXG6+zPVJthT+HdYMX77oZhazOAc7++RxmrU8yBBn3y6dIXikshme1M
	 aQ1CPO76Yf2Nyu3nYoj0BUGPgniSd8SrFOPbyOO9BOV6j0lDKg3UALYFGL80wUMGFs
	 wAkVPn634bVvBnRcog1rwlLuqToKl5fFgsD0v+VssE3bRJnNbqvvcdUEqMXHQxZfvN
	 zK6BgYKW4RupRQdmltubqMetDY1Wx5FrCswLgCxqlg3FuPljvghSFVJ+edQZH1Sz4C
	 JpuuVgPkWUXGA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1764092043; x=1764352543; i=ngoc-tu.dinh@vates.tech;
	bh=dDCLvhKn0F6llaooGTlOiIJ3rP/GTTZJ1gQ8duoJ1vs=;
	h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From;
	b=wwYN0k/O82yDeGorZn7UW6xp5od9Y0HEAZGZPDzGFOkl0mYgcrlf+xZKwp+DoDALf
	 BEaEpJFmYv5hbxQTECMmvjK2iZvu/cU3kfdf2paBDIFYmzioN4+E4IxDjxpm5l9dZW
	 cHQU4cyMrVjHX+wfZlEg8yFR18OY1g7GJJR6uWw8s+jyLmPfeNdCUt2kGwdngaXG66
	 ZQ8+VMdGj/cJKrkSaTvr/+gQdg7d7yCbKOeDZIagLLhchPWalUOxiGu0noI7l6GbqP
	 h3kITFnc+DsrknUcLln7Xs022ImM7qSi/ERWgvxDAQT+18dW+caQSI6UtapEcCshkn
	 LekpJmhCBUsng==
From: "Tu Dinh" <ngoc-tu.dinh@vates.tech>
Subject: =?utf-8?Q?[PATCH]=20Remove=20BootFlags=20from=20XenCons=5FService?=
X-Mailer: git-send-email 2.51.2.windows.1
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1764092042155
To: win-pv-devel@lists.xenproject.org
Cc: "Tu Dinh" <ngoc-tu.dinh@vates.tech>, "Owen Smith" <owen.smith@citrix.com>
Message-Id: <20251125173400.1812-1-ngoc-tu.dinh@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.dbb97b9b26f6431f8495725eaba36bbc?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20251125:md
Date: Tue, 25 Nov 2025 17:34:03 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Xencons does not need BootFlags, and setting BootFlags in an AddReg
section is no longer allowed by INFVerif in the first place.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
---
 src/xencons.inf | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/xencons.inf b/src/xencons.inf
index bae7624..6bbd83b 100644
--- a/src/xencons.inf
+++ b/src/xencons.inf
@@ -91,10 +91,7 @@ StartType=%SERVICE_DEMAND_START%
 ErrorControl=%SERVICE_ERROR_NORMAL%
 ServiceBinary=%12%\xencons.sys
 LoadOrderGroup="Extended Base"
-AddReg = XenCons_BootFlags, XenCons_Parameters
-
-[XenCons_BootFlags]
-HKR,,"BootFlags",0x00010003,0x81
+AddReg = XenCons_Parameters
 
 [XenCons_Parameters]
 HKR,"Parameters",,0x00000010
-- 
2.51.2.windows.1



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



