From patchwork Fri Jun 3 17:37:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12869263 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0658EC43334 for ; Fri, 3 Jun 2022 17:37:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 88C4A6B0074; Fri, 3 Jun 2022 13:37:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 822446B0073; Fri, 3 Jun 2022 13:37:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 68ABC8D0001; Fri, 3 Jun 2022 13:37:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 591B96B0071 for ; Fri, 3 Jun 2022 13:37:44 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 32D433519C for ; Fri, 3 Jun 2022 17:37:44 +0000 (UTC) X-FDA: 79537632048.21.1850838 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf05.hostedemail.com (Postfix) with ESMTP id 7071C100012 for ; Fri, 3 Jun 2022 17:37:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654277863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0aUCBdDLRZgXZUTdZmjGfl1wafgZ6gf3pWlYAS6s0rQ=; b=FIuKj2qsB99FY6HenwnZHX6SZQNpZgNhiM7rconN7fNcIjkPISQ01bFFQG2If7xbT2dah6 dXF33OcNh+luz+z7saY59xZjFfZ3xLWQrEfwWjNwjqiD8urAXNeko7i4qpcVYf087dGc8H 6/B1PA5hfrJ9qs2i3iJV1tq1rpUKfp0= Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-26-Jd5jztrpOb-WwSnufp7TXQ-1; Fri, 03 Jun 2022 13:37:42 -0400 X-MC-Unique: Jd5jztrpOb-WwSnufp7TXQ-1 Received: by mail-il1-f198.google.com with SMTP id w7-20020a056e021c8700b002d3bc8e95cbso6692352ill.3 for ; Fri, 03 Jun 2022 10:37:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0aUCBdDLRZgXZUTdZmjGfl1wafgZ6gf3pWlYAS6s0rQ=; b=BBPgqvYWAPB3oZlo7G+316KStbrorJm+gTXB/4N6JIRzmmZhtomyPf440sh6XCLhUH pfGG756SCSfSHzhvq0XvTrBKGuIdvQxLY24W5tj+uxkWN45tbdeQlFpbVSeqbnzkGdrC +KqecQlOSjPzjS9Kyr3/fgRvuWMmIvGon21tnwgePUleOIrKLuje91ATxrOpU+bqj9Vm 1WQPDHhD0ZaMcq4mG5jydnUjLUdJiDjnlFu1DXsdPA/WtHOT2HeUC/5MwglLCdzkcs6T VYtirq+DUovDV1x/STgL911bEGGzsJ8U5HeqsXFe+z9jxl7gmUSoqiYWmhmvDEW3PkR6 rKmw== X-Gm-Message-State: AOAM530Ld0E5mepbJBtIP/6Dn6h/vDsjp9kQJHNlFH9VPqJBMqUOepWc 9t2PechYJOGk+iw4PYkY9hF4teIcMjBb+Ry6t0iWeaN0qh+a93krr0B2j7m2Z8D+rlwBVAPNPGC uxC9CurCrJ0A= X-Received: by 2002:a02:ce8b:0:b0:331:6050:6171 with SMTP id y11-20020a02ce8b000000b0033160506171mr6014963jaq.319.1654277861359; Fri, 03 Jun 2022 10:37:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxT5yNyOJqrMirvzChd6Jq1GY7aquh0xWawRy0pwsachq+SjLrMtUXFuDfeFTAii6nzxub+Mw== X-Received: by 2002:a02:ce8b:0:b0:331:6050:6171 with SMTP id y11-20020a02ce8b000000b0033160506171mr6014940jaq.319.1654277860823; Fri, 03 Jun 2022 10:37:40 -0700 (PDT) Received: from localhost.localdomain (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id g23-20020a02bb97000000b0032e1e0ac289sm2791117jan.8.2022.06.03.10.37.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Jun 2022 10:37:40 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-man@vger.kernel.org, linux-mm@kvack.org Cc: Michael Kerrisk , Andrea Arcangeli , Alejandro Colomar , Nadav Amit , Axel Rasmussen , Andrew Morton , peterx@redhat.com Subject: [PATCH v2 1/2] userfaultfd.2: Add section for UFFD_USER_MODE_ONLY Date: Fri, 3 Jun 2022 13:37:35 -0400 Message-Id: <20220603173736.62581-2-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220603173736.62581-1-peterx@redhat.com> References: <20220603173736.62581-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=FIuKj2qs; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf05.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 7071C100012 X-Rspam-User: X-Stat-Signature: qwwxkscb8pzf5yj84kqc477cxnwstmpy X-HE-Tag: 1654277827-391569 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Add a paragraph for UFFD_USER_MODE_ONLY flag that was introduced in Linux 5.11. Signed-off-by: Peter Xu --- man2/userfaultfd.2 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2 index 93dca009f..6b9412aaf 100644 --- a/man2/userfaultfd.2 +++ b/man2/userfaultfd.2 @@ -12,8 +12,9 @@ Standard C library .RI ( libc ", " \-lc ) .SH SYNOPSIS .nf -.BR "#include " " /* Definition of " O_* " constants */" -.BR "#include " " /* Definition of " SYS_* " constants */" +.BR "#include " " /* Definition of " O_* " constants */" +.BR "#include " " /* Definition of " SYS_* " constants */" +.BR "#include " " /* Definition of " UFFD_* " constants */" .B #include .PP .BI "int syscall(SYS_userfaultfd, int " flags ); @@ -59,6 +60,15 @@ See the description of the .B O_NONBLOCK flag in .BR open (2). +.TP +.B 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 +.B 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