linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Improve docs for IOCTL_GNTDEV_MAP_GRANT_REF
@ 2022-01-31 17:23 Demi Marie Obenour
  2022-02-01  6:07 ` Juergen Gross
  2022-02-04  9:24 ` Juergen Gross
  0 siblings, 2 replies; 3+ messages in thread
From: Demi Marie Obenour @ 2022-01-31 17:23 UTC (permalink / raw)
  To: Boris Ostrovsky, Juergen Gross, Stefano Stabellini
  Cc: Demi Marie Obenour, xen-devel, linux-kernel


[-- Attachment #1.1.1: Type: text/plain, Size: 1528 bytes --]

The current implementation of gntdev guarantees that the first call to
IOCTL_GNTDEV_MAP_GRANT_REF will set @index to 0.  This is required to
use gntdev for Wayland, which is a future desire of Qubes OS.
Additionally, requesting zero grants results in an error, but this was
not documented either.  Document both of these.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
---
 include/uapi/xen/gntdev.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/uapi/xen/gntdev.h b/include/uapi/xen/gntdev.h
index 9ac5515b9bc2..7a7145395c09 100644
--- a/include/uapi/xen/gntdev.h
+++ b/include/uapi/xen/gntdev.h
@@ -47,7 +47,13 @@ struct ioctl_gntdev_grant_ref {
 /*
  * Inserts the grant references into the mapping table of an instance
  * of gntdev. N.B. This does not perform the mapping, which is deferred
- * until mmap() is called with @index as the offset.
+ * until mmap() is called with @index as the offset. @index should be
+ * considered opaque to userspace, with one exception: if no grant
+ * references have ever been inserted into the mapping table of this
+ * instance, @index will be set to 0. This is necessary to use gntdev
+ * with userspace APIs that expect a file descriptor that can be
+ * mmap()'d at offset 0, such as Wayland. If @count is set to 0, this
+ * ioctl will fail.
  */
 #define IOCTL_GNTDEV_MAP_GRANT_REF \
 _IOC(_IOC_NONE, 'G', 0, sizeof(struct ioctl_gntdev_map_grant_ref))
-- 
Sincerely,
Demi Marie Obenour
she/her/hers

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 4963 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Improve docs for IOCTL_GNTDEV_MAP_GRANT_REF
  2022-01-31 17:23 [PATCH v2] Improve docs for IOCTL_GNTDEV_MAP_GRANT_REF Demi Marie Obenour
@ 2022-02-01  6:07 ` Juergen Gross
  2022-02-04  9:24 ` Juergen Gross
  1 sibling, 0 replies; 3+ messages in thread
From: Juergen Gross @ 2022-02-01  6:07 UTC (permalink / raw)
  To: Demi Marie Obenour, Boris Ostrovsky, Stefano Stabellini
  Cc: xen-devel, linux-kernel


[-- Attachment #1.1.1: Type: text/plain, Size: 509 bytes --]

On 31.01.22 18:23, Demi Marie Obenour wrote:
> The current implementation of gntdev guarantees that the first call to
> IOCTL_GNTDEV_MAP_GRANT_REF will set @index to 0.  This is required to
> use gntdev for Wayland, which is a future desire of Qubes OS.
> Additionally, requesting zero grants results in an error, but this was
> not documented either.  Document both of these.
> 
> Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Improve docs for IOCTL_GNTDEV_MAP_GRANT_REF
  2022-01-31 17:23 [PATCH v2] Improve docs for IOCTL_GNTDEV_MAP_GRANT_REF Demi Marie Obenour
  2022-02-01  6:07 ` Juergen Gross
@ 2022-02-04  9:24 ` Juergen Gross
  1 sibling, 0 replies; 3+ messages in thread
From: Juergen Gross @ 2022-02-04  9:24 UTC (permalink / raw)
  To: Demi Marie Obenour, Boris Ostrovsky, Stefano Stabellini
  Cc: xen-devel, linux-kernel


[-- Attachment #1.1.1: Type: text/plain, Size: 502 bytes --]

On 31.01.22 18:23, Demi Marie Obenour wrote:
> The current implementation of gntdev guarantees that the first call to
> IOCTL_GNTDEV_MAP_GRANT_REF will set @index to 0.  This is required to
> use gntdev for Wayland, which is a future desire of Qubes OS.
> Additionally, requesting zero grants results in an error, but this was
> not documented either.  Document both of these.
> 
> Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>

Pushed to xen/tip.git for-linus-5.17a


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-04  9:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-31 17:23 [PATCH v2] Improve docs for IOCTL_GNTDEV_MAP_GRANT_REF Demi Marie Obenour
2022-02-01  6:07 ` Juergen Gross
2022-02-04  9:24 ` Juergen Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).