Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3245902rwa; Tue, 23 Aug 2022 01:04:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR7EQbwUo8Adze6C9qbouaXsugSfK4JVhEvKUratTumfc3PKtA9IGh8XHPHt85eWojPlmUzk X-Received: by 2002:a05:6a00:9a5:b0:536:29e:c91d with SMTP id u37-20020a056a0009a500b00536029ec91dmr20138704pfg.22.1661241847664; Tue, 23 Aug 2022 01:04:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661241847; cv=none; d=google.com; s=arc-20160816; b=yKLzM+HaUApcwnuM7ajmGqwSwPMJL5KmImbnVSAfU/AqgM28tHObpwY/QSYvg1giRq Q97DdW8ruwI/2kqn5KYzma5S9c+GEW1MYvOwiQ7jRkUHUw27ZkqLNMzVeNxbyMHMtdHB VfY85saKZApEdvmteNvjmnWXYmGHJFXGp6sfnbs6nAsY5/ZnK9tMYyGGGBOR3B7ROWNM ZceH3Woip7zOyOnGcpJrKaT23jFs0ftEk+7gGU4gFOV6YyzGa8SpevDkkItBCSN/33Mu 2kDZbTKRLoUDypxNwT1/BdaC7Cu9nuZRvFOyQTb04NyH9zVGW7KOohznzCcCXivAHjQz XbuQ== 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:subject :organization:from:references:cc:to:content-language:user-agent :mime-version:date:message-id:dkim-signature; bh=EIwZ7BoTfdMUAhH2fOQC6fOziS/YjfnIvgRTO5vTHto=; b=RKHmeue6xiAwE/6EQQtVT8slKmkPXV42BnyG5yOrip3/pzCQMV53aEmRgsTIdBogiM ZvO2O45Erkxpg/fzLFWwBDfO6JZm8AmHw45UZxo5XzVfYRYL2a9dJ8Krsv/yyaJ7C/d3 NvmfBGBfRzZw6X8AuclIFfffdrqy0fJumE+LROS9ex9qlbNqJAaJjo72AJ9zQ/ziypxm 6gLOrNVnnE3s+VWzK3GSUhRBLLwWkWswLGO6XNgP3qs/AkgJN1rcz5PZwJc85/g4mg79 Qc0uqimwbaivqZwRwA3HgHZqYQ6P0pd8RZEyBIDxbnWZyqCgPiI9i741ijzAFjIFjMlq FkKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DyCI55Pu; 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=pass (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 t16-20020a17090aba9000b001fafc10a6ccsi10285222pjr.187.2022.08.23.01.03.56; Tue, 23 Aug 2022 01:04:07 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=DyCI55Pu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241418AbiHWHzS (ORCPT + 99 others); Tue, 23 Aug 2022 03:55:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239227AbiHWHzK (ORCPT ); Tue, 23 Aug 2022 03:55:10 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB8911EEE1 for ; Tue, 23 Aug 2022 00:55:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661241309; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EIwZ7BoTfdMUAhH2fOQC6fOziS/YjfnIvgRTO5vTHto=; b=DyCI55PulUdOrmKB+WgGxp1BNPAeh4juvIPpeXCF87rXoNnLnpMySUbuwRhr2S0tj1ME19 XoH2s5lhUgWm3ytjpdAK5bRJwjnYlJotPWAxLQCFL+JlZGmvCyohxuntZ48XyDsa5fE2YY haGZa/VSZ6I6oWfy2Vr9bHAQfLHmsYI= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-102-nLWupQfiOBSGzat2CkmbMA-1; Tue, 23 Aug 2022 03:55:07 -0400 X-MC-Unique: nLWupQfiOBSGzat2CkmbMA-1 Received: by mail-wm1-f72.google.com with SMTP id f18-20020a05600c4e9200b003a5f81299caso7594930wmq.7 for ; Tue, 23 Aug 2022 00:55:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:organization:from :references:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc; bh=EIwZ7BoTfdMUAhH2fOQC6fOziS/YjfnIvgRTO5vTHto=; b=JsEpgi02ogkiNHqTZQiNQNf0eAqsqhRvH05OVJiMj53mfMTrVKYVLUNWRlWHiH2pdm e57UmbYSmYlHXkUowDNLVvWitYUThNywtOP3IBNxtNtBrN9XDcLx682ujQv1xr5C9ONv MKCp2tjVtyZxjlFPaNIgjtBUsCGruJRnfuDHolZbNEhJDmEc74JCIf6Tk4op9wuzAjgg RUyDIclF94XFIUwNd3g8ioSr+0nlPzc24F6XfTkisC96x3uc83bYth7hvY6jJm0wRnPb LgFE0TF7aTbEChcPCBgzYtlpNewiOx4yiXAXVwXCRITclhSdvORoILyVEbfW6ov0CY+R MPDA== X-Gm-Message-State: ACgBeo0xdl1oIjCC5NQlTZdBLHk3SMvdrz/QGs/aWjSkbU504/MxUvIi o2las4AWB3s4vqjuugpUejC5jP/TRqhKp9Iq8ZWAW1a8hKG8loZ4glTNHXr74kFijO+Rd71LELf Acyilc2w98pmIix3tFURhC/Ar X-Received: by 2002:adf:f643:0:b0:225:2cb3:4b05 with SMTP id x3-20020adff643000000b002252cb34b05mr13203060wrp.12.1661241306644; Tue, 23 Aug 2022 00:55:06 -0700 (PDT) X-Received: by 2002:adf:f643:0:b0:225:2cb3:4b05 with SMTP id x3-20020adff643000000b002252cb34b05mr13203037wrp.12.1661241306387; Tue, 23 Aug 2022 00:55:06 -0700 (PDT) Received: from ?IPV6:2003:cb:c70b:1600:c48b:1fab:a330:5182? (p200300cbc70b1600c48b1faba3305182.dip0.t-ipconnect.de. [2003:cb:c70b:1600:c48b:1fab:a330:5182]) by smtp.gmail.com with ESMTPSA id c9-20020a05600c100900b003a2f6367049sm16281074wmc.48.2022.08.23.00.55.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Aug 2022 00:55:05 -0700 (PDT) Message-ID: Date: Tue, 23 Aug 2022 09:55:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US To: Hugh Dickins , Sean Christopherson Cc: "Kirill A . Shutemov" , Chao Peng , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, qemu-devel@nongnu.org, linux-kselftest@vger.kernel.org, Paolo Bonzini , Jonathan Corbet , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , luto@kernel.org, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, Quentin Perret , Michael Roth , mhocko@suse.com, Muchun Song , "Gupta, Pankaj" References: <20220706082016.2603916-1-chao.p.peng@linux.intel.com> <20220818132421.6xmjqduempmxnnu2@box> <226ab26d-9aa8-dce2-c7f0-9e3f5b65b63@google.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory In-Reply-To: <226ab26d-9aa8-dce2-c7f0-9e3f5b65b63@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 19.08.22 05:38, Hugh Dickins wrote: > On Fri, 19 Aug 2022, Sean Christopherson wrote: >> On Thu, Aug 18, 2022, Kirill A . Shutemov wrote: >>> On Wed, Aug 17, 2022 at 10:40:12PM -0700, Hugh Dickins wrote: >>>> On Wed, 6 Jul 2022, Chao Peng wrote: >>>> But since then, TDX in particular has forced an effort into preventing >>>> (by flags, seals, notifiers) almost everything that makes it shmem/tmpfs. >>>> >>>> Are any of the shmem.c mods useful to existing users of shmem.c? No. >>>> Is MFD_INACCESSIBLE useful or comprehensible to memfd_create() users? No. >> >> But QEMU and other VMMs are users of shmem and memfd. The new features certainly >> aren't useful for _all_ existing users, but I don't think it's fair to say that >> they're not useful for _any_ existing users. > > Okay, I stand corrected: there exist some users of memfd_create() > who will also have use for "INACCESSIBLE" memory. As raised in reply to the relevant patch, I'm not sure if we really have to/want to expose MFD_INACCESSIBLE to user space. I feel like this is a requirement of specific memfd_notifer (memfile_notifier) implementations -- such as TDX that will convert the memory and MCE-kill the machine on ordinary write access. We might be able to set/enforce this when registering a notifier internally instead, and fail notifier registration if a condition isn't met (e.g., existing mmap). So I'd be curious, which other users of shmem/memfd would benefit from (MMU)-"INACCESSIBLE" memory obtained via memfd_create()? -- Thanks, David / dhildenb