From 1abe697341061a6c16e4a5d28b20b5efa7035a81 Mon Sep 17 00:00:00 2001 From: Thanos Makatos Date: Wed, 9 Jun 2021 11:15:34 +0100 Subject: drop mappable flag from DMA map (#553) The flags field belongs to VFIO and it's not a good idea to reuse as new VFIO flags can break things. Instead, we derive whether or not a region is mappable if a file descriptor is passed. Signed-off-by: Thanos Makatos Reviewed-by: Swapnil Ingle Reviewed-by: John Levon --- docs/vfio-user.rst | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'docs') diff --git a/docs/vfio-user.rst b/docs/vfio-user.rst index a5d2b43..9e23fb3 100644 --- a/docs/vfio-user.rst +++ b/docs/vfio-user.rst @@ -547,8 +547,6 @@ The request payload for this message is a structure of the following format: | | +-----+------------+ | | | | 1 | writeable | | | | +-----+------------+ | -| | | 2 | mappable | | -| | +-----+------------+ | +-------------+--------+-------------+ | offset | 8 | 8 | +-------------+--------+-------------+ @@ -565,9 +563,6 @@ The request payload for this message is a structure of the following format: * *writeable* indicates that the region can be written to. - * *mappable* indicates that the region can be mapped via the mmap() system - call using the file descriptor provided in the message meta-data. - * *offset* is the file offset of the region with respect to the associated file descriptor, or zero if the region is not mappable * *address* is the base DMA address of the region. @@ -576,13 +571,15 @@ The request payload for this message is a structure of the following format: This structure is 32 bytes in size, so the message size is 16 + 32 bytes. If the DMA region being added can be directly mapped by the server, a file -descriptor must be sent as part of the message meta-data. On ``AF_UNIX`` -sockets, the file descriptor must be passed as ``SCM_RIGHTS`` type ancillary -data. Otherwise, if the DMA region cannot be directly mapped by the server, it -can be accessed by the server using ``VFIO_USER_DMA_READ`` and -``VFIO_USER_DMA_WRITE`` messages, explained in `Read and Write Operations`_. A -command to map over an existing region must be failed by the server with -``EEXIST`` set in error field in the reply. +descriptor must be sent as part of the message meta-data. The region can be +mapped via the mmap() system call. On ``AF_UNIX`` sockets, the file descriptor +must be passed as ``SCM_RIGHTS`` type ancillary data. Otherwise, if the DMA +region cannot be directly mapped by the server, no file descriptor must be sent +as part of the message meta-data and the DMA region can be accessed by the +server using ``VFIO_USER_DMA_READ`` and ``VFIO_USER_DMA_WRITE`` messages, +explained in `Read and Write Operations`_. A command to map over an existing +region must be failed by the server with ``EEXIST`` set in error field in the +reply. Reply ^^^^^ -- cgit v1.1