From patchwork Tue Sep 19 16:47:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Perevalov X-Patchwork-Id: 9959731 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0374260568 for ; Tue, 19 Sep 2017 17:21:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4DB41FFB9 for ; Tue, 19 Sep 2017 17:21:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C846E28ED4; Tue, 19 Sep 2017 17:21:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 346E41FFB9 for ; Tue, 19 Sep 2017 17:21:56 +0000 (UTC) Received: from localhost ([::1]:44247 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duMDb-0004ZD-EV for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Sep 2017 13:21:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duLhF-0001Cr-4m for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:48:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duLhB-0006NB-6w for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:48:29 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:33235) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1duLhB-0006LP-0h for qemu-devel@nongnu.org; Tue, 19 Sep 2017 12:48:25 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20170919164822euoutp0163fb4a5190ee5f20e78667ac97088d04~l0Tso17Tl2610726107euoutp01k; Tue, 19 Sep 2017 16:48:22 +0000 (GMT) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170919164821eucas1p2a8d6b22b32977bda0cf74a6dd68eddb7~l0Tr5zqHI0045800458eucas1p2a; Tue, 19 Sep 2017 16:48:21 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 38.6F.12907.55A41C95; Tue, 19 Sep 2017 17:48:21 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170919164820eucas1p25f16f91aa65933fa18cdff7cb7b7444c~l0Tq-Nvb10045800458eucas1p2Z; Tue, 19 Sep 2017 16:48:20 +0000 (GMT) X-AuditID: cbfec7f1-f793a6d00000326b-33-59c14a55be31 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id C2.6C.18832.45A41C95; Tue, 19 Sep 2017 17:48:20 +0100 (BST) Received: from aperevalov-ubuntu.rnd.samsung.ru ([106.109.129.199]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OWJ003OHDC8XU40@eusync1.samsung.com>; Tue, 19 Sep 2017 17:48:20 +0100 (BST) From: Alexey Perevalov To: qemu-devel@nongnu.org Date: Tue, 19 Sep 2017 19:47:55 +0300 Message-id: <1505839684-10046-2-git-send-email-a.perevalov@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1505839684-10046-1-git-send-email-a.perevalov@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFIsWRmVeSWpSXmKPExsWy7djPc7qhXgcjDaY+FbeYe/c8i0Xvtnvs FhPfrme1mPb5NrvFlfaf7BZb9n9jtzjeu4PF4s6WPiYHDo8n1zYzebzfd5XNo2/LKsYA5igu m5TUnMyy1CJ9uwSujA2bVrEXzOavuHb3OVsDYxdPFyMnh4SAicSEF6tZIWwxiQv31rN1MXJx CAksZZToeH2WHcL5zCjx4/kxoAwHWEfP1gSI+DJGiZPbZ0J1dDNJHOk8zwpSxCZgILHvni3I VBEBSYnfXaeZQWqYBbYwSty59xpsnbCAv8TM5uPsIPUsAqoSRx6rgYR5Bdwl9vyYzQZxkZzE yWOTwco5BTwkbh1fC3aQhMAENonFtydAFblInL55hBnCFpZ4dXwLO4QtI9HZcZAJoqGdUaJ7 ZycrVDejxJnpf6Gq7CVO3bzKBGIzC/BJTNo2nRniTV6JjjYhiBIPiSUz5zNC2I4Sa3+eZIT4 eDajxM4LZxknMEovYGRYxSiSWlqcm55abKRXnJhbXJqXrpecn7uJERijp/8d/7iD8f0Jq0OM AhyMSjy8K2wORgqxJpYVV+YeYpTgYFYS4X3tBBTiTUmsrEotyo8vKs1JLT7EKM3BoiTOaxvV FikkkJ5YkpqdmlqQWgSTZeLglGpgXCoax7buCq8Ry+7G2RkxVUY/bO13hedd8z296eDULUa5 r2zbMjo1DtY0TTMOC5CcNktzSbDMZnUbwz9SK7eFGsWv712bnZC/J2vDPu+kWQGzvsXwZO16 YfOxMz54sbrzFI3jbF/ncX293nvz13JTrozzcpUH1iZsO33n92K+Ff+kDzfp7p+eo8RSnJFo qMVcVJwIAEcn1jLNAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphluLIzCtJLcpLzFFi42I5/e/4Zd0Qr4ORBp131Szm3j3PYtG77R67 xcS361ktpn2+zW5xpf0nu8WW/d/YLY737mCxuLOlj8mBw+PJtc1MHu/3XWXz6NuyijGAOYrL JiU1J7MstUjfLoErY8OmVewFs/krrt19ztbA2MXTxcjBISFgItGzNaGLkRPIFJO4cG89Wxcj F4eQwBJGiScr/rODJIQEepkkWhZmg9SzCRhI7LtnCxIWEZCU+N11mhmknllgC6PExuMrGUES wgK+EoenvGcBqWcRUJU48lgNJMwr4C6x58dsNohdchInj01mBbE5BTwkbh1fC7XKXeLG2utM Exh5FzAyrGIUSS0tzk3PLTbUK07MLS7NS9dLzs/dxAgMo23Hfm7ewXhpY/AhRgEORiUe3hU2 ByOFWBPLiitzDzFKcDArifC+dgIK8aYkVlalFuXHF5XmpBYfYpTmYFES5+3dszpSSCA9sSQ1 OzW1ILUIJsvEwSnVwMhwatn1DOHzfBcfO2bu1r7xOdC98lnZWa69R9d9kX1W+vRvTz2b+2z5 U9oHZ520f92WG5Ie+UrJ1v0R26t97BOrZskw1c7ubNWZFmP76cLZZcXHE3K233mYvGlN1u3t TlutT/4TYz1/R/TqrU05U/1+ONy/3L1Idc1vW76fJa/fK+xLZzl55QWvEktxRqKhFnNRcSIA 2K2mjB8CAAA= X-CMS-MailID: 20170919164820eucas1p25f16f91aa65933fa18cdff7cb7b7444c X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG+yCvOyEseyghOyekBtTZW5pb3IgRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?QWxleGV5IFBlcmV2YWxvdhtTUlItVmlydHVhbGl6YXRpb24g?= =?UTF-8?B?TGFiG1NhbXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-CMS-RootMailID: 20170919164820eucas1p25f16f91aa65933fa18cdff7cb7b7444c X-RootMTR: 20170919164820eucas1p25f16f91aa65933fa18cdff7cb7b7444c References: <1505839684-10046-1-git-send-email-a.perevalov@samsung.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 210.118.77.11 Subject: [Qemu-devel] [PATCH v10 01/10] userfault: update kernel header for UFFD_FEATURE_* X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heetae82.ahn@samsung.com, quintela@redhat.com, Alexey Perevalov , peterx@redhat.com, dgilbert@redhat.com, i.maximets@samsung.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This commit adds modification for UFFD_FEATURE_SIGBUS and UFFD_FEATURE_THREAD_ID. Signed-off-by: Alexey Perevalov --- linux-headers/linux/userfaultfd.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/linux-headers/linux/userfaultfd.h b/linux-headers/linux/userfaultfd.h index 9701772..b43cf0d 100644 --- a/linux-headers/linux/userfaultfd.h +++ b/linux-headers/linux/userfaultfd.h @@ -23,7 +23,9 @@ UFFD_FEATURE_EVENT_REMOVE | \ UFFD_FEATURE_EVENT_UNMAP | \ UFFD_FEATURE_MISSING_HUGETLBFS | \ - UFFD_FEATURE_MISSING_SHMEM) + UFFD_FEATURE_MISSING_SHMEM | \ + UFFD_FEATURE_SIGBUS | \ + UFFD_FEATURE_THREAD_ID) #define UFFD_API_IOCTLS \ ((__u64)1 << _UFFDIO_REGISTER | \ (__u64)1 << _UFFDIO_UNREGISTER | \ @@ -78,6 +80,9 @@ struct uffd_msg { struct { __u64 flags; __u64 address; + union { + __u32 ptid; + } feat; } pagefault; struct { @@ -153,6 +158,13 @@ struct uffdio_api { * UFFD_FEATURE_MISSING_SHMEM works the same as * UFFD_FEATURE_MISSING_HUGETLBFS, but it applies to shmem * (i.e. tmpfs and other shmem based APIs). + * + * UFFD_FEATURE_SIGBUS feature means no page-fault + * (UFFD_EVENT_PAGEFAULT) event will be delivered, instead + * a SIGBUS signal will be sent to the faulting process. + * + * UFFD_FEATURE_THREAD_ID pid of the page faulted task_struct will + * be returned, if feature is not requested 0 will be returned. */ #define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0) #define UFFD_FEATURE_EVENT_FORK (1<<1) @@ -161,6 +173,8 @@ struct uffdio_api { #define UFFD_FEATURE_MISSING_HUGETLBFS (1<<4) #define UFFD_FEATURE_MISSING_SHMEM (1<<5) #define UFFD_FEATURE_EVENT_UNMAP (1<<6) +#define UFFD_FEATURE_SIGBUS (1<<7) +#define UFFD_FEATURE_THREAD_ID (1<<8) __u64 features; __u64 ioctls;