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

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


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Rafał Wojdyła <omeg@xxxxxxxxxxxxxxxxxxxxxx>
  • Date: Tue, 10 Nov 2026 17:57:13 +0100
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm3 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=fm3 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:Feedback-ID:From:Message-ID:MIME-Version:Subject:To:X-ME-Proxy:X-ME-Sender"
  • Cc: Rafał Wojdyła <omeg@xxxxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 10 Nov 2026 16:57:51 +0000
  • Dkim2-signature: i=1; m=1; t=1794329865; d=invisiblethingslab.com; mf=PG9tZWdAaW52aXNpYmxldGhpbmdzbGFiLmNvbT4=; rt=PHdpbi1wdi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZz4=; s=fm3:rsa-sha256:QAZgGoghEQI+/FEh+Pwo6VLJetVfIA1puF6g3U5ZqcO583q WqPAi+zViLVClqdWB6ZkKeaXLarVW8tRlmW433YfUkKuEzfBDDnUU35wwm+GBYLF hnksYYZByQMzsssKT6elFacSR+3+NsqqHNflnkTqumlwXIu0eVHFBjlYp9JNaabK ranutfwKn3dn9UK5ZyAvA7u6r5VpNZfXnvzZMDrVv5nbvOZdNwGtiHmiw7IAtB/W 4iqERtzpRPJDvCcIqEpOs2ycyb9dRR6HpS6YDNTp3FlmpMG941UvhFdLok7KGuO7 yTzR8UeeKYkga+oqSakSy2DI8qV16YMu/w/WP1g==;
  • Feedback-id: i409c4082:Fastmail
  • List-id: Developer list for the Windows PV Drivers subproject <win-pv-devel.lists.xenproject.org>
  • Message-instance: m=1; h=sha256:aaPB0oD0ZxqTG0QwHMJK89HWBP5vvk7yeporcuwHoXE=:7PpYbMyqmhT/pc7fGmLOdiVqe9s1rxzC1BRyWjA3Seg=;

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.

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
-- 
2.56.0




 


Rackspace

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