From patchwork Tue May 31 01:11:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12865015 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 03990C433F5 for ; Tue, 31 May 2022 01:12:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65CC46B0073; Mon, 30 May 2022 21:12:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5EC026B0074; Mon, 30 May 2022 21:12:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3EB676B0075; Mon, 30 May 2022 21:12:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 2DC306B0073 for ; Mon, 30 May 2022 21:12:05 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 079EB33DE8 for ; Tue, 31 May 2022 01:12:05 +0000 (UTC) X-FDA: 79524261810.16.E5BD1D5 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf04.hostedemail.com (Postfix) with ESMTP id 00B0540044 for ; Tue, 31 May 2022 01:11:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653959523; 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=B1zh0G6TK+W9pGc27qGuRakMVqnavlPCuAI+rVxzeGY=; b=IFIpCeHiSk4bLP5fBGzQx09p1rOhloD9zKR+zs5w7AxXElnb6zvG6fLocWsfec6rd4Zo1n Ppb7gVa/MJYFB3N+WdO0hiDyXLej2xk99mtlToANQbHghrnYpFPXMaWF6OjbdLw4dX+2ml 8dhpsILqsZOFVb1QHpCT7t4Zia4zHGM= Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-614-8E196P82OcuX8o5kk8J_Kg-1; Mon, 30 May 2022 21:12:02 -0400 X-MC-Unique: 8E196P82OcuX8o5kk8J_Kg-1 Received: by mail-il1-f199.google.com with SMTP id a3-20020a924443000000b002d1bc79da14so9251647ilm.15 for ; Mon, 30 May 2022 18:12:02 -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=B1zh0G6TK+W9pGc27qGuRakMVqnavlPCuAI+rVxzeGY=; b=b97oze3SCMHTw14514FbKIaQ2oF1+hqQkRTd4EV30I2vTcX5fBhManePvf/GyDiKlO PFHfel61CWLM62mSONByw5BkJg7m3DablLERvBYXu+se15claPid3JA9manuGqCMtjid qesW3PchW59uAguCMP7yBLuHvIj+qrVaIYmSOTOqSmzwWP1vRZ5t+u3jSH9c4m1mNHKH MbRSUhtq2mahWXDHxf1S5su2I1c7cMdaQ8S+SOQz7g91emRTF0+Wwh4ed38+u9qTlZh+ sEfnofONE1f1TQNczyVN43lsMhZ2MbiKqI/7M5USdKX1OBYvV0A6lvMbcT/ZfemGyqjC QXGw== X-Gm-Message-State: AOAM532htgFQsflZdTftS7g9d7PoSnfHcLukHvFI/rcvYkzdsSwYMqvn oHc68nUHi47eEX236sU1Kh45NBvQ1o7TX1s//FRTm2vyR66Gj+1G/HC1mzkEhLkX5bQfDis3X6l O+y9GdhB/cio= X-Received: by 2002:a05:6638:22c1:b0:331:f39:dc21 with SMTP id j1-20020a05663822c100b003310f39dc21mr6075895jat.75.1653959522042; Mon, 30 May 2022 18:12:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8O9HB/EdT6K2oS1Z/LDBvAFHH91nKVvI12INxaRwhBYX3fQMWWp9l9Gk9CQfAnLC9UW9O4A== X-Received: by 2002:a05:6638:22c1:b0:331:f39:dc21 with SMTP id j1-20020a05663822c100b003310f39dc21mr6075887jat.75.1653959521805; Mon, 30 May 2022 18:12:01 -0700 (PDT) Received: from localhost.localdomain (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id s6-20020a02c7c6000000b0032be3784b9bsm3158234jao.117.2022.05.30.18.12.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 30 May 2022 18:12:01 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-man@vger.kernel.org, linux-mm@kvack.org Cc: Alejandro Colomar , Michael Kerrisk , Axel Rasmussen , Andrea Arcangeli , peterx@redhat.com, Nadav Amit , Andrew Morton Subject: [PATCH 1/2] userfaultfd.2: Add section for UFFD_USER_MODE_ONLY Date: Mon, 30 May 2022 21:11:56 -0400 Message-Id: <20220531011157.46868-2-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220531011157.46868-1-peterx@redhat.com> References: <20220531011157.46868-1-peterx@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 00B0540044 X-Stat-Signature: ay4ason47nugsfg9fraqz6qdcz4sbmyw Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=IFIpCeHi; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf04.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com X-Rspam-User: X-HE-Tag: 1653959505-754549 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 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 " " /* 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 ); @@ -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