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

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


  • To: Owen Smith <owen.smith@xxxxxxxxxx>, "win-pv-devel@xxxxxxxxxxxxxxxxxxxx" <win-pv-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
  • Date: Wed, 14 Oct 2026 09:11:06 +0200
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID"
  • Delivery-date: Wed, 14 Oct 2026 07:11:13 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

Hi Owen,

Could you apply this to XenCons, XenHid, XenIface and XenNet as well?

Thanks,

On 13/10/2026 14:37, Owen Smith wrote:
> 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
> 



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