Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1431733AbdDYQ3p (ORCPT ); Tue, 25 Apr 2017 12:29:45 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:32947 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1431792AbdDYQ30 (ORCPT ); Tue, 25 Apr 2017 12:29:26 -0400 From: Mike Rapoport To: "Michael Kerrisk (man-pages)" Cc: Andrea Arcangeli , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-man@vger.kernel.org, Mike Rapoport Subject: [PATCH 3/5] ioctl_userfaultfd.2: update UFFDIO_API description Date: Tue, 25 Apr 2017 19:29:06 +0300 X-Mailer: git-send-email 1.9.1 In-Reply-To: <1493137748-32452-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1493137748-32452-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17042516-0016-0000-0000-00000487B068 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042516-0017-0000-0000-00002765DE14 Message-Id: <1493137748-32452-4-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-25_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1704250296 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1886 Lines: 65 Signed-off-by: Mike Rapoport --- man2/ioctl_userfaultfd.2 | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2 index 78abc4d..dade631 100644 --- a/man2/ioctl_userfaultfd.2 +++ b/man2/ioctl_userfaultfd.2 @@ -95,11 +95,6 @@ struct uffdio_api { The .I api field denotes the API version requested by the application. -Before the call, the -.I features -field must be initialized to zero. -In the future, it is intended that this field can be used to ask -whether particular features are supported. The kernel verifies that it can support the requested API version, and sets the @@ -109,9 +104,40 @@ and fields to bit masks representing all the available features and the generic .BR ioctl (2) operations available. -Currently, zero (i.e., no feature bits) is placed in the + +For Linux kernel versions before 4.11, the +.I features +field must be initialized to zero before the call to +.I UFFDIO_API +, and zero (i.e., no feature bits) is placed in the +.I features +field by the kernel upon return from +.BR ioctl (2). + +Starting from Linux 4.11, the +.I features +field can be used to to ask whether particular features are supported +and explicitly enable userfaultfd features that are disabled by default. +The kernel always reports all the available features in the .I features field. +.\" FIXME add more details about feature negotiation and enablement + +Since Linux 4.11, the following feature bits may be set: +.TP +.B UFFD_FEATURE_EVENT_FORK +.TP +.B UFFD_FEATURE_EVENT_REMAP +.TP +.B UFFD_FEATURE_EVENT_REMOVE +.TP +.B UFFD_FEATURE_EVENT_UNMAP +.TP +.B UFFD_FEATURE_MISSING_HUGETLBFS +.TP +.B UFFD_FEATURE_MISSING_SHMEM +.\" FIXME add feature description + The returned .I ioctls field can contain the following bits: -- 1.9.1