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

[RFC PATCH 0/7] xeniface: Support batched foreign page mappings


  • To: win-pv-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Rafał Wojdyła <omeg@xxxxxxxxxxxxxxxxxxxxxx>
  • Date: Tue, 10 Nov 2026 19:34:47 +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 18:35:33 +0000
  • Dkim2-signature: i=1; m=1; t=1794335727; d=invisiblethingslab.com; mf=PG9tZWdAaW52aXNpYmxldGhpbmdzbGFiLmNvbT4=; rt=PHdpbi1wdi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZz4=; s=fm3:rsa-sha256:MiMnvuMGS1BAsxxxgZgRVwBbMPiv255Het54uo0T3oNxqtO DjTaldXIh5Nj3XovCq7lTg7KShvGYs2GaZnp/2Vkts0n6MX/yZDTfMP9JVNJcDXO /zIb0JefqdhodZ8hebwaPlvcpQDY1AP2tLsRhkxGuLUXXA+20b9FM9sElkJW8QW1 /6mXE4ridT+ZsBMPox/9O+SgWiAT51xBmFo4F3aloxBzt9GBl+UL1gvdouzjW8nn pkqaGWBfTY/3JuOQwI4Dtt22ZbVG2HluhCjoeZZ+xudOoPO4nVWFbzKdQmGzxKGA i3Hok+76WKDANBQznYcL996LdMcUd5a8YqbAXfA==;
  • 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:xozPMVT+CLCYiA2KgoX9CMonVPhnUfytGXqlAYO/1R8=:bMawwVjCbHb9YCyIh8p7xNP3uvEiHFzZ3XnZEofAN54=;

This series adapts xeniface GNTTAB interface v5 and exposes batched
foreign page mapping operations to userspace.

The new buffered IOCTLs and synchronous xencontrol wrappers match
the explicit lifecycle in xenbus: create a mapping, populate it
in batches of up to 256 pages, obtain a user view, unmap batches,
and finally destroy the empty mapping. Mapping IDs are scoped to
the creating process and open file object. Batch status is reported
separately from per-page results, so callers can inspect partial
failures and manage continuation.

For callers that do not need partial results, a single-batch helper
creates the mapping, maps its pages and obtains the user view in one
request. Failed setup rolls back successful pages. Failed rollback
remains owned by the driver even when no mapping ID was returned
to the caller.

Whole-mapping release removes the virtual views, invalidates the ID
and owns the remaining cleanup. It attempts every batch unmap and retains
failed handles and mapping destruction for retry.

Driver-owned cleanup has a per-mapping no-progress deadline, defaulting
to 60 seconds and configurable through a define. Deadline expiration
is fatal, failed mappings cannot be safely forgotten or reused.

Event-channel contexts are reference-counted so deferred mapping cleanup
retains the original notification target. The notification byte is cleared
before removing the view, and the port notification follows destruction
of that mapping.

Rafał Wojdyła (7):
  xeniface: Avoid accessing grant IRPs after they are pended
  xeniface: Match the grant request identifier mode in queue lookups
  xeniface: Enforce read-only foreign page views
  xeniface: Reference-count event channel contexts
  xeniface: Use GNTTAB v5 interface and retain failed mapping cleanup
  xeniface: Expose batch foreign page mappings to user mode
  xeniface: Add a synchronous single batch foreign page mapping helper

 include/gnttab_interface.h  |  266 +++++++--
 include/xencontrol.h        |  178 ++++++
 include/xeniface_ioctls.h   |  193 +++++-
 src/xencontrol/xencontrol.c |  263 +++++++++
 src/xeniface.inf            |    6 +-
 src/xeniface/fdo.c          |   37 ++
 src/xeniface/fdo.h          |    9 +
 src/xeniface/ioctl_evtchn.c |   60 +-
 src/xeniface/ioctl_gnttab.c | 1116 ++++++++++++++++++++++++++---------
 src/xeniface/ioctls.c       |   63 +-
 src/xeniface/ioctls.h       |  184 +++++-
 src/xeniface/irp_queue.c    |   15 +-
 12 files changed, 2032 insertions(+), 358 deletions(-)


base-commit: 858d09157c7031372e2abfef123010513c6d9842
-- 
2.56.0




 


Rackspace

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