From patchwork Tue Sep 19 19:02:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Rasmussen X-Patchwork-Id: 13391775 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 9F1DDCE79AB for ; Tue, 19 Sep 2023 19:02:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3D4EC6B00BC; Tue, 19 Sep 2023 15:02:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 336216B00BD; Tue, 19 Sep 2023 15:02:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13A2D6B00BE; Tue, 19 Sep 2023 15:02:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id F25B46B00BC for ; Tue, 19 Sep 2023 15:02:28 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id B024EC0DFC for ; Tue, 19 Sep 2023 19:02:28 +0000 (UTC) X-FDA: 81254267976.04.C29B491 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) by imf04.hostedemail.com (Postfix) with ESMTP id BB93F40002 for ; Tue, 19 Sep 2023 19:02:26 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=jzRoDWQV; spf=pass (imf04.hostedemail.com: domain of 3QfAJZQ0KCHgWtahnWoiqooajckkcha.Ykihejqt-iigrWYg.knc@flex--axelrasmussen.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3QfAJZQ0KCHgWtahnWoiqooajckkcha.Ykihejqt-iigrWYg.knc@flex--axelrasmussen.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695150146; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=NEXa90h/68GUsd6orjyORkWHy9a7mT47IoYQaYRrJqY=; b=NNhLm0YijYCdzB6F5ISFh5ZxjUofGPCQIJoyueMLRzRh9PZ4j99WlKY5vOv9JnWoGMLJx8 g4FAJSiAIMXIQpL0Ljv6Ioz6P9UrJgxeKf/IXqaZZGXZQ0z+L1rrjTCWaNCATtogtnACi6 6fxiSG8Xjxh7lRsAjq5XvgeLIfNClb0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695150146; a=rsa-sha256; cv=none; b=aBlrtMS/QlqMmf6wgcLBgNwMDIBz+CrEWY7NG4qC1Tra4zrob1oSO7jKBl5MXsNRPjoFKa Bz6pcj22e4l66LlASZnbRzYP+A52CxbNLOxMvWcaVRwBp4ynawrvav1BOgoGXY6QZzVTlD FqWHMu8Ihfli25WU6cLyoN8wRCe+W5I= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=jzRoDWQV; spf=pass (imf04.hostedemail.com: domain of 3QfAJZQ0KCHgWtahnWoiqooajckkcha.Ykihejqt-iigrWYg.knc@flex--axelrasmussen.bounces.google.com designates 209.85.219.202 as permitted sender) smtp.mailfrom=3QfAJZQ0KCHgWtahnWoiqooajckkcha.Ykihejqt-iigrWYg.knc@flex--axelrasmussen.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-d814634fe4bso6613708276.1 for ; Tue, 19 Sep 2023 12:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695150146; x=1695754946; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=NEXa90h/68GUsd6orjyORkWHy9a7mT47IoYQaYRrJqY=; b=jzRoDWQVkHkDogMwEs0Tl4z8JwkiYyUAXvqe9n3jmEgX2gt17otAut4U3OML+zhSsZ yC9jjBHenmXyaNA6pW1trrZyEOXV5baxzNTFYQP73jW9iREPMb3jrF1tIZtMwZMXZLfM Q/Op2zZlnI+1P/FbrYQ4wlNKwtnx8hv/gRw4+FK6oY6RkdnjYnCJixTu9/XEf5a+3Si3 n8zkpep9QlShLszbSf1IveY6pgSUyN+7exgnqHuuyWevdYuN9nKIJ4/4vBvvRus9tbdx +l7eFDWhBlArVLKswWfbgJSvXe8dnbbe5804nPrVLMcJGP+6lqUjblfDGHF2Ty9YVCJT 0tmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695150146; x=1695754946; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NEXa90h/68GUsd6orjyORkWHy9a7mT47IoYQaYRrJqY=; b=UKaU5aRctLVT5YpkBMvN7bM8kALk8VXYIfAvDifBJhKEu2mrdwxVzOkvX/q2eGYYsm qW41pByLo1lHBaos9PtsTl8nf/k+WfKF167I5C+02+e5K/+/2L4TPXT01fOmMWdhQW0V Ly1TngsHt+oipgqNO9ic2PEhn4U9DkO9RCH290sdrcsTxONbY7O1P0FVxm4KJHW+NJYc 3VxFeVMWsyUqZmwGH029eQ70hyt/H172vS1++YpvsqTkWDUMrHBTeQqiRnZUoJKyWhVe Pxp+jkhNw4xm6ZH72+Da/c7KW7A8xmpQyxQbcORZeFXpL1HHHgFlJS0SrtbXUELduAKR d7gA== X-Gm-Message-State: AOJu0YyvQ/+Maimrj6RJibfXtIO5hYHjdzCjTz2+Nh+4qZAC8GEmnvvh iMsCP562RJ714lopu8shHd7WMJbutaLyVjpHbSv/ X-Google-Smtp-Source: AGHT+IFCWTBj+STf+JQII+aukLsaaJkmL6LUdqEggx41JkN/znYtNCrIQg6lN+ju+ooY+qcE8V78UIKtBAjD3/9uU5Cw X-Received: from axel.svl.corp.google.com ([2620:15c:2a3:200:8f5a:6a6a:cafc:a3ad]) (user=axelrasmussen job=sendgmr) by 2002:a25:6802:0:b0:d7b:3917:4606 with SMTP id d2-20020a256802000000b00d7b39174606mr6912ybc.11.1695150145976; Tue, 19 Sep 2023 12:02:25 -0700 (PDT) Date: Tue, 19 Sep 2023 12:02:02 -0700 In-Reply-To: <20230919190206.388896-1-axelrasmussen@google.com> Mime-Version: 1.0 References: <20230919190206.388896-1-axelrasmussen@google.com> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog Message-ID: <20230919190206.388896-7-axelrasmussen@google.com> Subject: [PATCH 06/10] ioctl_userfaultfd.2: describe missing UFFDIO_API feature flags From: Axel Rasmussen To: Alejandro Colomar , Peter Xu Cc: linux-man@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Axel Rasmussen X-Rspamd-Queue-Id: BB93F40002 X-Rspam-User: X-Stat-Signature: shc1jxwhqwf1kyjdhcxqhqubh56odiny X-Rspamd-Server: rspam03 X-HE-Tag: 1695150146-343546 X-HE-Meta: U2FsdGVkX1/I2odIQnu3/+TQHvDmBmIBCWo8REE5USMJeMCxpwpHToHReDVqggLE9+kGWQUOeQpkPLEa8BVMDTxt8exKd1kKBAIN2bwMWuo+fY90X8y08Yd8qk+mvag0NZm8ALS06s9nxx2lAs/lBTGQVFgbU9Ee9UdYsiZWQFIHa6I9swrEo2LjM8dxmqkLCUHUt/QcqphFc41KYTjDU5otKMj5fTusPho9VaS5wijMCL4pwiEpT4C6+U/kT5srv9c2yBPuNih2GSrU/DUl1hkCUl2EtT08cd6hfSTXa4252yYyxvAwl0En1mB7vbYS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sW42b7rzOG/kNEEcqYnIXNCBK3WSpfZobHPysLRd2SeSSgnt6pVTZIvgBpy3KJCzPkULilhK+uMla7zC9gD3mMMyaSqsIwpVaBU6f69Ksj3AvaYsLZrVfLZpuIxRLmh1UlQD+SoraIhDtInCSgzxLYJ51upnu+yOuZ5p9XZpkT7+cbX4li7Njf6KHm+r4v1r4VQlNr9qJnsC+3HjNSvREswK3Li7p42pjLUdwNi4ufbOc/qhP5dGFQqErnJFLvhn2wqUzMkPn6lL7L7EF0oWHnGNXCsll+afsssOJkwYhT3kKHWqy4o= X-Bogosity: Ham, tests=bogofilter, spamicity=0.254497, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Several new features have been added to the kernel recently, and the man page wasn't updated to describe these new features. So, add in descriptions of any missing features. Signed-off-by: Axel Rasmussen Reviewed-by: Mike Rapoport (IBM) --- man2/ioctl_userfaultfd.2 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/man2/ioctl_userfaultfd.2 b/man2/ioctl_userfaultfd.2 index e91a1dfc8..53b1f473f 100644 --- a/man2/ioctl_userfaultfd.2 +++ b/man2/ioctl_userfaultfd.2 @@ -204,6 +204,13 @@ If this feature bit is set, .I uffd_msg.pagefault.feat.ptid will be set to the faulted thread ID for each page-fault message. .TP +.BR UFFD_FEATURE_PAGEFAULT_FLAG_WP " (since Linux 5.10)" +If this feature bit is set, +userfaultfd supports write-protect faults +for anonymous memory. +(Note that shmem / hugetlbfs support +is indicated by a separate feature.) +.TP .BR UFFD_FEATURE_MINOR_HUGETLBFS " (since Linux 5.13)" If this feature bit is set, the kernel supports registering userfaultfd ranges @@ -221,6 +228,22 @@ will be set to the exact page-fault address that was reported by the hardware, and will not mask the offset within the page. Note that old Linux versions might indicate the exact address as well, even though the feature bit is not set. +.TP +.BR UFFD_FEATURE_WP_HUGETLBFS_SHMEM " (since Linux 5.19)" +If this feature bit is set, +userfaultfd supports write-protect faults +for hugetlbfs and shmem / tmpfs memory. +.TP +.BR UFFD_FEATURE_WP_UNPOPULATED " (since Linux 6.4)" +If this feature bit is set, +the kernel will handle anonymous memory the same way as file memory, +by allowing the user to write-protect unpopulated ptes. +.TP +.BR UFFD_FEATURE_POISON " (since Linux 6.6)" +If this feature bit is set, +the kernel supports resolving faults with the +.B UFFDIO_POISON +ioctl. .PP The returned .I ioctls