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

Re: [RFC PATCH 1/6] Stop inlining the VPD page list in TargetInquiry00


  • To: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>, "win-pv-devel@xxxxxxxxxxxxxxxxxxxx" <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Wed, 4 Mar 2026 08:26:00 +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=B+5FEqDe9kti/Ajh6Mc57l34i0yOu00poK63ENXWog4=; b=Kny7z/4hymmt1JjJK48Tw07RF6dzdTDtuO4mu4uRXr5n91Oy+SF4Ea9IWDGEwuas+9S/AVa0/omiwjk+TtNq6yK77BZsok6jiMR+IEcZf4jGWAFH/qPzPxlNtbGZk1o+oiCTfL3Cp9bF8twH+964oynuEjo/ZHbCzUXi7CIvE92sQZDnSS2L5KjmRsBfHbjZu3k+/rWxN7W3r43z9ARxf3ytdzQlYJevPhbKiVHvXoODAiIT9r9Y9v1QM5RwpiciwE/9in2hB4HK4FdNVpu85QRzEfwdFaEWqC/s+apOcu1BoVjrRgXwtSzNfgX4DgFs6SdNX9MmZQOsjHYlU3QEKg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jfRFFuTQzu1Eg2aFcN/i7iVuKApwqRyP8y8dQ2FNFwfMmIpEhzvbiZT3/dfaeZyF+SJzKKJ+uym0Yvt0YlunL8L4wV3QnIwoWFMk0HbesILZDBQbWKLjXjdy9fm3Uhqg2tBWgvEhRGi2V1Xz0hGEvz5YgkfAWV5LdU0d8dMGpx1x4FCpI0oHWPM4i2+ASFB9GjLDyHtQWBL29D3DuaVWUPUgBTDDNh7mEzzRVlttHfZnDxlU3NM8br6OmK33zTjJmbiBpMOxyn2uznFYApN9IGdNikvTkcFpuBjZeL2RH3ZWu3mOODSbQU4bKJ1Fp3ri3Xn5VgIuZVg2tMcjtTcsYA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Delivery-date: Wed, 04 Mar 2026 08:26:12 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
  • Msip_labels:
  • Thread-index: AQHcpw8HSZq1FE4pf0SC1wouK0mVgbWeEt9x
  • Thread-topic: [RFC PATCH 1/6] Stop inlining the VPD page list in TargetInquiry00

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

________________________________________
From: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
Sent: 26 February 2026 10:59 AM
To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
Cc: Tu Dinh; Owen Smith
Subject: [RFC PATCH 1/6] Stop inlining the VPD page list in TargetInquiry00

Define a SupportedPages array containing all supported VPD pages so that
we could check its size later.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
 src/xenvbd/target.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/xenvbd/target.c b/src/xenvbd/target.c
index a07fc45..5a6c7be 100644
--- a/src/xenvbd/target.c
+++ b/src/xenvbd/target.c
@@ -674,6 +674,14 @@ TargetInquiryStd(
     Srb->SrbStatus = SRB_STATUS_SUCCESS;
 }

+static const UCHAR SupportedPages[] = {
+    VPD_SUPPORTED_PAGES,
+    VPD_SERIAL_NUMBER,
+    VPD_DEVICE_IDENTIFIERS,
+    VPD_BLOCK_LIMITS,
+    VPD_BLOCK_DEVICE_CHARACTERISTICS,
+};
+
 static FORCEINLINE VOID
 TargetInquiry00(
     IN  PXENVBD_TARGET          Target,
@@ -691,17 +699,16 @@ TargetInquiry00(
         return;
     RtlZeroMemory(Data, Length);

-    if (Length < 9)
+    if (Length < sizeof(VPD_SUPPORTED_PAGES_PAGE) + sizeof(SupportedPages))
         return;

-    Data->PageLength = 5;
-    Data->SupportedPageList[0] = 0x00;
-    Data->SupportedPageList[1] = 0x80;
-    Data->SupportedPageList[2] = 0x83;
-    Data->SupportedPageList[3] = 0xB0;
-    Data->SupportedPageList[4] = 0xB1;
+    Data->PageLength = sizeof(SupportedPages);
+    RtlCopyMemory(Data->SupportedPageList,
+                  SupportedPages,
+                  sizeof(SupportedPages));

-    Srb->DataTransferLength = 9;
+    Srb->DataTransferLength = sizeof(VPD_SUPPORTED_PAGES_PAGE) +
+        Data->PageLength;
     Srb->SrbStatus = SRB_STATUS_SUCCESS;
 }

--
2.51.2.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®.