Re: [PATCH v2 5/6] UFFDIO_REGISTER.2const: Document UFFDIO_REGISTER_MODE_RWP and 1 << _UFFDIO_RWPROTECT
Alejandro Colomar <[email protected]> Thu, 4 Jun 2026 01:46:54 +0200
| Newsgroups | org.kernel.vger.linux-man,org.kvack.linux-mm |
|---|---|
| Message-ID | <aiC84ZUEr3MwWuq5@devuan> |
On 2026-05-26T14:41:48+0100, Kiryl Shutsemau wrote: > Add the new registration mode bit introduced in Linux 7.2: > > UFFDIO_REGISTER_MODE_RWP Track every access (read or write) to a > present page in the registered range. > Cannot be combined with > UFFDIO_REGISTER_MODE_WP; both modes share > the same per-PTE marker bit. Anonymous, > shmem, and hugetlbfs ranges are > compatible. > > Also document the matching argp->ioctls bit, 1 << _UFFDIO_RWPROTECT, > which the kernel reports only when the range was registered with > UFFDIO_REGISTER_MODE_RWP (which itself requires UFFD_FEATURE_RWP to > have been negotiated). > > Signed-off-by: Kiryl Shutsemau <[email protected]> > Acked-by: Mike Rapoport (Microsoft) <[email protected]> Patch applied; thanks! Cheers, Alex > --- > man/man2const/UFFDIO_REGISTER.2const | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/man/man2const/UFFDIO_REGISTER.2const b/man/man2const/UFFDIO_REGISTER.2const > index 50064c954b81..ded57cf301ad 100644 > --- a/man/man2const/UFFDIO_REGISTER.2const > +++ b/man/man2const/UFFDIO_REGISTER.2const > @@ -72,6 +72,20 @@ .SH DESCRIPTION > only hugetlbfs ranges are compatible. > Since Linux 5.14, > compatibility with shmem ranges was added. > +.TP > +.BR UFFDIO_REGISTER_MODE_RWP " (since Linux 7.2)" > +Track page faults on read-write-protected pages. > +Every access > +(read or write) > +to a page present within the registered range > +generates a notification > +once the range has been protected with > +.BR UFFDIO_RWPROTECT (2const). > +This mode cannot be combined with > +.BR UFFDIO_REGISTER_MODE_WP ; > +attempting to do so fails with > +.BR EINVAL . > +Anonymous, shmem, and hugetlbfs ranges are compatible. > .P > If the operation is successful, the kernel modifies the > .I argp->ioctls > @@ -109,6 +123,16 @@ .SH DESCRIPTION > The > .B UFFDIO_POISON > operation is supported. > +.TP > +.BR "1 << _UFFDIO_RWPROTECT" " (since Linux 7.2)" > +The > +.B UFFDIO_RWPROTECT > +operation is supported. > +This bit is reported only when the range was registered with > +.B UFFDIO_REGISTER_MODE_RWP > +(which itself requires > +.B UFFD_FEATURE_RWP > +to have been negotiated). > .SH RETURN VALUE > On success, > 0 is returned. > -- > 2.54.0 > > -- <https://www.alejandro-colomar.es>
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmogvO4ACgkQ64mZXMKQ wqmFCg//e90MJJIMOM7KqCbh3P7UvHFm4V9NLbTad4/wsqI1efMunVb9efKO87sZ L7ZWaGrBPYy59a6AMKI9BfsIqVbS0ZHD8Udu1JGWcjn3UJFJ7StqHU/wlQyYZGvk GMrKPG+4FH7rfTnYXy5Yts3q6HKLPeNLjpGGx3KaYog5EIswT165RUjsMceFRVVw zKqb5+/nd351RRFk+OJfD8SxSUvywY1m2sJ61pPqo6P++gy9gvBgVZx0gnNZdJn9 bc4lhZhbtr0Do/cTaw3b0A2ugN58H1vC77rKXs/HbY0F7BAG+xkB6SDb2fqkbfHw SaQS6Q94powYXb6pDEcl64VkoSOkFx8OOQDKCYfB49KMChKA8lYX9ujwnvG+PVSU ChYAngrzcFGTRWe0Ntwk3XzouPzRvK63lJXwNH1GLSwxdHBBycIYaaLoIeAxeepc Wq/rB041UIsz7+LHSlS3ctwgdEUVqhX9JI1brhSaWGflYMGPj2oqA/skW7B4msoR bETTURfVzL8yl2Go1w8HFWnFQIeiOzwKRlH2X82WfjSrZ/n3HDO7CQGUTK7SSNU+ 2v+6BMPrhYAfJz/w10D+0+AG0m6sEWOfx67/5guF5NJ2rHCHDbbxCandv9SxgkcT JTdTDmkCT9yRQpt1c15rVYp23DmXDQ6wkT1hk8bederokhHsaRY= =VZwq -----END PGP SIGNATURE-----