From mboxrd@z Thu Jan 1 00:00:00 1970 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 84687C433EF for ; Tue, 26 Apr 2022 20:33:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C5D66B0075; Tue, 26 Apr 2022 16:33:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 14F116B0078; Tue, 26 Apr 2022 16:33:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE3EE6B007B; Tue, 26 Apr 2022 16:33:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id DD7C36B0075 for ; Tue, 26 Apr 2022 16:33:04 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 307BB20F70 for ; Tue, 26 Apr 2022 20:33:04 +0000 (UTC) X-FDA: 79400179488.03.47711DC Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf11.hostedemail.com (Postfix) with ESMTP id E996E4004C for ; Tue, 26 Apr 2022 20:33:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651005183; 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: in-reply-to:in-reply-to:references:references; bh=qJupZ9EKBhCX8US4p7GIAW6BSuQyT3fJWSWGs492ld4=; b=XRghbmOtv73zpJl3Ez76GQSI3MdzswbE96Ikcw+PZLeJFEW+OTQLjfX+KHoI2rI0Fng60W 6LX0D1rVpirqE8mj920zZkkO15/n9kaze6u8pc//D8bKwF1YdyYy8rgyaFbWQWGBhIuy06 gKWRYpQ2C1IaZ8YuZfGP1BksunWk314= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-468-d0RHXC9-Of29EclvKFY6cg-1; Tue, 26 Apr 2022 16:33:01 -0400 X-MC-Unique: d0RHXC9-Of29EclvKFY6cg-1 Received: by mail-io1-f70.google.com with SMTP id y20-20020a5e8714000000b0065494b96af2so2601ioj.10 for ; Tue, 26 Apr 2022 13:33:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qJupZ9EKBhCX8US4p7GIAW6BSuQyT3fJWSWGs492ld4=; b=Y8Rs4zzdtbVfMIjxabdPqSNAk4tF20a0cVZLvhIKJ2/q1BZVoy2hGIljyUFc/t4Lnv rTRJwjf9HTwWVlzSoiH2tLaUpRywB8AeH0nXtAdwYse5vxpPa+8z5B/6X8M9lioeYxQu t1CcmZZEmD+Tb47AJeLKIheEntnqjrAyrOYWNPb289qDcl/mCE8skD0kfbDZX26ZYrBa oXHQLt4SerG+Z1Wtea9/6fR6M0TEz2cWSBO0mFJ69+EcoXkLdQLtGk/256wfOEBaMfI5 MhoUqT7yIz3SAl/4qrJVY/oO6wjqm4X6BnFAeuG8psgWV0IawDcnm/SVQ8LxyFzOBUXh 1SPQ== X-Gm-Message-State: AOAM532vhqWpixGQ7xtnI73o8CNO1U5KOQtMW3pYzLz6OjxiPn/RL59T ZEaxAaoJjjoiR2fcw5PJfl1xdA5es91NBhemubKtTzrDqNlMPLDzi31F81trgKuqkI+MT6fn1xC HUkvWZPeJIyw= X-Received: by 2002:a05:6638:1487:b0:328:6e36:39e4 with SMTP id j7-20020a056638148700b003286e3639e4mr10263041jak.202.1651005181064; Tue, 26 Apr 2022 13:33:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxv3DOWZkK6AhpbIXCeFJ2/lY2z7CXm1JNRmILCaRK5MqEyMqTOfcKl6cB6RwB1JoqOHBf6sQ== X-Received: by 2002:a05:6638:1487:b0:328:6e36:39e4 with SMTP id j7-20020a056638148700b003286e3639e4mr10263012jak.202.1651005180758; Tue, 26 Apr 2022 13:33:00 -0700 (PDT) Received: from xz-m1.local (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id x186-20020a6bc7c3000000b00648deae6630sm10449855iof.54.2022.04.26.13.32.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Apr 2022 13:33:00 -0700 (PDT) Date: Tue, 26 Apr 2022 16:32:58 -0400 From: Peter Xu To: Axel Rasmussen Cc: Alexander Viro , Andrew Morton , Charan Teja Reddy , Dave Hansen , "Dmitry V . Levin" , Gleb Fotengauer-Malinovskiy , Hugh Dickins , Jan Kara , Jonathan Corbet , Mel Gorman , Mike Kravetz , Mike Rapoport , Nadav Amit , Shuah Khan , Suren Baghdasaryan , Vlastimil Babka , zhangyi , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v2 2/6] userfaultfd: add /dev/userfaultfd for fine grained access control Message-ID: References: <20220422212945.2227722-1-axelrasmussen@google.com> <20220422212945.2227722-3-axelrasmussen@google.com> MIME-Version: 1.0 In-Reply-To: <20220422212945.2227722-3-axelrasmussen@google.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Stat-Signature: 9qm9p68p1wt598zfmyfw1xpgbc18nwoz Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=XRghbmOt; spf=none (imf11.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: E996E4004C X-HE-Tag: 1651005180-853975 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: Axel, On Fri, Apr 22, 2022 at 02:29:41PM -0700, Axel Rasmussen wrote: > @@ -65,6 +66,8 @@ struct userfaultfd_ctx { > unsigned int flags; > /* features requested from the userspace */ > unsigned int features; > + /* whether or not to handle kernel faults */ > + bool handle_kernel_faults; Could you help explain why we need this bool? I failed to figure out myself on the difference against "!(ctx->flags & UFFD_USER_MODE_ONLY)". Thanks, -- Peter Xu