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

Re: [PATCH] Set SkipBytes to 0 for contiguous allocations


  • To: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>, "win-pv-devel@xxxxxxxxxxxxxxxxxxxx" <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Owen Smith <owen.smith@xxxxxxxxxx>
  • Date: Tue, 13 Oct 2026 12:37:28 +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=AMbylGVYmR4hcmhFMc3zhYahx52UbWMgFWWKCdGdn+s=; b=wofs5vnIXGtruVXsA3O6H28uD0zGyWK/57MWMvgPVoj6CwEYsU05zRsXdvHkE3Ex930y5LtZutebWt0kCx9WPWx/M7P6rYMNPdP9Nw+HLECCqgGUOs5I3wFeaEqGJT7fTcGzqvBRKuM+mqAghceQu+TtmsSeY2wVrFLJmgPxOxdjj7Tuh4F0YIy7C/5rEocoRCw23sJqoWCEVjs9l3Ycc0ukfe74jzxF07WaiXlfA97N/4sG3iaz4WO5r4Bm9DEPpQl8ohwTvA2O2mfrVBSiDhWm4sGHsuGFJNmimeU65TFx1CVeufirxojRk7x+J3BvakCNQSV6W4wuMj1cJsJgnQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XfH/lQHCsreI2iIkQfsE8RaRkWtfg0yG2FnFrsvmraieA5xf4q5cqk5fAJSPx6T17aMs7fk/PoM90PYOJS1Dtr06D2IDiX3yKtcy+gYWei39A52ybQIi90ddeQ4njIg3Z24LudXrOUQhz5M+N0SVYAa46wY+964dwMIO2brTDF8oZchY8aikd7i06GcL7yyy5oogAsDbtb3OjyXp32tWr+3iJvnP1yiwA/h+i4mqAHWJY6lQzRup5JNYZ158j4yXYHUyOhEMjryQ8xGLcyOAAgur2RkGruZWf1pqvZXj8kyFXXRadrGuUHZY/SMPqBA4qP0/w37RRTbi+64ymye/DQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Delivery-date: Tue, 13 Oct 2026 12:37:39 +0000
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
  • Msip_labels:
  • Thread-index: AQHdWwohReBLwnIrXE+S+XztkTkZ1rb7aR8L
  • Thread-topic: [PATCH] Set SkipBytes to 0 for contiguous allocations

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

________________________________________
From: win-pv-devel <win-pv-devel-bounces@xxxxxxxxxxxxxxxxxxxx> on behalf of Tu 
Dinh <ngoc-tu.dinh@xxxxxxxxxx>
Sent: 13 October 2026 12:57 PM
To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
Cc: Tu Dinh
Subject: [PATCH] Set SkipBytes to 0 for contiguous allocations

MmAllocatePagesForMdlEx requires that for contiguous allocations, if
MM_ALLOCATE_REQUIRE_CONTIGUOUS_CHUNKS is set and SkipBytes is nonzero,
then SkipBytes must be a power of two. Setting SkipBytes here is
unnecessary as contiguous allocations are still possible with SkipBytes
set to 0 anyway.

Signed-off-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
---
To be applied to XenCons, XenHid, XenIface and XenNet as well.
---
 src/common/util.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/common/util.h b/src/common/util.h
index 36f71f9..9709a10 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -201,13 +201,12 @@ __AllocatePages(

     LowAddress.QuadPart = 0ull;
     HighAddress.QuadPart = ~0ull;
+    SkipBytes.QuadPart = 0ull;
     TotalBytes = (SIZE_T)PAGE_SIZE * Count;

     if (Contiguous) {
-        SkipBytes.QuadPart = TotalBytes;
         Flags = MM_ALLOCATE_REQUIRE_CONTIGUOUS_CHUNKS;
     } else {
-        SkipBytes.QuadPart = 0ull;
         Flags = MM_ALLOCATE_FULLY_REQUIRED;
     }

--
2.55.0.windows.3


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