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

Re: [RFC PATCH 0/2] xenbus: Batch foreign page mappings


  • To: Rafał Wojdyła <omeg@xxxxxxxxxxxxxxxxxxxxxx>, win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
  • Date: Tue, 10 Nov 2026 18:19:33 +0100
  • 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: Tue, 10 Nov 2026 17:19:41 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>

On 10/11/2026 17:58, Rafał Wojdyła wrote:
> This series changes the foreign page map APIs to use batched hypercalls
> when possible. One batch is limited to 256 pages.
> 
> A new xenbus gnttab interface version is added, with changed behavior:
> * Per-page status reported.
> * Callers are responsible for managing page lifecycle.
> * No automatic rollback on page-level failures.
> 
> The new mapping lifecycle is:
> * Create the mapping with GNTTAB_CREATE_MAPPING.
> * Map foreign pages with (potentially multiple calls of)
>    GNTTAB_MAP_FOREIGN_PAGES_V2.
> * Obtain the region address using GNTTAB_GET_MAPPING_ADDRESS after
>    all pages are populated.
> * Unmap all the pages using GNTTAB_UNMAP_FOREIGN_PAGES_V2.
> * Destroy the mapping using GNTTAB_DESTROY_MAPPING.
> 
> Partially failed map batches can be retried with the unsuccessful pages.
> Partially failed unmap batches can be retried unchanged (already unmapped
> pages are treated as success).
> 
> Legacy (v4) interface is preserved functionally unchanged.
> 
> A companion xeniface series contains changes to the user-space IOCTLs
> and internal bookkeeping, as well as simplified wrappers for one-shot
> map calls.
> 
> All hypercall-level failures are fatal because they signify either
> a corrupted runtime environment or unknown memory state (see
> GrantTableMapForeignPages() in xen/grant_table.c).
> 
> I'm aware that there is a separate patch adding a v5 interface, we can
> either apply one after another or merge the changes since they touch
> separate parts of the gnttab interface.

I hope we can add a GNTTAB v6 for this because we've had to ship GNTTAB 
v5 on our side to fix the disk corruption issue.

> 
> Rafał Wojdyła (2):
>    xenbus: Batch foreign page map and unmap hypercalls
>    xenbus: Add grant table interface v5 for resumable mappings
> 
>   include/gnttab_interface.h | 236 ++++++++++++++---
>   include/revision.h         |   3 +-
>   include/xen.h              |  30 ++-
>   src/xen/grant_table.c      | 210 ++++++++++++---
>   src/xenbus/gnttab.c        | 520 +++++++++++++++++++++++++++++++------
>   5 files changed, 839 insertions(+), 160 deletions(-)
> 
> 
> base-commit: 04fb21d071a7814fd493ebe41f7bbcc565a66708



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