Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3095232pxp; Tue, 8 Mar 2022 07:38:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlKtTRPX0qKZh2fg/5m29vkWNurZr9cflBBKfTykHEmfqKNmZJFsTBEXcCeMO/UVAq5Hzb X-Received: by 2002:a05:6402:42c6:b0:416:541:4be1 with SMTP id i6-20020a05640242c600b0041605414be1mr16867088edc.238.1646753912068; Tue, 08 Mar 2022 07:38:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646753912; cv=none; d=google.com; s=arc-20160816; b=aCFe5m0NP2X8Ppc0N+IzfNQKKguxzXMIGP5XdSPoUrPx7IBbRF01dQBrwo9V7VOWnQ fmG/ZvoKGkS68JEGkVLcpLDcMsRvKjp5DR/l8AGNr8dwCMJqiERjoZ7AujC17V+fK8Ad IBuPmKNahoH/LWwpqL6Qjae4lAcjqjuDYGDqFzKbfrc1ZjvJTSiYt411gEKbFluNFuNX AB0dj1TMnTFxhSGyWZU+RiiIVweRGnNlnE4qlkhpf5W1Jjs7smWgbHhMeO/ID4yKMl9q 9IP240E75twIoZjiccAMRkvsW2dCdsLV2WV3+GN2uZra6mihlYm876VM/ocLqDNm9Q7y Q+uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=OFA2/eM8lwGnQdw8L8HYozWRTs8bN4HRmWhwr7+OpfQ=; b=MhOwVaBGXhb877kwfPGu9Wm9fOnvy1i/vznSOspexJkCdKg3OCCnMqM+j8x5xvCOl1 5EweHiu4GRl77ZPXrWcTEMhzUTHuA2I8HHmQdaD0iA7sRf0v7qhtJgHEuomDA0AGlK4k Up27/5u7P8bQb87vMaNQ1wnsGO0aTzE5rekoQ+6g6mQD3QonO4Sfg8Uo7LLeya8jAdQG CquF7G7AE0HZ5GjhyFMjpYuqlmI0fbccz/Za2N3JlXn+JG8hljxbUYt56Mx18yDcuH7n NDAV2sYoxYM/LJQ7UYF0mkY7MFaKMemnLDbWS6cWzuSxfE8ckuIXTCzNti9276Zkm8Ea 11xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dZxiz91c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e1-20020a170906044100b006cddb1926adsi9659473eja.65.2022.03.08.07.38.07; Tue, 08 Mar 2022 07:38:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dZxiz91c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346732AbiCHMSV (ORCPT + 99 others); Tue, 8 Mar 2022 07:18:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346780AbiCHMSD (ORCPT ); Tue, 8 Mar 2022 07:18:03 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A711E43EEC; Tue, 8 Mar 2022 04:17:06 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id qa43so38708312ejc.12; Tue, 08 Mar 2022 04:17:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=OFA2/eM8lwGnQdw8L8HYozWRTs8bN4HRmWhwr7+OpfQ=; b=dZxiz91cR9d8+CC4dJkv0i2jFfJ9CP0b3NlEsXD6TPHMGYacNdhru2mSELTl8O+6T+ FkPBsspyt6yrQV1UNk0fLDyvuyTBbsyYl6/T/V6x+ZilvnI0NzYTKb6PgY7cnu5zGc3W z8u6cgybLElr2aEZQqTCU+yd3hjzgyX32dfmIm7l1uFqFRVNXPWDahWbmtxQMKSxUF6t mDip2hxkD1fj4trIskXiu0dLQGix1y5LAmHMsfX0r/TW2pyZZX5NoWOICWOAFwOo7IeO jpGsIE8IKRoh4awk7E5UsjXtaPmC6jPN5sC8oetFJ5PMyH0bpwZVfBbDUpiUazI2kL/w rFpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=OFA2/eM8lwGnQdw8L8HYozWRTs8bN4HRmWhwr7+OpfQ=; b=r0OKZEy++X04LXgPuvGLZAV+xqgFCxlzL6HlMYMJf6JxxF04BeYhNVTU8XzJHIO8nk aZgZUXbLfjkjWXfxH8IlCdmW8F8TnOqVjczIF+iVuePU9vbwwSF244Ehvr/8uEROWI/L P+Cd8Nsi/7iE8uXREHzZFilsz4L3KlOesSuHvQhesdBNtpx7VQMZNMwdMTfYdQicBXBz EUO+8pqg1gLmbpI0OA1F7lwBkgmKDdyQ4tSZwzq0S2WmActedAslT1sAlmVkAOe0LTUz 3C0PbKqfPbYDP/HCR9xoMprgKFlwBbdR3Bgj8eIRx2J7NOMLyNmL5ySKWRzTneFvIZOc AYJg== X-Gm-Message-State: AOAM533xcSInz+ARxj+U1EvNpk0EEFQc8bJvKhJSrgEVCyMbHaV0G2kT Bo/trlK3AEy8vNwwSdMvW1/W9qLbtgY= X-Received: by 2002:a17:907:97cc:b0:6da:a8fb:d1db with SMTP id js12-20020a17090797cc00b006daa8fbd1dbmr13315004ejc.267.1646741825187; Tue, 08 Mar 2022 04:17:05 -0800 (PST) Received: from ?IPV6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.googlemail.com with ESMTPSA id r19-20020a17090638d300b006d6e4fc047bsm5886872ejd.11.2022.03.08.04.17.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Mar 2022 04:17:04 -0800 (PST) Sender: Paolo Bonzini Message-ID: <800a68f8-fbe0-5980-4290-bdc0ed4d05bd@redhat.com> Date: Tue, 8 Mar 2022 13:17:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v4 01/12] mm/shmem: Introduce F_SEAL_INACCESSIBLE Content-Language: en-US To: Chao Peng , Andy Lutomirski Cc: Steven Price , kvm list , Linux Kernel Mailing List , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, qemu-devel@nongnu.org, Linux API , Jonathan Corbet , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , the arch/x86 maintainers , "H. Peter Anvin" , Hugh Dickins , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Yu Zhang , "Kirill A. Shutemov" , "Nakajima, Jun" , Dave Hansen , Andi Kleen , David Hildenbrand References: <20220118132121.31388-1-chao.p.peng@linux.intel.com> <20220118132121.31388-2-chao.p.peng@linux.intel.com> <619547ad-de96-1be9-036b-a7b4e99b09a6@kernel.org> <20220217130631.GB32679@chaop.bj.intel.com> <2ca78dcb-61d9-4c9d-baa9-955b6f4298bb@www.fastmail.com> <20220223114935.GA53733@chaop.bj.intel.com> <71a06402-6743-bfd2-bbd4-997f8e256554@arm.com> <7cc65bbd-e323-eabb-c576-b5656a3355ac@kernel.org> <20220307132602.GA58690@chaop.bj.intel.com> From: Paolo Bonzini In-Reply-To: <20220307132602.GA58690@chaop.bj.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/7/22 14:26, Chao Peng wrote: >> In pseudo-Rust, this is the difference between: >> >> fn convert_to_private(in: &mut Memfd) >> >> and >> >> fn convert_to_private(in: Memfd) -> PrivateMemoryFd >> >> This doesn't map particularly nicely to the kernel, though. > I understand this Rust semantics and the difficulty to handle races. > Probably we should not expose F_SEAL_INACCESSIBLE to userspace, instead > we can use a new in-kernel flag to indicate the same thing. That flag > should be set only when the memfd is created with MFD_INACCESSIBLE. Yes, I like this. Paolo