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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE06EC433EF for ; Tue, 26 Apr 2022 20:33:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355016AbiDZUgb (ORCPT ); Tue, 26 Apr 2022 16:36:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355020AbiDZUgS (ORCPT ); Tue, 26 Apr 2022 16:36:18 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EADC71A816F for ; Tue, 26 Apr 2022 13:33:04 -0700 (PDT) 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-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-609-aeMKZdY5PzaXP7wfjG-wBw-1; Tue, 26 Apr 2022 16:33:01 -0400 X-MC-Unique: aeMKZdY5PzaXP7wfjG-wBw-1 Received: by mail-io1-f71.google.com with SMTP id k20-20020a5e9314000000b00649d55ffa67so15322315iom.20 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=HVVjsaJPNGfZuDCBzXZuqugGf4fJC1KL1d2VleheMJarWnGEgkVYf+K5f9i7zAcEGT 4U45dwXGQ7avdbutMFbmovEKFLXJwj49c/RYq9QhC4BOgaMH2nixVQPkr9nhm5KTAPYl sX2cLljfBL24FQKSDaLS82S8b3C7p3yiR2wKwDDpEuPJ+1zS/tjOlWUWcaWi2iCn2h6F eduy2rhsyn5qm5B6J3priHsFrYeoI8wuJxpl8evZxlmUV9kfyqjSHrOT3PWbE71pqGW6 fC6KkKp8obYxgZxQqA8WrXE9760GNedDyI8z32Pm0IA6gteVWC4wvy7IMxmAbBpAN96h JsKw== X-Gm-Message-State: AOAM532/3xwXibVa86yyE2wZIFFDG49/vuuMVny3BpiV8Jcu2y3BKAFZ /4l6Is2gC2nm94OSc+B/oPX3ZRbsNQ5HgzhspbLZVkzRBC8EI34eKU5nmojOzlbFAkPJnIVSdK8 +FrOv/7MdFWL+UVCFYZ0vN7ND X-Received: by 2002:a05:6638:1487:b0:328:6e36:39e4 with SMTP id j7-20020a056638148700b003286e3639e4mr10263033jak.202.1651005181059; 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 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220422212945.2227722-3-axelrasmussen@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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