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

Re: [PATCH v2] Fix compilation of checked build


  • To: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>, "win-pv-devel@xxxxxxxxxxxxxxxxxxxx" <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Mon, 9 Mar 2026 08:09:30 +0000
  • Accept-language: en-GB, en-US
  • 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
  • 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=UTqYj5VEgXbERZ3ayK62wZhuXSfXPcTab/vZDCnxPUQ=; b=J+W3NzKd6AlaoNc/AAWhkzTYI9U2bYb5WRV285JWajJi2FvQavrijmTyHkWXULZbMBKURTcfdakDy6eU6yTr/z2Pw2HfZs17OL9eHgqUlXKQn9oidjX+rjanIV38WQaA2Wd90+NGtIOX+I+BMfQzV3JAu+D/7ojvdn1fbszOoUuLcYfOnZpzMuKDSC9KRPdRxWTwIa1gY50wVdt2KboZIgOLJQJ4SW18z9ZPKpqY3Mjt0nzEaXh5GhglR958+pMyuCZVNtR7EvZOAU+cR5ire4FJa7u1y0eNzdg/WwpIeS20sQebQpLJqSvcEewusKdGrt5F7AR/yJbOrqdNdo3FsQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EzbSZOhjIU4wFMsPiIG62Ny9Yw6DCAHxpou5wnl4jWhfcOFsJNeCRTUPw3W3rC70b13T3D89kDQKTLSWMV3k3HMraAqDbFJk6NtV1udwkFaQVhvmslDydN+KeCi5rJLS/YiTKv6+aLEG1cqkOVr/U9JP+yHdTZ4yjr0HDtQJn6l+YMyy+YIPb33aysTwWPtc8gQG0IP3azboZRlI+hu/3eibm6Ok7SSrllWMRdL+Q9/+koQICW64xpacl/keJl5/R9FVj/9gXQB/s/kFVaY4TgUkYssBpfvdgrcLx8jad0OXKGTwzFG0DPc/NVHIL5+bcyqokouemCVqQlnBgH4keg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Delivery-date: Mon, 09 Mar 2026 08:09:43 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
  • Msip_labels:
  • Thread-index: AQHcr5paJT2qcXlmGUWZBMYiTQq9V7Wl2BSL
  • Thread-topic: [PATCH v2] Fix compilation of checked build

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

________________________________________
From: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
Sent: 09 March 2026 7:57 AM
To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
Cc: Tu Dinh; Owen Smith
Subject: [PATCH v2] Fix compilation of checked build

* Redefine XEN_API to __declspec(dllexport) to avoid declaring LogPrintf
  and similar symbols in the same binary as dllimport.
* The BUG() macro was not correctly identified as noreturn in checked
  builds, causing a warning about uninitialized variables. Set the Value
  variable before calling BUG() as a workaround.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
 src/xen/hypercall.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/xen/hypercall.c b/src/xen/hypercall.c
index 3c68709..e5b2927 100644
--- a/src/xen/hypercall.c
+++ b/src/xen/hypercall.c
@@ -30,6 +30,9 @@
  * SUCH DAMAGE.
  */

+#undef  XEN_API
+#define XEN_API __declspec(dllexport)
+
 #include <ntddk.h>
 #include <xen.h>
 #include <intrin.h>
@@ -188,6 +191,7 @@ __Hypercall(
             Value = hypercall2_vmmcall(ord, arg1, arg2);
             break;
         default:
+            Value = 0;
             BUG("NO HYPERCALL INSTRUCTION");
         }
         break;
@@ -206,13 +210,14 @@ __Hypercall(
             Value = hypercall3_vmmcall(ord, arg1, arg2, arg3);
             break;
         default:
+            Value = 0;
             BUG("NO HYPERCALL INSTRUCTION");
         }
         break;
     }
     default:
-        ASSERT(FALSE);
         Value = 0;
+        BUG("INVALID HYPERCALL ARGUMENT COUNT");
     }
     va_end(Arguments);

--
2.53.0.windows.1



--
Ngoc Tu Dinh | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




 


Rackspace

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