From: Peter Xu <peterx@redhat.com>
To: linux-kernel@vger.kernel.org, linux-man@vger.kernel.org,
linux-mm@kvack.org
Cc: Alejandro Colomar <alx.manpages@gmail.com>,
Michael Kerrisk <mtk.manpages@gmail.com>,
Axel Rasmussen <axelrasmussen@google.com>,
Andrea Arcangeli <aarcange@redhat.com>,
peterx@redhat.com, Nadav Amit <nadav.amit@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 1/2] userfaultfd.2: Add section for UFFD_USER_MODE_ONLY
Date: Mon, 30 May 2022 21:11:56 -0400 [thread overview]
Message-ID: <20220531011157.46868-2-peterx@redhat.com> (raw)
In-Reply-To: <20220531011157.46868-1-peterx@redhat.com>
Add a paragraph for UFFD_USER_MODE_ONLY flag that was introduced in
Linux 5.11.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
man2/userfaultfd.2 | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2
index cee7c01d2..0928a76d2 100644
--- a/man2/userfaultfd.2
+++ b/man2/userfaultfd.2
@@ -29,8 +29,9 @@
userfaultfd \- create a file descriptor for handling page faults in user space
.SH SYNOPSIS
.nf
-.BR "#include <fcntl.h>" " /* Definition of " O_* " constants */"
-.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
+.BR "#include <fcntl.h>" " /* Definition of " O_* " constants */"
+.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
+.BR "#include <linux/userfaultfd.h>" " /* Definition of " UFFD_* " constants */"
.B #include <unistd.h>
.PP
.BI "int syscall(SYS_userfaultfd, int " flags );
@@ -76,6 +77,15 @@ See the description of the
.BR O_NONBLOCK
flag in
.BR open (2).
+.TP
+.BR UFFD_USER_MODE_ONLY
+This is an userfaultfd specific flag that was introduced since Linux 5.11.
+When set, the userfaultfd object will only be able to handle page faults
+originated from the userspace on the registered regions.
+When a kernel originated fault was triggered on the registered range with
+this userfaultfd, a
+.BR SIGBUS
+signal will be delivered.
.PP
When the last file descriptor referring to a userfaultfd object is closed,
all memory ranges that were registered with the object are unregistered
--
2.32.0
next prev parent reply other threads:[~2022-05-31 1:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-31 1:11 [PATCH 0/2] userfaultfd.2: Update to latest Peter Xu
2022-05-31 1:11 ` Peter Xu [this message]
2022-06-03 17:11 ` [PATCH 1/2] userfaultfd.2: Add section for UFFD_USER_MODE_ONLY Alejandro Colomar
2022-06-03 17:34 ` Peter Xu
2022-05-31 1:11 ` [PATCH 2/2] userfaultfd.2: Update on write-protection support Peter Xu
2022-06-03 17:12 ` Alejandro Colomar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220531011157.46868-2-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=alx.manpages@gmail.com \
--cc=axelrasmussen@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mtk.manpages@gmail.com \
--cc=nadav.amit@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).